[OpenSIPS-Users] Avpops failure route

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Dec 1 22:48:53 CET 2009


Hi Indiver,

hard to evaluate the behaviour based only on the pieces of script you 
posted. What is important to check is:

1) you arm the failure route when processing the initial INVITE - place 
an xlog just before the t_on_failure() to be sure it is done.

2) place another xlog just in the beginning of the failure route to see 
if it is triggered for your call.

Regards,
Bogdan

Indiver wrote:
> hi bodgan,
>
> Thanks for your reply. I made some changes and call is now going to
> destination. But when no answer or busy it is not going to failure route.
> here are the changes i did.
>
>
>         #unconditional call forward
>        if(avp_db_load("$ruri/username","$avp(s:callfwd)")) 
>        {
>             avp_pushto("$ruri", "$avp(s:callfwd)");
>             avp_print(); 
>             route(4);
>             exit;
>
>         }
>
>        #fwd on busy
>
> if (avp_db_load("$ruri/username", "$avp(s:fwdbusy)")) { 
>     if (!avp_check("$avp(s:fwdbusy)", "eq/$ruri/i")) { 
>       setflag(26);
>     };
>   };
>
> fwd on noanswer
>
>   if (avp_db_load("$ruri/username", "$avp(s:fwdnoanswer)")) { 
>     if (!avp_check("$avp(s:fwdnoanswer)", "eq/$ruri/i")) { 
>       setflag(27);
>     };
>   };
> t_on_failure("3");
>
> #########Failure Route#########
>
> failure_route[3]
> {
>
>  if (isflagset(26) && t_check_status("486")) { 
>     if (avp_pushto("$ruri","$avp(s:fwdbusy)")) {
>       avp_delete("$avp(s:fwdbusy)");
>       resetflag(26);
>       route(4);
>       exit;
>     };
>   };
>
>   if (isflagset(27) && t_check_status("408") && t_check_status("487")) { 
>     if (avp_pushto("$ruri", "$avp(s:fwdnoanswer)")) { 
>       avp_delete("$avp(s:fwdnoanswer)");
>       resetflag(27);
>       route(4); 
>       exit;
>     };
>   };
>
> It does not going to failure route and just hanging up!
>
>
>
> Bogdan-Andrei Iancu wrote:
>   
>> Hi Indiver,
>>
>> The error message may come because you message is spiralling 3 times  
>> (according to the redirect rules) on your opensips and each time the 
>> INVITE request is getting larger (due extra VIA and RR headers for each 
>> hop). Do you check in your script for message len and send the 513? or 
>> who is responsible for generating it?
>>
>> A second issue is, looking at the logs you posted, that it seams there 
>> is a  double reply in your script. See:
>>         Nov 26 20:29:16 [25335] ERROR:tm:_reply_light: failed to 
>> generate 200 reply when a final 200 was sent out
>>
>>
>> Can you post the entire log (for the INVITE part) ?
>>
>> Regards,
>> Bogdan
>>
>>
>> Indiver wrote:
>>     
>>> Hai Every one,
>>>
>>> I'm trying to implement callfwd,fwdnoanswer,fwdonbusy features. According
>>> to
>>> that i tried some scripts and callfwd is working fine. The problem is
>>> when i
>>> implement's fwdnoanswer,fwdonbusy i'm getting 513 message too big error.
>>> My
>>> changes in cfg file as follows
>>>
>>>  if(avp_db_load("$ruri/username","$avp(s:callfwd)"))
>>>        {
>>>             avp_pushto("$ruri", "$avp(s:callfwd)");
>>>             avp_print();
>>>             route(4);
>>>             exit;
>>>
>>>         }
>>>        if (avp_db_load("$ru/username", "$avp(s:fwdnoanswer)"))  
>>>        {
>>>           if (!avp_check("$avp(s:fwdnoanswer)", "eq/$ru/i")) 
>>>          {
>>>           setflag(27);
>>>           #avp_pushto("$ru", "$avp(s:fwdnoanswer)");
>>>           avp_print();
>>>           route(4);
>>>           exit;
>>>         };
>>>
>>>       };
>>>
>>> My usr_preferences db data is as follows:
>>>
>>> +----+------+----------+----------------+-------------+------+-------------------------+---------------------+
>>> | id | uuid | username | domain         | attribute   | type | value                  
>>> | last_modified       |
>>> +----+------+----------+----------------+-------------+------+-------------------------+---------------------+
>>> | 16 |      | 1001     | 192.168.1.55 | fwdnoanswer |    0 |
>>> sip:1002 at 192.168.1.55| 1900-01-01 00:00:01 | 
>>> | 15 |      | 1002     | 192.168.1.55 | fwdnoanswer |    0 |
>>> sip:1000 at 192.168.1.55 | 1900-01-01 00:00:01 | 
>>>  17           1000      192.168.1.55   callfwd              0    
>>> sip:1003 at 192.168.1.55
>>>
>>> And here i'm pasting my error log:
>>>
>>>
>>> Nov 26 20:29:16 [25335] DBG:db_mysql:db_mysql_str2val: converting STRING
>>> [fwdnoanswer]
>>> Nov 26 20:29:16 [25335] DBG:db_mysql:db_mysql_str2val: converting INT [0]
>>> Nov 26 20:29:16 [25335] DBG:avpops:dbrow2avp: db_flags=3, flags=12
>>> Nov 26 20:29:16 [25335] DBG:avpops:db_close_query: close avp query
>>> Nov 26 20:29:16 [25335] DBG:core:db_free_columns: freeing result columns
>>> at
>>> 0x8189910
>>> Nov 26 20:29:16 [25335] DBG:core:db_free_rows: freeing 1 rows
>>> Nov 26 20:29:16 [25335] DBG:core:db_free_row: freeing row values at
>>> 0x81a1090
>>> Nov 26 20:29:16 [25335] DBG:core:db_free_rows: freeing rows at 0x81a1088
>>> Nov 26 20:29:16 [25335] DBG:core:db_free_result: freeing result set at
>>> 0x81a06f8
>>> Nov 26 20:29:16 [25335] DBG:core:db_free_result: SYNC-DBG - freeing
>>> result!
>>> Nov 26 20:29:16 [25335] DBG:avpops:ops_dbload_avps: loaded avps = 1
>>> Nov 26 20:29:16 [25335] DBG:avpops:ops_check_avp: check
>>> <sip:1000 at 192.168.1.55> against <sip:1002 at 192.168.1.55> as str /33554433
>>> Nov 26 20:29:16 [25335] DBG:avpops:ops_check_avp: no match
>>> Nov 26 20:29:16 [25335] INFO:avpops:ops_print_avp: p=0xf5acd690,
>>> flags=0x0083
>>> Nov 26 20:29:16 [25335] INFO:avpops:ops_print_avp: 			name=<fwdnoanswer>
>>> Nov 26 20:29:16 [25335] INFO:avpops:ops_print_avp: 		
>>> val_str=<sip:1000 at 192.168.1.55 / 23>
>>> Nov 26 20:29:16 [25335] DBG:core:db_do_query: SYNC-DBG - SELECT
>>> successfully
>>> executed!
>>> Nov 26 20:29:16 [25335] DBG:core:db_new_result: allocate 28 bytes for
>>> result
>>> set at 0x81a06f8
>>> Nov 26 20:29:16 [25335] DBG:db_mysql:db_mysql_get_columns: 1 columns
>>> returned from the query
>>> Nov 26 20:29:16 [25335] DBG:core:db_allocate_columns: allocate 16 bytes
>>> for
>>> result columns at 0x81a0458
>>> Nov 26 20:29:16 [25335] DBG:db_mysql:db_mysql_get_columns:
>>> RES_NAMES(0x81a045c)[0]=[groupid]
>>> Nov 26 20:29:16 [25335] DBG:db_mysql:db_mysql_get_columns: use DB_INT
>>> result
>>> type
>>> Nov 26 20:29:16 [25335] DBG:core:db_allocate_rows: allocate 28 bytes for
>>> result rows and values at 0x8189808
>>> Nov 26 20:29:16 [25335] DBG:db_mysql:db_mysql_str2val: converting INT [0]
>>> Nov 26 20:29:16 [25335] DBG:core:db_free_columns: freeing result columns
>>> at
>>> 0x81a0458
>>> Nov 26 20:29:16 [25335] DBG:core:db_free_rows: freeing 1 rows
>>> Nov 26 20:29:16 [25335] DBG:core:db_free_row: freeing row values at
>>> 0x8189810
>>> Nov 26 20:29:16 [25335] DBG:core:db_free_rows: freeing rows at 0x8189808
>>> Nov 26 20:29:16 [25335] DBG:core:db_free_result: freeing result set at
>>> 0x81a06f8
>>> Nov 26 20:29:16 [25335] DBG:core:db_free_result: SYNC-DBG - freeing
>>> result!
>>> Nov 26 20:29:16 [25335] DBG:drouting:do_routing: using dr group 0
>>> Nov 26 20:29:16 [25335] DBG:drouting:internal_check_rt: found rgid 0
>>> (rule
>>> list 0xf5ab6d90)
>>> Nov 26 20:29:16 [25335] DBG:drouting:do_routing: setting attr [] as for
>>> ruri
>>> Nov 26 20:29:16 [25335] DBG:drouting:do_routing: setting the gw [0] as
>>> ruri
>>> "sip:1002 at 192.168.1.55"
>>> Nov 26 20:29:16 [25335] DBG:core:parse_headers: flags=ffffffffffffffff
>>> Nov 26 20:29:16 [25335] DBG:core:check_via_address: params 192.168.1.55,
>>> 192.168.1.55, 0
>>> Nov 26 20:29:16 [25335] ERROR:tm:_reply_light: failed to generate 200
>>> reply
>>> when a final 200 was sent out
>>>
>>>   
>>>       
>> -- 
>> Bogdan-Andrei Iancu
>> www.voice-system.ro
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>>     
>
>   


-- 
Bogdan-Andrei Iancu
www.voice-system.ro




More information about the Users mailing list