[OpenSIPS-Users] how do you determine first registration of a device
Alex Balashov
abalashov at evaristesys.com
Sat Sep 26 21:10:50 CEST 2009
A new REGISTER request will certainly have a different Call-ID.
However, I think the correct way to handle this is to just live with
it. If the phone did not "unregister," then it will be subject to the
consequences of that, and it's okay.
Kamailio 1.5.x's registrar module has a function called
reg_free_contacts() which you could use if a save() fails due to a
contact already existing in memory or database and then call save().
Perhaps OpenSIPS will implement something like this at some point.
Alex G wrote:
> this still does not solve the issue of a reboot that occurs in under 60
> seconds. if a phone does not unregister on reboot, the record remains in
> the db for those 60 seconds. if it comes back up in under 60 seconds,
> then to opensips it looks like a reregistration.
>
> is there someway to discern this scenario from the info in the location
> table that is already there? maybe the callid or cseq or something?
>
> On Sat, Sep 26, 2009 at 1:43 PM, Alex Balashov
> <abalashov at evaristesys.com <mailto:abalashov at evaristesys.com>> wrote:
>
> As Inaki said, what you're trying to achieve is a little ridiculous.
>
> But, if you must do it, I recommend using a database capable of
> advanced triggers and decent stored procedures (PostgreSQL) and using
> usrloc and registrar with full database backing and no caching or
> synchronisation (changes immediately reflected in database). Then put
> a trigger on your 'location' table. Trying to do this from the route
> script is silly.
>
> Alex G wrote:
>
> > I have a scenario where I'm trying to fire a script based on the
> first
> > registration of a device. In normal circumstances I can check the
> > location table using registered() function and if there is an entry i
> > know it's not the first registration. My problem is when a phone
> does a
> > quick reboot., it sometimes comes back on line before the phone's
> entry
> > is removed from the location table. In this case, the above solution
> > does not work.
> >
> > Can anyone provide advice on how to determine first registration of a
> > phone coming back online in another way?
> >
> >
> >
> ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Users mailing list
> > Users at lists.opensips.org <mailto:Users at lists.opensips.org>
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> --
> Alex Balashov - Principal
> Evariste Systems
> Web : http://www.evaristesys.com/
> Tel : (+1) (678) 954-0670
> Direct : (+1) (678) 954-0671
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org <mailto:Users at lists.opensips.org>
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
--
Alex Balashov - Principal
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
More information about the Users
mailing list