[OpenSIPS-Users] remove function not working for specific contact
Jayesh Nambiar
jayesh1017 at gmail.com
Sat Nov 21 08:09:55 CET 2015
Hi,
Alright, can someone please confirm if remove function in registrar module
works as expected. If my UL SHOW shows this, what should be used to remove
this particular contact only form the location:
ecef74d17522a634b0412c at abc.com
Contact:: sip:ecef74d17522a634b0412c at 11.22.33.44:54332;rinstance=ca9915acb1b3e3a1;transport=tls
Q=
Expires:: 137
Callid:: YTdlZjVjNzMxYTg1ZWI5ZTZkMDgzODJiYmMyZjA5MzQ.
Cseq:: 1
User-agent:: v2.0beta_ios
Path:: <sip:44.33.22.11:7300;lr>
State:: CS_NEW
Flags:: 0
Cflags:: 30
Socket:: udp:55.66.77.88:7300
Methods:: 1391
I assumed it to be remove("location", "cef74d17522a634b0412c at abc.com", "
sip:ecef74d17522a634b0412c at 11.22.33.44:54332")
I tried this but didn't work. If this is correct I'll log and check if this
is exactly what I'm passing to the remove function and check whats wrong.
Thanks,
- Jayesh
On Tue, Nov 17, 2015 at 3:32 PM Jayesh Nambiar <jayesh1017 at gmail.com> wrote:
> Hello Razvan,
> My idea is to keep one registration per device and hence the fc1 option
> wouldn't work for me here. Meaning the account can register from multiple
> locations using multiple devices, but if the same device tries to initiate
> a new register when there is an existing record in the location, I want to
> remove the existing one and save the new one. Moreover, my clients do not
> support GRUU and hence thats not the right path for me currently.
> So here's the idea:
> 1) On a REGISTER request, my clients come with an id that is unique to a
> device.
> 2) On successful registration, I store in local-cache the contact and
> callid for this particular device-id.
> 3) For all REGISTER, I check if AOR with callid is registered using the
> 'registered("location", "AOR", "callid")' function.
> 4) If registered returns true for the current callid, I consider it to be
> a Re-REGISTER.
> 5) If registered for current callid returns false, I fetch the contact
> for device_id from local-cache. If the contact exists, meaning the same
> device is doing a new REGISTER. In this case, I need to remove the existing
> contact for this AoR.
> 6) This mostly happens when a client is registered and loses connectivity.
> The client when restarted creates a new registration with new callid
> without un-registering the existing one on the server.
> 7) The server deletes the device-id from the location on Un-REGISTER. I
> identify this when Expires header is 0.
>
> Do let me know if this is do-able in a neater way. Thanks in advance.
>
> - Jayesh
>
> On Tue, Nov 17, 2015 at 2:48 PM Răzvan Crainea <razvan at opensips.org>
> wrote:
>
>> Hi, Jayesh!
>>
>> If I understood correctly, you only want to have a single contact in
>> memory, right? If so, you can use the save[1] function, with flags c and f.
>> Something like:
>>
>> save("location", "fc1");
>>
>> [1]
>> http://www.opensips.org/html/docs/modules/2.1.x/registrar.html#id294034
>>
>> Best regards,
>>
>> Răzvan Crainea
>> OpenSIPS Solutionswww.opensips-solutions.com
>>
>> On 11/17/2015 08:37 AM, Jayesh Nambiar wrote:
>>
>> Hello All,
>> Just bumping in to check if there's a better way to remove an existing
>> contact from the location. My idea was to remove from the location a record
>> with particular callid or particular contact on specific scenarios. So I do
>> the following:
>> On a successful registration I store the some id that my device has along
>> with callid and contact.
>> On a subsequent registration, I compare the id and callid, if they are
>> different from the current registration, I need to remove the existing
>> contact with this callid
>> If the id and callid is same, I do nothing.
>>
>> Thanks,
>>
>> - Jayesh
>>
>> On Tue, Nov 10, 2015 at 6:59 PM Jayesh Nambiar <jayesh1017 at gmail.com>
>> wrote:
>>
>>> Forgot to mention. I'm using version 2.1.
>>>
>>> Thanks,
>>>
>>> - Jayesh
>>>
>>> On Tue, Nov 10, 2015 at 6:01 PM Jayesh Nambiar <jayesh1017 at gmail.com>
>>> wrote:
>>>
>>>> Hello,
>>>> I've been trying to delete specific contact for AOR using the remove
>>>> function in the registrar module, but somehow it doesn't remove it from the
>>>> location.
>>>> My db_mode is 0 as I only want to store it in opensips memory. I hav
>>>> the "use_domain" param as 1. On register, the contact gets stored in the
>>>> following format:
>>>>
>>>>
>>>> sip:579e08000 at 203.153.53.130:49612;rinstance=477b5477848ba584;transport=tcp
>>>>
>>>> I tried multiple ways to remove this:
>>>>
>>>> 1) remove("location", "sip:579e08000 at abc.com",
>>>> "sip:579e08000 at 203.153.53.130:49612;rinstance=477b5477848ba584;transport=tcp"
>>>> <sip:579e08000 at 203.153.53.130:49612;rinstance=477b5477848ba584;transport=tcp>
>>>> )
>>>>
>>>> 2) remove("location", "sip:579e08000 at abc.com", "
>>>> sip:579e08000 at 203.153.53.130:49612")
>>>>
>>>> Also, I'd like to mention that I have an edge proxy in the middle who
>>>> proxies the REGISTER to this Registrar and I use the PATH module to route
>>>> back reliably. I'm essentially trying to remove location entry for
>>>> particular endpoints based on some conditions.
>>>>
>>>> Any help is appreciated. Thanks,
>>>>
>>>> - Jayesh
>>>>
>>>
>>
>> _______________________________________________
>> Users mailing listUsers at lists.opensips.orghttp://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
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20151121/db3f2724/attachment.htm>
More information about the Users
mailing list