<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hi Stefan,<br>
      <br>
      Instead of <br>
          if (src_ip == $(var(qpip){ip.pton}) &amp;&amp; src_port ==
      $var(qpprt)) { <br>
      do<br>
          if ( $si== $var(qpip) &amp;&amp; $sp == $var(qpprt) ) {<br>
      <br>
      <br>
      For t_relay(), see:<br>
         
      <a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/2.1.x/tm.html#trelay-1">http://www.opensips.org/html/docs/modules/2.1.x/tm.html#trelay-1</a><br>
      but it does not accept variables.<br>
      To get a similar behavior, do :<br>
          $du = "sip:"+ </tt><tt><tt>$var(qpip) + ":" + </tt></tt><tt><tt><tt>$var(qpprt);<br>
              t_relay();<br>
          <br>
        </tt></tt>Regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 28.04.2016 15:50, Stefan Tobé wrote:<br>
    </div>
    <blockquote
cite="mid:CAA7e_wfAnifH+AOtZ3KbPo+JS5GzfEi1V4_kbPbp+tSiTTdc8g@mail.gmail.com"
      type="cite">
      <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
              moz-do-not-send="true" 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}) &amp;&amp; src_port ==
                $var(qpprt)) {       (=&gt; 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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>