royneary / mod_push

Other
68 stars 19 forks source link

No s2s connection found #19

Closed LacieNat closed 8 years ago

LacieNat commented 8 years ago

Hi

I'm new to ejabberd and am still figuring out why I'm getting certain errors and stuff.

I am currently making an iphone app that sends the following stanza to my ejabberd server to register for push notifications

`

token retrieved from apple

`

However I get the following error back: ` <iq xmlns="jabber:client" from="register.server.com" to="user@server.com/resource" type="error" id="id"> <command xmlns="http://jabber.org/protocol/commands" node="register-push-apns" action="execute"> <x xmlns="jabber:x:data" type="submit">

device token
    </x>
</command>
<error code="503" type="cancel">
    <service-unavailable
        xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
        <text
            xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">No s2s connection found
        </text>
    </error>
</iq>

`

My configuration is as follows:

` mod_pubsub:

access_createnode: pubsub_createnode

db_type: odbc
host: "pubsub.@HOST@"
nodetree: "virtual"
## reduces resource comsumption, but XEP incompliant
ignore_pep_from_offline: true
## XEP compliant, but increases resource comsumption
## ignore_pep_from_offline: false
last_item_cache: false
plugins:
  - "flat"
  - "hometree"
  - "pep" # pep requires mod_caps
  - "push"

mod_push: include_message_bodies: true include_senders: true access_backends: all backends:

    type: apns
    #app_name: "APPNAME"
    certfile: "/home/ubuntu/PushCertificates.pem"
    pubsub_host: "pubsub.@HOST@"
    register_host: "register.@HOST@"

`

What exactly does no s2s connection mean and how can I solve this error?

LacieNat commented 8 years ago

This issue was solved after I have changed the configuration of register_host.

I am not sure why but apparently the register host has to be server host itself

So after changing register_host: "register.server.com"

to

register_host: "server.com"

I can complete my registration. Also make sure u use the full server domain instead of @HOST@ as u will generate an item-not-found error