<div dir="ltr"><div><div><div>Hi there,<br></div>I am trying to sanitize the opensips script by using a script 'dashboard' in the beginning of the script (using startup_route)<br><br>I face two problems here (opensips script errors)<br>problem 1: $var(uriqp) should be the uri-string in order to use that in t_relay() which is rejected<br></div>problem 2: completing IF statement where src_ip should be compared to transformed (to binary) ip address and source port is both rejected<br><br></div>Can somebody explain <br><ol><li>what the correct uri string for use in t_relay() would need to be ? (just entering t_relay("udp:<a href="http://10.130.2.4:5060">10.130.2.4:5060</a>") works fine)</li><li>what the correct way of transformation I need to use in order to have this IF statement accepted?</li></ol><p>thanks</p><p>Stefan Tobé<br></p><div><div><br><br><br>####### Routing Logic ########<br>startup_route {<br> ####### Local Parameters / Dashboard #########<br> $var(qpip)= "10.130.2.4";<br> $var(qpprt)= "5090";<br># $var(qpprt)= 5090;<br><br> <span style="color:rgb(255,0,0)"><b> $var(uriqp)= "udp:"+$var(qpip)+":"+$var(qpprt);<br></b></span><br><br>}<br><br><br>route{<br><br><b><span style="color:rgb(255,0,0)">if (src_ip == $(var(qpip){ip.pton}) && src_port == $var(qpprt)) { (=> won't accept </span><span style="color:rgb(255,0,0)">regardless whether $var(qpprt)= "5090" or $var(qpprt)= 5090)</span></b><br> # code here<br> route(sbc);<br>}<br></div><div>else ....<br></div><div>}<br><br>route[qp] {<br> <br> <span style="color:rgb(255,0,0)"><b> if (!t_relay($var(uriqp)) {</b></span><br> send_reply("500","Internal Error");<br> }<br> exit;<br>}<br clear="all"><div><div><br>-- <br><div class="gmail_signature">mvg<br>Stefan Tobé<br><br></div>
</div></div></div></div></div>