[OpenSIPS-Users] Opensips2.2 Asterisk Sub registartion
Bogdan-Andrei Iancu
bogdan at opensips.org
Tue Jun 14 13:29:33 CEST 2016
Hi Kirill,
I suppose you want to pass the registration to Asterisk, after is was
authenticated (and eventually saved) by OpenSIPS, right ?
To do this in the correct way (from SIP perspective), after you have
authenticated the REGISTER on OpenSIPS, you forward it to Asterisk
_WITHOUT_ saving it into OpenSIPS. When you receive the reply back from
Asterisk, you do the save("location") in OpenSIPS. Why ? as in this
registration chain, Asterisk is the main final registrar and it may
change the registration expire value:
Ex:
* UAC sends register with 100 secs to OpenSIPS
* OpenSIPS save() and has UAC registered for 100 secs
* OpenSIPS relays/creates register to Asterisk with 100 secs
* Asterisk decides to store registration only for 60 secs and
returns reply with expires=60
Result ? OpenSIPS will have UAC registered for 100 and Asterisk for 60,
while the UAC thinks it is registered for 100 (according to the reply
from OpenSIPS) - this is totally bogus.
Correct flow:
* UAC sends register with 100 secs to OpenSIPS
* OpenSIPS relays/creates register to Asterisk with 100 secs
* Asterisk decides to store registration only for 60 secs and
returns reply with expires=60
* OpenSIPS receives the reply from Asterisk and saves UAC
registration for 60 secs too
* OpenSIPS sends reply to UAC withe expires 60
Result ? OpenSIPS will have UAC registered for 60 and so Asterisk ; UAC
thinks it is registered for 60 (according to the reply from OpenSIPS) -
this is 100% correct.
Conclusion - when you do have a registration chain, on the intermediary
registrar you do save() on 200 OK as the next registrar may change the
expire value.
So, simply use the save() function in onreply_route when receiving the
REGISTER reply from Asterisk:
http://www.opensips.org/html/docs/modules/2.2.x/registrar.html#id294033
Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 14.06.2016 13:42, Kirill Galinurov wrote:
> Hi all. How i can do subregistration on asterisk like in kamaillio.
> http://kb.asipto.com/asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb.
>
> I have some webrtc users/ They register on opensips.
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20160614/e50b13aa/attachment.htm>
More information about the Users
mailing list