[OpenSIPS-Users] Logging into DB BYE messages with 481 Code

Wilmar Campos wilmar.campos at gmail.com
Wed Feb 5 18:50:05 CET 2014


Hi Bogdan,

I Include in the Sequential check:
    if (has_totag()  && is_method("INVITE|ACK|BYE|UPDATE"))
    {
        t_on_failure("1");

Then on:
failure_route[1]
{
xlog("L_ERROR", "$ci|log|FAILURE ROUTE: rU $rU | tu $tu | fu $fu | rd $rd |
Code $T_reply_code ");

I logged succesfully when 481.

Is this the right way?  Including the t_on_failure in the sequential check
in the script?

Thanks,


On Wed, Feb 5, 2014 at 12:31 PM, Bogdan-Andrei Iancu <bogdan at opensips.org>wrote:

>  Hello Wilmar,
>
> Are you sure you set the the failure route before routing the BYE request
> out ( via t_on_failure() -
> http://www.opensips.org/html/docs/modules/1.10.x/tm.html#id295064 ) ?
>
> BTW, what are you trying to achieve here ? simply accounting the BYE ?
>
> Regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>
> On 05.02.2014 16:43, Wilmar Campos wrote:
>
> Hi Bogdam,
>
>  Thanks for your feedback on this.
>
>  Let me explain a little better the scenario.
>
>  Customer->Opensips
> Opensips->Provider
>
>  After the INVITE, the call get connected ok.
> After a couple of seconds/minutes/hours, provider have an issue and
> equipment on provider side gets restarted.
> Customer notice call was now without audio, hangs UP.
> BYE is generated from customer to Opensips, Opensips rely the message to
> provider, provider responds with 481.
>
>   Opensips -> Provider SIP Request: BYE sip:14102248770 at Provider:5061
>  Provider -> Opensips SIP Status: 481 Call leg/transaction does not exist
>
>  I have a failure_route[1], but its never being called on this scenario.
>
>  Thanks for looking at this.
>
>  Wilmar
>
>
> On Wed, Feb 5, 2014 at 5:53 AM, Bogdan-Andrei Iancu <bogdan at opensips.org>wrote:
>
>>  Hello,
>>
>> The piece of script you posted is for handling the requests, so
>> logically, you cannot inspect the reply code (for BYE) when you are still
>> routing the BYE request - right :) ?
>>
>> So, in the script, when handling the BYE request, you need to arm a
>> failure_route (to catch the negative replies) and to check in that route
>> what is the reply code -> do the acc.
>>
>> Let me know if you have problems in scripting this.
>>
>> Regards,
>>
>> Bogdan-Andrei Iancu
>> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>>
>>  On 05.02.2014 06:36, Wilmar Campos wrote:
>>
>>  Hi All,
>>
>>  I am trying to log into the database all BYE messages that contains the
>> return code 481.
>>
>>  I have this piece of code:
>>      if (has_totag()  && is_method("INVITE|ACK|BYE|UPDATE"))
>>     {
>>         if(loose_route()) {
>>             if(!match_dialog())
>>                 exit;
>>
>>              if (is_method("BYE")) {
>>                 if(t_check_status("481"))
>>                         acc_db_request("481 No","acc_bye");
>>             }
>>
>>  But is giving me this error.
>> ERROR:tm:t_check_status: cannot check status for a reply which has no
>> transaction-state established
>>
>>  I have try different ways to accomplish this without any luck.
>>
>>  Can anyone please point me to the right direction?
>>
>>  Thanks,
>>
>>  Wilmar
>>
>>
>>  _______________________________________________
>> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20140205/bd47ecd1/attachment.htm>


More information about the Users mailing list