[SR-Users] Locate UA in usrloc table

Daniel-Constantin Mierla miconda at gmail.com
Wed Oct 3 13:02:56 CEST 2012


Hello,

On 9/28/12 1:09 PM, Vitaliy Aleksandrov wrote:
> Hi all.
>
> Is there any easy method to find if somebody with $si:$sp is 
> registered (usrloc->received.ip == $si, usrloc->received.port == $sp) ?
> reg_fetch_contacts uses uri as search key, but in my case I don't have 
> it.
>
> The only way I know is to write a module that will use 
> "get_all_ucontacts" function exported by usrloc module in its API.
no, there isn't such filter exported by usrloc. You need to write some c 
code if you want it.

If you save immediately in the database, then you can do an sql query 
over location table.

Alternative is to use htable to store such details.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - http://asipto.com/u/kat
Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012 - http://asipto.com/u/katu




More information about the sr-users mailing list