[OpenSIPS-Users] OpenSIPS NOTIFY for MWI on Asterisk PUBLISH?

Gregory Massel greg at switchtel.co.za
Mon Jul 13 01:59:36 EST 2020


Hello

I'm wondering whether it is possible to bulk publish MWI information 
from Asterisk to OpenSIPS and have OpenSIPS generate NOTIFY messages?

I've set up Asterisk with PJSIP as follows:

[opensips-mwi]
type=outbound-publish
server_uri=sip:asterisk-mwi at opensips:5060
event=asterisk-mwi

[opensips-mwi]
type=asterisk-publication
mailboxstate_publish=opensips-mwi
device_state=no
mailbox_state=yes

Now it's generating numerous SIP requests such as the following:

PUBLISH sip:asterisk-mwi at opensips:5060 SIP/2.0
Via: SIP/2.0/UDP 1.2.3.4:5060;rport;branch=z9hG4bKPj00450957-4e0c-408e-bdc2-3a4560613253
From: <sip:asterisk-mwi at opensips>;tag=d13b162a-6b45-418e-9443-66944b5cc88e
To: <sip:asterisk-mwi at opensips>
Call-ID: 761d94e5-1d41-4bfd-9354-66651e1692bd
CSeq: 17836 PUBLISH
Event: asterisk-mwi
Expires: 3600
Max-Forwards: 70
User-Agent: Asterisk
Content-Type: application/json
Content-Length:    93

{"type":"mailboxstate","uniqueid":"201 at test","old":0,"new":0,"eid":"90:b1:1c:0d:12:84"}

However, I'm struggling to transform these on OpenSIPS.
I've used the json.so module to interpret the body and sipmsgops.so to 
remove and the old body and add a newly constructed body with an 
application/simple-message-summary structure.
I've managed to get the packet looking almost right, however, one major 
issue remains:
No matter what I do, I cannot modify the request method from PUBLISH to 
NOTIFY.
Using subst("/PUBLISH/NOTIFY/") from textops.so, it succeeds in 
modifying the CSeq header, but it cannot change the request method.

Is it possible to modify the request method? If not, is there some other 
way that I can generate completely new MWI NOTIFY packets?

Note that presence is working 100%; that's not an issue. It's strictly 
MWI that's a problem.
Documentation on presence_mwi.so seems to be extremely limited. It's 
unclear what it actually does.

It's not really an option to have a separate PJSIP endpoint definition 
in Asterisk for each mailbox as Asterisk/PJSIP struggles to reload with 
tens of thousands of endpoints. Things work reasonably up until roughly 
12,000 endpoints, but beyond that reloads get slow. I don't forsee this 
being any better with realtime, as sorcery would still have to load all 
the endpoints into cache and merge the changes. Having a single 
(OpenSIPS) endpoint in Asterisk and publishing the voicemail status 
should allow for far greater scale.

Any help would be greatly appreciated.

Regards
Gregory Massel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20200713/38e04ee6/attachment.html>


More information about the Users mailing list