[OpenSIPS-Users] LRN numbers

M.Khaled W Chehab kchehab at icucall.com
Mon May 13 12:14:59 CEST 2013


Hi,

 

I am trying to have a dipping function in my script ,this dipping function
is for  US numbers ,so i send the invite to the dipping company sip server
and check the 302 message reply back, to know if the number still the same
or been changed ,my problem is when i parse the 302 message and get the lrn
number the call do not re invited  (send) to the provider (I already set it
in my dial plan ,it just send a 503 message to the UA,how can i fix that

 

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

                route(7);

 

 

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;

                        }

}

 

failure_route[1] {

         if (!t_check_status("302")) {

        $avp(lrnct) = $(<reply>ct.fields(uri){param.value,rn});

        xlog("----------!---$avp(lrnct)------LRN\n");

                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;  

        }

        $avp(lrnct) = $(<reply>ct.fields(uri){param.value,rn});

        xlog("-------------$avp(lrnct)------LRN\n");

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

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

                       

                route(6);

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

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

                route(6);

        }else{ 

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

                       

                $avp(lrn_number) = $(<reply>ct.fields(uri){param.value,rn});

                  $rU=$avp(lrn_number);

                route(6);

                        t_relay();

        }

}

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


More information about the Users mailing list