<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<tt>Hi Kirill,<br>
<br>
I suppose you want to pass the registration to Asterisk, after is
was authenticated (and eventually saved) by OpenSIPS, right ?<br>
<br>
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:<br>
Ex:<br>
* UAC sends register with 100 secs to OpenSIPS<br>
* OpenSIPS save() and has UAC registered for 100 secs<br>
* OpenSIPS relays/creates register to Asterisk with 100 secs<br>
* Asterisk decides to store registration only for 60 secs and
returns reply with expires=60<br>
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.<br>
<br>
Correct flow:</tt><br>
<tt><tt> * UAC sends register with 100 secs to OpenSIPS<br>
* OpenSIPS relays/creates register to Asterisk with 100 secs<br>
* Asterisk decides to store registration only for 60 secs
and returns reply with expires=60<br>
* OpenSIPS receives the reply from Asterisk and saves UAC
registration for 60 secs too<br>
* OpenSIPS sends reply to UAC withe expires 60<br>
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.<br>
<br>
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.<br>
<br>
So, simply use the save() function in onreply_route when
receiving the REGISTER reply from Asterisk:<br>
<a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/2.2.x/registrar.html#id294033">http://www.opensips.org/html/docs/modules/2.2.x/registrar.html#id294033</a><br>
<br>
</tt>Regards,<br>
</tt>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<div class="moz-cite-prefix">On 14.06.2016 13:42, Kirill Galinurov
wrote:<br>
</div>
<blockquote
cite="mid:CAPDUut_tBQ=zm55uosFF77p6RhXn4gNGWFW1Lbo6=q78euE8Vg@mail.gmail.com"
type="cite">
<div dir="ltr">Hi all. How i can do subregistration on asterisk
like in kamaillio.
<div><a moz-do-not-send="true"
href="http://kb.asipto.com/asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb">http://kb.asipto.com/asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb</a>. <br>
</div>
<div>I have some webrtc users/ They register on opensips. </div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>