[OpenSIPS-Users] Cachedb_local question
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.
Based on the info found in that email I was able to put something like this together.
if ($ct.fields(expires) == '0')
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
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
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  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 . Here's a simple one I use to throw a syslog entry for such an occasion:
$var(aor) = 0;
xlog("L_NOTICE", "** $var(aor) is DOWN\n");
Hopefully that's helpful.
On Tue, Dec 8, 2015 at 11:07 AM, Travis Manson-Drake <travism at simplybits.com<mailto:travism at simplybits.com>> wrote:
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!
Voice Systems Analyst L1
Simply Bits, LLC
Now You’re Thinkin’ Smart!
5225 N. Sabino Canyon Road
Tucson, AZ 85750
Support Hotline: 5205450333
Users mailing list
Users at lists.opensips.org<mailto:Users at lists.opensips.org>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Users