[OpenSIPS-Users] LRN numbers

M.Khaled W Chehab kchehab at icucall.com
Mon May 13 15:28:20 CEST 2013


Hi again,

 

I fix it using the below code but still there is a mistake since I can find
the below error, please can you check if I am coding in correct way

 

CRITICAL:tm:w_t_reply: unsupported route_type (8)

ERROR:signaling:sig_send_reply_mod: failed to send reply with tm module

 

 

if ($rU=~"^.") {

                route(7);

                route(1);

                exit;

route[1] {

        if (subst_uri('/(sip:.*);nat=yes/\1/')) {

                setbflag(6);

        }

        if (isflagset(5)) {

               search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');

        }

 

        # for INVITEs enable some additional helper routes

        if (is_method("INVITE")) {

 

                t_on_branch("2");

                t_on_reply("2");

                t_on_failure("1");

                avp_db_query("UPDATE `opensips`.`invites` set `trunkip`
='$rd' where  `CALLID` = '$ci' ");

        } else if (is_method("BYE")) {

                setflag(1); # do accounting ...

                setflag(3); #transaction falis

                setflag(4); #CDR Table

                xlog("----------------------------------------Route 1
Bye---------------");

                       

        } else if (is_method("ACK")) {

                # call answered an ACKed, start billing here

        } else if (is_method("CANCEL")) {

                # call cancelled by caller, do clean up here' ");

        }

        if (!t_relay()) {

                xlog("L_INFO", "--Debug Customer
ID:$avp(Cusid)/IP:$si------#11###Reply: $T_reply_code\n");

                send_reply("500","Internal Error");

        };

        exit;

}

 

 

 

route[7]{

if (!do_routing("$avp(Cusid)","FW")) {

                        send_reply("404","No PSTN Route found");

                        exit;

                }

}

 

route[6] {

if ( use_next_gw() ) {

                                $var(prefix) =
$(avp(gw_attrs){csv.value,1});

                                $rU = $var(prefix) + $avp(dst);

                                xlog("L_INFO", "--Debug Customer
ID:$avp(Cusid)/IP:$si-----Calling number to Next Provier $rU\n");

                                setflag(26); #Missed calls

                                t_on_failure("1");

                                t_relay();

                                exit;

                        }

}

 

branch_route[2] {

        xlog("L_INFO", "--Debug Customer ID:$avp(Cusid)/IP:$si-----new
branch at $ru\n");

                route(7);

}

 

failure_route[1] {

 

 

         if (!t_check_status("302")) {

                if (!next_routing()){

                        xlog("L_INFO", "LRN - Unable to DIP");

                        t_reply("500","Unable to DIP");

                        exit;

                }

                xlog("L_INFO", "LRN - Unable to DIP - Trying Next");

                t_on_failure("1");

                t_relay();

                exit;  

        }

        if (!$(<reply>ct.fields(uri){param.value,rn})){

                xlog("L_INFO", "LRN - No redirect information found");

                        route(1);

        }else if ($(<reply>ct.fields(uri){param.value,rn}) == $tU){

                xlog("L_INFO", "LRN - Returned same number, no need to
redirect");

             route(1);

        }else{ 

                        xlog("LRN-----$rU-------Else lRN
$avp(lrnct)---------");

                        $rU=$avp(lrnct);

                       

                        xlog("LRN-----$rU-------Else lRN
$avp(lrnct)---------");

                 route(1);

                               

        }

 

        if (t_was_cancelled()) {

                xlog("L_INFO", "--Debug Customer
ID:$avp(Cusid)/IP:$si-----Call Canceled--SIP Reason:$T_reply_code\n");

                xlog("L_INFO", "##########==========End of invite for
Customer ID:$avp(Cusid)/IP:$si--Over
$rd====on_route_failure_1======##########3 \n");

                avp_db_query("delete   FROM `invites` WHERE `CALLID`
='$ci'");

 

                exit;

        }

 

 

 

        if (t_check_status("481") ) {

                acc_db_request("200 Dialog Timeout", "acc");

                xlog("-----Reply:
$T_reply_code#----------481-422-487--#####$rm from $si
(callid=$ci)######################################");

        }

        # If fr_timer expires t_check_status("408") is true, although $rs is
<null>

        if (t_check_status("(408)|(5[0-9][0-9])")) {

                #xlog("L_INFO", "--Debug Customer
ID:$avp(Cusid)/IP:$rd-----Delete Invite #####$rd Reply:
$T_reply_code#######14\n");

                xlog( "L_NOTICE", "[$Tf] FR: $ci -- TIMEOUT for Gateway $rd
(marking as bad)\n" );

        }

        if( t_check_status("[4-6][0-9][0-9]")){

                xlog("L_INFO", "--Debug Customer
ID:$avp(Cusid)/IP:$rd-----$si Reply: $T_reply_code#######13\n");

                xlog("L_INFO", "##########==========End of invite
ID:$avp(Cusid)/IP:$rd###############\n");

                #xlog( "L_NOTICE", "[$Tf] FR: $ci ------$rd----------Delete
2--------------\n" );

                avp_db_query("delete   FROM `invites` WHERE `CALLID`
='$ci'");

               

                if (!t_check_status("487")) {

                        #$avp(failure_count) = $avp(failure_count) + 1;
480|486|603

                        route(6);

                }

        }

 

}

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20130513/984ee907/attachment-0001.htm>


More information about the Users mailing list