jingle not being sent to push servers?

110 views
Skip to first unread message

Dominique Martinet

unread,
Mar 4, 2022, 5:59:06 AM3/4/22
to prosod...@googlegroups.com
Hello,

One of my user is using Siskin IM, and I can't seem to get calls through
them when the device is locked.

I brought it up with siskin devs[1], and it turns out the pushed content
might just not contain enough information for siskin to act
appropriately:
[1] https://github.com/tigase/siskin-im/issues/177


I've temporarily enabled stanza_debug and uncommented the "PUSH STANZA"
log in mod_cloud_notify.lua, so let's start with what I see (full log attached
for the first few seconds, after this there's 5s silence, the iphone just
displayed "New message!" on screen):
- Conversation sending a jingle:
<propose id='jNQiEITkIrabbQsIpubcVQ' xmlns='urn:xmpp:jingle-message:0'><description xmlns='urn:xmpp:jingle:apps:rtp:1' media='audio'/>
- prosody sending a generic push message to siskin notification cloud:
<iq id='fd8cce2d7fbff187af47143f02c89cabfba3c61144e6ba521e6c5616409b266d' type='set' from='mydomain.org' to='push.tigase.im'><pubsub xmlns='http://jabber.org/protocol/pubsub'><publish node='01#0A01D769C751A5D0E09F8F2BD8A8F73C9351C6497C42F8C7DE095A9DAE33CD17'><item><notification xmlns='urn:xmpp:push:0'><x type='form' xmlns='jabber:x:data'><field type='hidden' var='FORM_TYPE'><value>urn:xmpp:push:summary</value></field><field type='text-single' var='message-count'><value>1</value></field><field type='text-single' var='pending-subscription-count'/><field type='jid-single' var='last-message-sender'/><field type='text-single' var='last-message-body'><value>New Message!</value></field></x><priority xmlns='tigase:push:priority:0'>high</priority></notification></item></publish></pubsub></iq>
- there's nothing indicating siskin contacted prosody to fetch the
actual content on server: they're happy with just the push notification
which seems harmless enough.
(I'm not sure if it's their design or an iOS limitation)

From my understanding of what hantu85 said, they expect prosody to
include a jingle in the push notification, so this corresponds to the
behaviour I'm observing.


Unfortunately I don't know what format they're expecting exactly
(perhaps just sending the urn:xmpp:jingle-message:0 as is in the push
notification be enough?), but before I start digging into the cloud
module I'd appreciate if someone more familiar with how xmpp works than
me could confirm I've got this right and if I'm lucky just point me to
an option somewhere that magically works?!


What I've tried so far:
- I've added mod_cloud_notify_extensions, mod_cloud_notify_encrypted
and mod_cloud_notify_filters which were referring to siskin in their
README.
mod_cloud_notify_encrypted in particular made text message bodies
sometimes be included in notifications, but didn't change anything for
voice messages (still including dummy text)
- I've tried sending notification body anyway (setting
push_notification_with_body), which doesn't appear to change anything
either
- I've tried disabling OMEMO temporarly just to check, and no
difference either (my understanding is that the jingle isn't encrypted
anyway)



Thanks for any help :)
--
Dominique Martinet | Asmadeus
prosody.log

Dominique Martinet

unread,
Mar 5, 2022, 6:44:34 AM3/5/22
to prosod...@googlegroups.com, Matthew Wild
(+Matthew Wild in Ccs as it looks like he was the author of prosody
support for what I've been looking at)

Dominique Martinet wrote on Thu, Mar 03, 2022 at 11:57:42PM +0900:
> One of my user is using Siskin IM, and I can't seem to get calls
> through them when the device is locked.
>
> I brought it up with siskin devs[1], and it turns out the pushed
> content might just not contain enough information for siskin to act
> appropriately:
> [1] https://github.com/tigase/siskin-im/issues/177
>
> [...]
>
> What I've tried so far:
> - I've added mod_cloud_notify_extensions, mod_cloud_notify_encrypted
> and mod_cloud_notify_filters which were referring to siskin in their
> README.
> mod_cloud_notify_encrypted in particular made text message bodies
> sometimes be included in notifications, but didn't change anything for
> voice messages (still including dummy text)

Looking a bit further at the code (siskin-im's, tigase-server which I
don't run but would expect to work, and prosody module's) it looks like
the missing feature would be proper 'tigase:push:jingle:0' support, as
described (briefly) here:
https://xeps.tigase.net//docs/push-notifications/encrypt/

In particular, this section:
---
Instead of the form mentioned above, the XMPP server SHOULD create a
JSON object with following fields:

unread - containing a number of unread messages
sender - containing a JID of a stanza sender causing this
notification (should be bare JID, with exception for
JingleMessageInitiation as in this case full JID is
required)
type - type of the push notification:
chat - for 1-1 messages
groupchat - for MUC rooms and groupchat messages
subscribe - for presence subscribe requests
call - for jingle calls
message - body of a message (if available, MAY be only first part of
the message body)
nickname - in case of a message of type groupchat, this field should
be set to the nickname of the message sender (optional)
sid - in case of a Jingle session initiation, session id of the
Jingle call initiated by message (optional)
media - in case of Jingle session initiation (JMI <propose/>), list
of proposed values of media attribute from each proposed
<description/> element (optional but required for Jingle
session initiation/JMI propose)
---

Now the feature was added last year to mod_cloud_notify_encrypted, and I
can see it's all there from announcing the feature to filling in the
payload with type = call, sid, media_types and full sender...

So I guess I'll add a few more debug lines in there and try to
understand if yes or no this code path is actually taken and what is
being sent... I can only test this when my user is around so that'll
have to wait.

Meanwhile, if someone have been through this before, I'd appreciate a
link to a working config or some feedback :)


