the answer to this problem is NO! there is no sure fire way to do this that will be 100% foolproof !<br><br>so my suggestion is... just give up and make your phones subscribe! They'll do it when they boot O_O<br><br><br>
<br><div class="gmail_quote">On Mon, Sep 28, 2009 at 4:59 AM, Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Alex, take care that the functionality I mentioned exists only in 1.6<br>
(if you need a backport to 1.5 let me know).<br>
<div class="im"><br>
Regards,<br>
Bogdan<br>
<br>
Alex G wrote:<br>
</div><div class="im">> ok I will test this method, this seems better than nothing at this<br>
> point. Thanks Bogdon!<br>
><br>
> On Sun, Sep 27, 2009 at 4:33 AM, Bogdan-Andrei Iancu<br>
</div><div><div></div><div class="h5">> <<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a> <mailto:<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>>> wrote:<br>
><br>
> Hi Alex,<br>
><br>
> As said, from SIP point of view, a registrar cannot tell (in a<br>
> reliable<br>
> way) if a registration is a first registration or a re-registration.<br>
> Simply there is no information to help with this. No hocus-pocus with<br>
> deleting the previous registrations or unregister will not help.<br>
><br>
> BUT, the only thing you can use is that during a re-registration the<br>
> callid may be preserved (and cseq increased), while during a fast<br>
> reboot, the callid (in REGISTER) will be definitely a new one.<br>
><br>
> So, as you can see, you can make 100% distinction between the two<br>
> cases,<br>
> but you can identify a first registration (when a new callid is<br>
> received<br>
> from the client). So , if it is not a big issue that you may detect<br>
> "supplementary" first-register events (like a re-register when the<br>
> client simply decide to change the callid), you can use in 1.6 the new<br>
> "callid" parameter on the "registered()" param:<br>
><br>
> <a href="http://www.opensips.org/html/docs/modules/devel/registrar.html#id271243" target="_blank">http://www.opensips.org/html/docs/modules/devel/registrar.html#id271243</a><br>
><br>
> like:<br>
> if (registered("location","$to","$ci")) { -> received callid is<br>
> already registered -> not a first registration}<br>
><br>
><br>
> Regards,<br>
> Bogdan<br>
><br>
> Alex G wrote:<br>
> > this still does not solve the issue of a reboot that occurs in under<br>
> > 60 seconds. if a phone does not unregister on reboot, the record<br>
> > remains in the db for those 60 seconds. if it comes back up in under<br>
> > 60 seconds, then to opensips it looks like a reregistration.<br>
> ><br>
> > is there someway to discern this scenario from the info in the<br>
> > location table that is already there? maybe the callid or cseq or<br>
> > something?<br>
> ><br>
> > On Sat, Sep 26, 2009 at 1:43 PM, Alex Balashov<br>
> > <<a href="mailto:abalashov@evaristesys.com">abalashov@evaristesys.com</a> <mailto:<a href="mailto:abalashov@evaristesys.com">abalashov@evaristesys.com</a>><br>
</div></div>> <mailto:<a href="mailto:abalashov@evaristesys.com">abalashov@evaristesys.com</a><br>
<div><div></div><div class="h5">> <mailto:<a href="mailto:abalashov@evaristesys.com">abalashov@evaristesys.com</a>>>> wrote:<br>
> ><br>
> > As Inaki said, what you're trying to achieve is a little<br>
> ridiculous.<br>
> ><br>
> > But, if you must do it, I recommend using a database capable of<br>
> > advanced triggers and decent stored procedures (PostgreSQL)<br>
> and using<br>
> > usrloc and registrar with full database backing and no<br>
> caching or<br>
> > synchronisation (changes immediately reflected in database).<br>
> Then put<br>
> > a trigger on your 'location' table. Trying to do this from<br>
> the route<br>
> > script is silly.<br>
> ><br>
> > Alex G wrote:<br>
> ><br>
> > > I have a scenario where I'm trying to fire a script based<br>
> on the<br>
> > first<br>
> > > registration of a device. In normal circumstances I can<br>
> check the<br>
> > > location table using registered() function and if there is an<br>
> > entry i<br>
> > > know it's not the first registration. My problem is when a<br>
> phone<br>
> > does a<br>
> > > quick reboot., it sometimes comes back on line before the<br>
> > phone's entry<br>
> > > is removed from the location table. In this case, the<br>
> above solution<br>
> > > does not work.<br>
> > ><br>
> > > Can anyone provide advice on how to determine first<br>
> registration<br>
> > of a<br>
> > > phone coming back online in another way?<br>
> > ><br>
> > ><br>
> > ><br>
> ><br>
> ------------------------------------------------------------------------<br>
> > ><br>
> > > _______________________________________________<br>
> > > Users mailing list<br>
> > > <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a> <mailto:<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>><br>
</div></div>> <mailto:<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a> <mailto:<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>>><br>
<div class="im">> > > <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
> ><br>
> ><br>
> > --<br>
> > Alex Balashov - Principal<br>
> > Evariste Systems<br>
> > Web : <a href="http://www.evaristesys.com/" target="_blank">http://www.evaristesys.com/</a><br>
> > Tel : (+1) (678) 954-0670<br>
> > Direct : (+1) (678) 954-0671<br>
> ><br>
> > _______________________________________________<br>
> > Users mailing list<br>
> > <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a> <mailto:<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>><br>
</div>> <mailto:<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a> <mailto:<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>>><br>
<div><div></div><div class="h5">> > <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
> ><br>
> ><br>
> ><br>
> ------------------------------------------------------------------------<br>
> ><br>
> > _______________________________________________<br>
> > Users mailing list<br>
> > <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a> <mailto:<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>><br>
> > <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
> ><br>
><br>
><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a> <mailto:<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>><br>
> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
><br>
><br>
> ------------------------------------------------------------------------<br>
><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
><br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br>