[OpenSIPS-Users] Handle end of a transaction/dialog
Dave Singer
dave.singer at wideideas.com
Mon Nov 22 19:36:14 CET 2010
I'm not shure exactly when the automatick removal from groups is, you would
have to expiriment.
There are only a few end of call situations to cover.
Bye after a call was accepted (200 OK to INVITE). That comes in main
routing block but would usually be forwarded in the loose_route section. Add
an if (is_method("BYE")) and put logic there.
Cancel. That also comes in main routing block and is usually handled just
below the has_totag() stuff. Find is_method("CANCEL"). You would add it to
the if (t_check_trans())
Failures. Handled in the failure route block you activated for the call
with t_on_failure("?")
In each section, just use the unset_dlg_profile function for the group it
would be in.
Be careful with the BYE as it can come from either side of the call and
depending on what your grouping formula is based on you might need to make a
special case depending which end the BYE came from. I haven't looked at BYE
packets much. You may want to use
store_dlg_value(name,val)<http://www.opensips.org/html/docs/modules/1.6.x/dialog.html#id294530>
to
sore the group to pull it out at BYE with
fetch_dlg_value(name,pvar)<http://www.opensips.org/html/docs/modules/1.6.x/dialog.html#id294595>
.
On Fri, Nov 19, 2010 at 3:16 PM, <a.zagorskiy at oyster-telecom.ru> wrote:
> So, you explained how to store and grouping counters. Thanks.
> But how to catch the moment when the opensips transaction is going down? I
> need to react immediately.
>
> I can catch a BYE request when a established sip session is ending. What
> about other cases?
>
>
>
> On Fri, 19 Nov 2010 09:27:38 -0800
> Dave Singer <dave.singer at wideideas.com> wrote:
>
>> You can use a combination of the following dialog profiles (grouping
>> calls)
>> functions for this:
>> get_profile_size(profile,[value],size)<
>> http://www.opensips.org/html/docs/modules/1.6.x/dialog.html#id294302>
>>
>> Check
>> if a prifile is at limit.
>> set_dlg_profile(profile,[value])<
>> http://www.opensips.org/html/docs/modules/1.6.x/dialog.html#id294092>
>>
>> If
>> not at limit, increment the count for the profile (NOTE the value option
>> is
>> not actually supported yet)
>> unset_dlg_profile(profile,[value])<
>> http://www.opensips.org/html/docs/modules/1.6.x/dialog.html#id294162>
>>
>> If
>> need to remove from a profile like carrier failover
>> is_in_profile(profile,[value])<
>> http://www.opensips.org/html/docs/modules/1.6.x/dialog.html#id294231>
>>
>> Not
>> sure this would be needed but...
>>
>> When a call ends it will automatically be removed from any profiles it was
>> part of.
>>
>> On Fri, Nov 19, 2010 at 1:29 AM, Anton Zagorskiy <
>> a.zagorskiy at oyster-telecom.ru> wrote:
>>
>> Nobody uses limitation on amount of established sessions? I don't
>>> believe!
>>> =)
>>>
>>>
>>>
>>>
>>>
>>>
>>> WBR, Anton Zagorskiy
>>> VoIP Developer, Oyster Telecom
>>> Phone.: +7 812 601-0666
>>> Fax: +7 812 601-0593
>>> a.zagorskiy at oyster-telecom.ru
>>> www.oyster-telecom.ru
>>>
>>>
>>>
>>> > -----Original Message-----
>>> > From: users-bounces at lists.opensips.org [mailto:users-
>>> > bounces at lists.opensips.org] On Behalf Of Anton Zagorskiy
>>> > Sent: Thursday, November 18, 2010 4:58 PM
>>> > To: 'OpenSIPS users mailling list'
>>> > Subject: [OpenSIPS-Users] Handle end of a transaction/dialog
>>> >
>>> > Hello.
>>> >
>>> > I need to control how much SIP dialogs (established or pending) has
>>> > each
>>> > domain. If that value is equal to certain constant then I should drop
>>> > any
>>> > new INVITE from that domain.
>>> > There is no problem with catching initial requests, but with
>>> > terminating.
>>> > How can I control that an openSIPS transaction is in the terminating
>>> > stage?
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > WBR, Anton Zagorskiy
>>> > VoIP Developer, Oyster Telecom
>>> > Phone.: +7 812 601-0666
>>> > Fax: +7 812 601-0593
>>> > a.zagorskiy at oyster-telecom.ru
>>> > www.oyster-telecom.ru
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > _______________________________________________
>>> > Users mailing list
>>> > 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
>>>
>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20101122/6b72877a/attachment.htm>
More information about the Users
mailing list