<div dir="ltr">Hi Bogdan, <div><br></div><div>Thanks for those informations, but I already know them :-) </div><div>I&#39;ve attached my script to this mail, so you can take a look at what I&#39;ve done.</div><div><br></div>

<div>Also, here is the part of the code calling the script : </div><div><br></div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

route[enum] {<br>    t_on_reply(&quot;reply&quot;);<br>    if (enum_query(&quot;asbc2.e164.local.&quot;))<br>    {<br>        xlog(&quot;L_INFO&quot;,&quot;$ci Sending INVITE to customer / ENUM\n&quot;);<br>        if(!serialize_branches(1))<br>

        {<br>            xlog(&quot;L_ERR&quot;, &quot;$ci SERIALIZE_BRANCHES Failed\n&quot;);<br>        }<br>        next_branches();<br>        t_on_failure(&quot;failenum&quot;);<br>        xlog(&quot;L_INFO&quot;, &quot;$ci ENUM lookup returned &lt;$ru&gt;\n&quot;);<br>

        xlog(&quot;L_INFO&quot;, &quot;$ci ENUM lookup returned rd : &lt;$rd&gt;\n&quot;);<br><br><b>        $avp(ruriDomain)=$rd;<br>        perl_exec(&quot;locationRuriUpdate&quot;);<br>        if(is_avp_set(&quot;$avp(newRuriDomain)&quot;))<br>

        {<br>            #xlog(&quot;L_INFO&quot;,&quot;$ci New RURI Domain = $avp(newRuriDomain)\n&quot;);<br>            #xlog(&quot;L_INFO&quot;,&quot;$ci New RURI Port = $avp(newRuriPort)\n&quot;);<br>            $rd = $avp(newRuriDomain) + &quot;:&quot; + $avp(newRuriPort);<br>

            xlog(&quot;L_INFO&quot;, &quot;$ci We modified rd : &lt;$rd&gt;\n&quot;);<br>        }<br></b><br>        uac_replace_from(&quot;sip:$fU@<b>XX.XX.XX.XX</b>&quot;);<br>        uac_replace_to(&quot;$ru&quot;);<br>

        if (t_relay())<br>        {<br>            xlog(&quot;L_INFO&quot;, &quot;$ci t_relay done &lt;$ru&gt;\n&quot;);<br>        }<br>        else<br>        {<br>            xlog(&quot;L_INFO&quot;, &quot;$ci t_relay problem \n&quot;);<br>

        }<br>        exit;<br>    }<br>    xlog(&quot;L_INFO&quot;,&quot;$ci ENUM not found\n&quot;);<br>    sl_send_reply(&quot;404&quot;, &quot;Not Found&quot;);<br>}</blockquote></div><div><br></div><div>Please note : I&#39;ve intentionally hidden the IP&#39;s in both scripts. And the script may not be perfect, as it&#39;s only there to show you what I&#39;d like to do :-)</div>

<div><br></div><div><br></div><div>So, this configuration is working well, but is there a way to not use the &quot;perl method&quot; and simply use some methods of the registrar module, or any other ? </div><div><br></div>

<div>If you need further informations to understand what I want to do, feel free to ask me ;-)</div><div><br></div><div>Thanks a lot, </div><div><br></div><div class="gmail_extra"><br clear="all"><div><b><div><span style="font-weight:normal">Bien cordialement, </span></div>

