[OpenSIPS-Users] Failure Route Issue

Gustavo Mistrinelli gmistrinelli at gmail.com
Fri Aug 8 21:46:17 CEST 2008


Check how are you handling ACK method on the main route
You need something like that:

    if (has_totag()) {
        # sequential request withing a dialog should
        # take the path determined by record-routing
        if (loose_route()) {
            if (is_method("BYE")) {
                setflag(1); # do accounting ...
                setflag(3); # ... even if the transaction fails
            }
            route(1);
        } else {
            if ( is_method("ACK") ) {
                if ( t_check_trans() ) {
                    # non loose-route, but stateful ACK; must be an ACK
after a 487 or e.g. 404 from upstream server
                    t_relay();
                    exit;
                } else {
                    # ACK without matching transaction ... ignore and
discard.\n");
                    exit;
                }
            }
            sl_send_reply("404","Not here");
        }
        exit;
    }

Cheers,

Gustavo Mistrinelli


On Fri, Aug 8, 2008 at 3:30 PM, Mouncif Benniane <mouncifbb at gmail.com>wrote:

> I get this in the log:
>
> Aug  8 04:18:42 206-225-83-32 /usr/local/sbin/openser[18461]:
> ERROR:tm:t_forward_nonack: no branch for forwarding
> Aug  8 04:18:42 206-225-83-32 /usr/local/sbin/openser[18461]:
> ERROR:tm:w_t_relay: t_forward_nonack failed
>
>
>
>
> On Fri, Aug 8, 2008 at 1:46 PM, Gustavo Mistrinelli <
> gmistrinelli at gmail.com> wrote:
>
>> Hi Mouncif,
>>
>> append_branch() is ok, but you must check first your entire configuration.
>> I'm seeing several avp without quotes.
>> Add xlog inside every if and every route to see what's happening, may be
>> wrong AVPs assignment or comparison.
>> First check if  ($avp(s:failure_set) == y ) is valid
>>
>> Cheers,
>>
>> Gustavo  Mistrinelli
>>
>>
>> On Fri, Aug 8, 2008 at 2:27 PM, Mouncif Benniane <mouncifbb at gmail.com>wrote:
>>
>>> I am using openser 1.3, I can't make the failure_route to work properly.
>>>
>>> here is my config:
>>>
>>> modparam("tm", "fr_timer", 2) # set fr_timer
>>>
>>>
>>> route{
>>>
>>> if (is_method("INVITE")) {
>>>
>>> avp_delete("*");
>>>
>>> if (avp_db_query("SELECT prefix,grp_id,priority,custid,
>>> did,ip,port,failure_set,failure_i
>>> p,failure_port FROM test_table WHERE
>>> prefix='$rU'","$avp(s:prefix);$avp(s:grp_id);$avp(s:priority);$avp(s:custid);$avp(s:did);$avp(s:ip);$avp(s:port
>>> );$avp(s:failure_set);$avp(s:failure_ip);$avp(s:failure_
>>> port)")) {
>>>
>>>
>>> $ru = "sip:"+$rU + "@" + $avp(s:ip) + ":" + $avp(s:port);
>>>
>>>
>>>
>>> if ($avp(s:failure_set) == y ) {
>>> $avp(i:3) = 3;
>>> t_on_failure("1");
>>> t_relay();
>>>
>>> }
>>>
>>>
>>> }
>>>
>>> } else {
>>>     xlog("L_NOTICE", "avp_db_query() returned no records or failed
>>> query\n");
>>>   };
>>>
>>> }
>>> ### END OF ROUTING
>>>
>>>
>>>
>>> failure_route[1] {
>>>
>>>    # status is 408 if openser session timer fires
>>>    if (t_check_status("408")) {
>>>
>>> $ru = "sip:"+$rU + "@" + $avp(s:failure_ip) + ":" + $avp(s:failure_port);
>>> append_branch();
>>> t_relay();
>>>
>>> }
>>>
>>> }
>>>
>>>
>>> route[1] {
>>>         # send it out now; use stateful forwarding as it works reliably
>>>         # even for UDP2TCP
>>>         if (!t_relay()) {
>>>                 sl_reply_error();
>>>         };
>>>         exit;
>>> }
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> So I set ip field to no responsive one and failure_ip to responsive one,
>>> but still the invite does not fail to the last one (failure_ip) after the
>>> timeout.
>>> Am I doing something wrong?
>>>
>>>
>>> cheers!!
>>>
>>> _______________________________________________
>>> 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/20080808/43a62952/attachment.htm 


More information about the Users mailing list