SUBSCRIBE to MWI with PJSIP

Hi.

I have a SIP client which requires to SUBSCRIBE to message waiting in order to process the NOTIFYcations which are sent from Asterisk. If the SUBSCRIBE is not successful then client ignores the gratuitous NOTIFYs.

I’m trying to connect this client to a commercial PBX based on Asterisk 18 using PJSIP.

  1. The client can REGISTER, receive calls, and place calls. No problem there.
  2. The client can successfully SUBSCRIBE to “presence” and get NOTIFYd of “Ready”, “Ringing”, “Unavailable” etc.
  3. When the client attempts to SUBSCRIBE to “message-summary” (MWI) the PBX responds with 404 Not Found.

The above are all for the same account using the same credentials. In the case of SUBSCRIBEing to “message-summary”, the sequence is:
a) SUBSCRIBE (client to server)
b) 401 Unauthorised (server to client)
c) SUBSCRIBE with authentication (client to server)
d) 404 Not Found (server to client)

So, it’s pretty clear that authentication is not the problem (as well as the fact that the same credentials work for REGISTER and the client receives calls).

The client can SUBSCRIBE for “message-summary” perfectly straightforwardly to another Asterisk server which is running chan_sip (so, I don’t believe the SUBSCRIBE requests are malformed in any way).

I have a ticket open with the commercial PBX provider, but they don’t seem to understand SUBSCRIBE when their system is already sending out NOTIFYs with the “message-summary” information.

So, my question is: what settings for Asterisk itself or PJSIP in particular could affect whether a SUBSCRIBE for “message-summary” gets a 404 Not Found response when a SUBSCRIBE for “presence” works perfectly well?

What setting needs to be changed in order to support a SUBSCRIBE for “message-summary”?

Thanks,

Antony.

Subscribing for presence and message-summary are two completely different things, just because one works doesn’t mean the other will. For subscribing to MWI the mailbox(es) have to be configured on the AOR[1]. The endpoint also has to subscribe to the mailbox itself, so if the mailbox is 6000 then it needs to subscribe to 6000. There is also an option[2] that can be used to do unsolicited until a subscription occurs.

[1] https://github.com/asterisk/asterisk/blob/master/configs/samples/pjsip.conf.sample#L1133
[2] https://github.com/asterisk/asterisk/blob/master/configs/samples/pjsip.conf.sample#L674

1 Like

Subscribing for presence and message-summary are two completely different
things, just because one works doesn’t mean the other will.

Agreed, however I simply wanted to make it clear that this client is
completely capable of authenticating to the server, in order to avoid anyone
suggesting that that was the problem, causing the 404 Not Found.

For subscribing to MWI the mailbox(es) have to be configured on the AOR[1].

That’s potentially useful information I can feed back to the provider.

The endpoint also has to subscribe to the mailbox itself,

I presume that by “endpoint” you’re referring to my SIP client?

so if the mailbox is 6000 then it needs to subscribe to 6000.

Pardon my ignorance, but what else would it subscribe to? My extension on
this system is 941, and the mailbox is 941, so my SUBSCRIBE request is
specifying 941. I don’t really see what the alternative would be?

There is also an option[2] that can be used to do unsolicited until a
subscription occurs.

The PBX system is sending unsolicited NOTIFYs containing the message-summary
data, however this SIP client ignores that unless / until it has successfully
SUBSCRIBEd and received a 200 OK response.

[1]
https://github.com/asterisk/asterisk/blob/master/configs/samples/
pjsip.conf.sample#L1133

So, in your example above, this should be mailboxes=6000?

[2]
https://github.com/asterisk/asterisk/blob/master/configs/samples/
pjsip.conf.sample#L674

So, if mwi_subscribe_replaces_unsolicited=no does that mean that a SIP client
can SUBSCRIBE, but that the server will also continue sending unsolicited
NOTIFYs (for other clients which aren’t so fussy)?

Thanks,

Antony.

Within the SIP protocol you can subscribe for mailboxes which aren’t the same as your user account. If the mailbox is 941 then the SUBSCRIBE request from the endpoint should be for 941. In my example it would be “mailboxes=6000@default” or whichever voicemail context. If “mwi_subscribe_replaces_unsolicited=no” then I believe the SUBSCRIBE would be rejected.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.