<div><span style="font-weight:normal">Best Regards, </span></div><div><span style="font-weight:normal"><br></span></div></b><b>Kevin MATHY</b> |<b> </b>Ingénieur VoIP<br><div><div><b><br></b></div></div></div>
<br><br><div class="gmail_quote">2014-03-28 9:37 GMT+01:00 Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div><tt>Hello Kevin,<br>
        <br>
        Simply do in your script (after the ENUM lookup):<br>
        <br>
        $rd = &quot;<a href="http://foo.com" target="_blank">foo.com</a>&quot;;  # see
        <a href="http://www.opensips.org/Documentation/Script-CoreVar-1-10#toc65" target="_blank">http://www.opensips.org/Documentation/Script-CoreVar-1-10#toc65</a><br>
        $rp = 1234;  # see
        <a href="http://www.opensips.org/Documentation/Script-CoreVar-1-10#toc70" target="_blank">http://www.opensips.org/Documentation/Script-CoreVar-1-10#toc70</a><br>
        <br>
        Regards,<br>
      </tt><div class="">
      <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre></div><div><div class="h5">
      On 28.03.2014 00:28, Kevin Mathy wrote:<br>
    </div></div></div>
    <blockquote type="cite"><div><div class="h5">Hi Bogdan,
      <div><br>
      </div>
      <div>I&#39;d like to modify only the hostname (and port) part of the
        RURI, to put inside informations taken from the location table.</div>
      <div><br>
      </div>
      <div>I&#39;ve made it this afternoon, using a homemade perl script
        (which I&#39;ll be able to share tomorrow if needed)<span></span>,
        and it works well, but for the process to be perfect, I prefer
        if I can avoid the perl method, and only use Opensips&#39;s
        integrated methods ;-)</div>
      <div><br>
      </div>
      <div>Thanks,</div>
      <div><br>
      </div>
      <div>Best regards,</div>
      <div><br>
      </div>
      <div>Kevin</div>
      <div><br>
      </div>
      <div><br>
        Le jeudi 27 mars 2014, Bogdan-Andrei Iancu &lt;<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>&gt;
        a écrit :<br>
        <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div bgcolor="#FFFFFF" text="#000000">
            <div><tt>Hi Kevin,<br>
                <br>
                Nothing is normal here, everything is strange, so.....
                :)<br>
                <br>
                You can modify any parts of the RURI, no problem - what
                exactly part of it you want to change ? <br>
                <br>
                Regards,<br>
              </tt>
              <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
              On <a href="tel:27.03.2014%2012" value="+12703201412" target="_blank">27.03.2014 12</a>:31, Kevin Mathy wrote:<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">Hi List, 
                <div><br>
                </div>
                <div>What I&#39;m trying to do may be &quot;strange&quot; for some
                  people, but here is the situation :</div>
                <div>I&#39;ve got an OpenSIPS server, which do some ENUM
                  requests to route Incoming calls (from me, the
                  provider, to the customers).</div>
                <div>It works well when my customer&#39;s endpoints are
                  configured with a public IP, without any NAT.</div>
                <div><br>
                </div>
                <div>But, when those endpoints connect to my server
                  through a NAT router, I face a problem for incoming
                  calls, as the port used by endpoint isn&#39;t the same as
                  the classical 5060.</div>
                <div><br>
                </div>
                <div>So, my question is : is there a way to simply
                  modify the Request-URI obtained after an ENUM query,
                  with the informations inserted in the location table
                  ? </div>
                <div><br>
                </div>
                <div>I&#39;ve got an idea on how to make it with a perl
                  script, but I prefer to not use this method, and to
                  use only existant modules of methods.</div>
                <div><br>
                </div>
                <div>Thanks for your ideas</div>
                <div><br>
                </div>
                <div>Kevin</div>
                <div><br>
                </div>
                <div><br clear="all">
                  <div><b>
                      <div><span style="font-weight:normal">Bien
                          cordialement, </span></div>
                      <div><span style="font-weight:normal">Best
                          Regards, </span></div>
                      <div><span style="font-weight:normal"><br>
                        </span></div>
                    </b><b>Kevin MATHY</b> |<b> </b>Ingénieur VoIP<br>
                    <div>
                      <div><b><br>
                        </b></div>
                    </div>
                  </div>
                </div>
              </div>
              <br>
              <img src="http://www.hexanet.fr/sites/files/hexanet/files/20130205_signature_hexanet.gif"><br>
              <fieldset></fieldset>
              <br>
              <pre>_______________________________________________
Users mailing list
<a>Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
            </blockquote>
            <br>
          </div>
        </blockquote>
      </div>
      <br>
      <br>
      -- <br>
      <b>
        <div><span style="font-weight:normal">Bien cordialement, </span></div>
        <div><span style="font-weight:normal">Best Regards, </span></div>
        <div><span style="font-weight:normal"><br>
          </span></div>
      </b><b>Kevin MATHY</b> |<b> </b>Ingénieur VoIP<br>
      <div>
        <div><b><br>
          </b></div>
      </div>
      <br>
      <br>
      </div></div><img src="http://www.hexanet.fr/sites/files/hexanet/files/20130205_signature_hexanet.gif"></blockquote>
    <br>
  </div>

</blockquote></div><br></div></div>

<br>
<img src="http://www.hexanet.fr/sites/files/hexanet/files/20130205_signature_hexanet.gif">