<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
Hello<br>
<br>
I'm wondering whether it is possible to bulk publish MWI information
from Asterisk to OpenSIPS and have OpenSIPS generate NOTIFY
messages?<br>
<br>
I've set up Asterisk with PJSIP as follows:<br>
<pre>[opensips-mwi]
type=outbound-publish
server_uri=<a class="moz-txt-link-freetext" href="sip:asterisk-mwi@opensips:5060">sip:asterisk-mwi@opensips:5060</a>
event=asterisk-mwi
[opensips-mwi]
type=asterisk-publication
mailboxstate_publish=opensips-mwi
device_state=no
mailbox_state=yes
</pre>
Now it's generating numerous SIP requests such as the following:<br>
<pre>PUBLISH <a class="moz-txt-link-freetext" href="sip:asterisk-mwi@opensips:5060">sip:asterisk-mwi@opensips:5060</a> SIP/2.0
Via: SIP/2.0/UDP 1.2.3.4:5060;rport;branch=z9hG4bKPj00450957-4e0c-408e-bdc2-3a4560613253
From: <a class="moz-txt-link-rfc2396E" href="sip:asterisk-mwi@opensips"><sip:asterisk-mwi@opensips></a>;tag=d13b162a-6b45-418e-9443-66944b5cc88e
To: <a class="moz-txt-link-rfc2396E" href="sip:asterisk-mwi@opensips"><sip:asterisk-mwi@opensips></a>
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@test","old":0,"new":0,"eid":"90:b1:1c:0d:12:84"}
</pre>
However, I'm struggling to transform these on OpenSIPS. <br>
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.<br>
I've managed to get the packet looking almost right, however, one
major issue remains:<br>
No matter what I do, I cannot modify the request method from PUBLISH
to NOTIFY.<br>
Using subst("/PUBLISH/NOTIFY/") from textops.so, it succeeds in
modifying the CSeq header, but it cannot change the request method.<br>
<br>
Is it possible to modify the request method? If not, is there some
other way that I can generate completely new MWI NOTIFY packets?<br>
<br>
Note that presence is working 100%; that's not an issue. It's
strictly MWI that's a problem.<br>
Documentation on presence_mwi.so seems to be extremely limited. It's
unclear what it actually does.<br>
<br>
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.<br>
<br>
Any help would be greatly appreciated.<br>
<br>
Regards<br>
Gregory Massel<br>
</body>
</html>