Cheers,
--
Dominique Martinet | Asmadeus

Matthew Wild

unread,
Mar 5, 2022, 7:49:35 AM3/5/22
to Prosody IM Users Group
Hi Dominique!

On Sat, 5 Mar 2022 at 07:32, Dominique Martinet <asma...@codewreck.org> wrote:
Dominique Martinet wrote on Thu, Mar 03, 2022 at 11:57:42PM +0900:
> One of my user is using Siskin IM, and I can't seem to get calls
> through them when the device is locked.

The most important step is to ensure the necessary modules for Siskin's push extensions are loaded (looks like you already found those).

If the device originally connected before you enabled those modules, it may have registered to receive normal push notifications only (because the feature was not advertised). You can inspect the push registration state in Prosody's storage, and check for the presence of this 'encryption' section: https://hg.prosody.im/prosody-modules/file/8231774f5bfd/mod_cloud_notify_encrypted/mod_cloud_notify_encrypted.lua#l55 - if that's missing, that's the most likely cause of the call notification not being generated. If it's missing, the client will need to re-register.

As for a working config, you can check Snikket's config here: https://github.com/snikket-im/snikket-server/blob/master/ansible/files/prosody.cfg.lua

And some bonus advice around group chat notifications I shared here: https://github.com/snikket-im/snikket-ios/issues/145#issuecomment-979292439

Hope this helps!

Regards,
Matthew

Dominique Martinet

unread,
Mar 5, 2022, 8:33:13 AM3/5/22
to prosod...@googlegroups.com
Hello,

Matthew Wild wrote on Sat, Mar 05, 2022 at 12:49:22PM +0000:
> The most important step is to ensure the necessary modules for Siskin's
> push extensions are loaded (looks like you already found those).

Yes!

> If the device originally connected before you enabled those modules, it may
> have registered to receive normal push notifications only (because the
> feature was not advertised). You can inspect the push registration state in
> Prosody's storage, and check for the presence of this 'encryption' section:
> https://hg.prosody.im/prosody-modules/file/8231774f5bfd/mod_cloud_notify_encrypted/mod_cloud_notify_encrypted.lua#l55
> - if that's missing, that's the most likely cause of the call notification
> not being generated. If it's missing, the client will need to re-register.

Good point -- I added a log message in the discovery function to check
if it was rediscovered on server restart (client reconnect), but while
it looks like Conversation does recheck these I indeed can't find traces
that Siskin did... And I can't find anything related to encryption in
prosody storage that's not plain OMEMO stuff, so that would probably
what I had been missing...

Aaand, yes. Killing the account in siskin and re-enabling it made the
encrpytion section appear in prosody/cloud_notify/thatuser.dat, and
call went through!
Thanks!!

> As for a working config, you can check Snikket's config here:
> https://github.com/snikket-im/snikket-server/blob/master/ansible/files/prosody.cfg.lua

Thank you, I'm probably missing other things so I'll check with it.

> And some bonus advice around group chat notifications I shared here:
> https://github.com/snikket-im/snikket-ios/issues/145#issuecomment-979292439

That user thanksfully doesn't use group chats, so I'll wait for the 0.12
release and read this again when the time comes :-)

Cheers,
--
Dominique
Reply all
Reply to author
Forward
0 new messages