[OpenSIPS-Users] opensips 2.1.2 not accepting transformation in if statement and t_relay()

Stefan Tobé stefan.tobe at gmail.com
Thu Apr 28 14:50:17 CEST 2016


Hi there,
I am trying to sanitize the opensips script by using a script 'dashboard'
in the beginning of the script (using  startup_route)

I face two problems here (opensips script errors)
problem 1: $var(uriqp) should be the uri-string in order to use that in
t_relay() which is rejected
problem 2: completing IF statement where src_ip should be compared to
transformed (to binary) ip address  and source port is both rejected

Can somebody explain

   1. what the correct uri string for use in t_relay() would need to be ?
   (just entering t_relay("udp:10.130.2.4:5060") works fine)
   2. what the correct way of transformation I need to use in order to have
   this IF statement accepted?

thanks

Stefan Tobé



####### Routing Logic ########
startup_route {
    ####### Local Parameters / Dashboard #########
        $var(qpip)=   "10.130.2.4";
        $var(qpprt)=  "5090";
#         $var(qpprt)=  5090;


* $var(uriqp)=  "udp:"+$var(qpip)+":"+$var(qpprt);*

}


route{

*if (src_ip == $(var(qpip){ip.pton}) && src_port == $var(qpprt)) {
(=> won't accept regardless whether $var(qpprt)=  "5090" or $var(qpprt)=
5090)*
    # code here
    route(sbc);
}
else ....
}

route[qp] {

   * if (!t_relay($var(uriqp)) {*
        send_reply("500","Internal Error");
    }
    exit;
}

-- 
mvg
Stefan Tobé
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20160428/9ce1a6be/attachment.htm>


More information about the Users mailing list