[OpenSIPS-Users] Cachedb_local question

Travis Manson-Drake travism at simplybits.com
Wed Dec 9 17:29:18 CET 2015


Good morning everyone!

Just wanted to follow up on this, I think I may have found a way to do this based an old email from 2010.

http://lists.opensips.org/pipermail/users/2010-July/013646.html

Based on the info found in that email I was able to put something like this together.

        if ($ct.fields(expires) == '0')
                {
                cache_remove("local",'$fU');
                exit;
                }

Which now, checks to see if Expires In the Header is set to 0 (meaning a de-registrations)

Again, thank you for your help Jeff & everyone!

From: Travis Manson-Drake
Sent: Tuesday, December 8, 2015 10:29 AM
To: OpenSIPS users mailling list <users at lists.opensips.org>
Subject: RE: [OpenSIPS-Users] Cachedb_local question

Hey Jeff,

I’m sorry I should have clarified if my first email.

OpenSips isn’t actually handling the registration request’s in my case. It’s simply relaying those to an Asterisk server. Then relaying traffic from asterisk to the UAC. (a middle man)

I was thinking of doing an “If(method is(blah)) do something cool” but the unregister asterisk gives back is specific to asterisk and not SIP =(

I think I might have a work around, but its not the cleanest way of doing things.





From: users-bounces at lists.opensips.org<mailto:users-bounces at lists.opensips.org> [mailto:users-bounces at lists.opensips.org] On Behalf Of Jeff Pyle
Sent: Tuesday, December 8, 2015 9:50 AM
To: OpenSIPS users mailling list <users at lists.opensips.org<mailto:users at lists.opensips.org>>
Subject: Re: [OpenSIPS-Users] Cachedb_local question

Travis,

You don't really have to "tell" OpenSIPS if a client is unregistered.  In the simple case, you'll do a lookup() within your script, and it will return [1] with an error code of -1 if the contact is not registered.

If you want to run your logic when a client goes unregistered, rather than detecting it during the script execution, you can use an event route [2].  Here's a simple one I use to throw a syslog entry for such an occasion:

event_route[E_UL_AOR_DELETE] {
        $var(aor) = 0;
        fetch_event_params("aor=$var(aor)");
        xlog("L_NOTICE", "** $var(aor) is DOWN\n");
}

Hopefully that's helpful.

  [1] http://www.opensips.org/html/docs/modules/2.1.x/registrar.html#id294366
  [2] http://www.opensips.org/html/docs/modules/2.1.x/usrloc.html#id295250


- Jeff


On Tue, Dec 8, 2015 at 11:07 AM, Travis Manson-Drake <travism at simplybits.com<mailto:travism at simplybits.com>> wrote:
Hello everyone!
Hope you’re all doing well.

Does anyone know of a way I might tell opensips when a UAC becomes un registered? Or what value I might tell it to parse to see if that UAC is unregistered?

Really what I’m trying to do is have an if statement that preforms some logic if the UAC reports back unregistered or unavail.

Any input is greatly appreciated!

Happy Holidays!


Travis Manson-Drake
Voice Systems Analyst L1
Simply Bits, LLC
Now You’re Thinkin’ Smart!
5225 N. Sabino Canyon Road
Tucson, AZ 85750
Phone: 520-545-0311
Fax: 520-545-7252
Support Hotline: 5205450333
www.simplybits.com<http://www.simplybits.com/>


_______________________________________________
Users mailing list
Users at lists.opensips.org<mailto: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/20151209/1e4eb813/attachment-0001.htm>


More information about the Users mailing list