<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix"><tt>Hi Kevin,<br>
        <br>
        I'm not sure about the logic of your query, but you can
        replicate that scripting (in perl) into the OpenSIPS script -
        see the avpops module for the raw DB lookups.<br>
        <br>
        Regards,<br>
        Bogdan<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>
      On 28.03.2014 10:56, Kevin Mathy wrote:<br>
    </div>
    <blockquote
cite="mid:CAOmzhXn73v8diztfCOB08RLpc5H-LQ1sKZHbnZvL9W+o1-c_zw@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi Bogdan,&nbsp;
        <div><br>
        </div>
        <div>Thanks for those informations, but I already know them :-)&nbsp;</div>
        <div>I've attached my script to this mail, so you can take a
          look at what I've done.</div>
        <div><br>
        </div>
        <div>Also, here is the part of the code calling the script :&nbsp;</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>
            &nbsp; &nbsp; t_on_reply("reply");<br>
            &nbsp; &nbsp; if (enum_query("asbc2.e164.local."))<br>
            &nbsp; &nbsp; {<br>
            &nbsp; &nbsp; &nbsp; &nbsp; xlog("L_INFO","$ci Sending INVITE to customer /
            ENUM\n");<br>
            &nbsp; &nbsp; &nbsp; &nbsp; if(!serialize_branches(1))<br>
            &nbsp; &nbsp; &nbsp; &nbsp; {<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xlog("L_ERR", "$ci SERIALIZE_BRANCHES
            Failed\n");<br>
            &nbsp; &nbsp; &nbsp; &nbsp; }<br>
            &nbsp; &nbsp; &nbsp; &nbsp; next_branches();<br>
            &nbsp; &nbsp; &nbsp; &nbsp; t_on_failure("failenum");<br>
            &nbsp; &nbsp; &nbsp; &nbsp; xlog("L_INFO", "$ci ENUM lookup returned
            &lt;$ru&gt;\n");<br>
            &nbsp; &nbsp; &nbsp; &nbsp; xlog("L_INFO", "$ci ENUM lookup returned rd :
            &lt;$rd&gt;\n");<br>
            <br>
            <b>&nbsp; &nbsp; &nbsp; &nbsp; $avp(ruriDomain)=$rd;<br>
              &nbsp; &nbsp; &nbsp; &nbsp; perl_exec("locationRuriUpdate");<br>
              &nbsp; &nbsp; &nbsp; &nbsp; if(is_avp_set("$avp(newRuriDomain)"))<br>
              &nbsp; &nbsp; &nbsp; &nbsp; {<br>
              &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #xlog("L_INFO","$ci New RURI Domain =
              $avp(newRuriDomain)\n");<br>
              &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #xlog("L_INFO","$ci New RURI Port =
              $avp(newRuriPort)\n");<br>
              &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rd = $avp(newRuriDomain) + ":" +
              $avp(newRuriPort);<br>
              &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xlog("L_INFO", "$ci We modified rd :
              &lt;$rd&gt;\n");<br>
              &nbsp; &nbsp; &nbsp; &nbsp; }<br>
            </b><br>
            &nbsp; &nbsp; &nbsp; &nbsp; uac_replace_from("sip:$fU@<b>XX.XX.XX.XX</b>");<br>
            &nbsp; &nbsp; &nbsp; &nbsp; uac_replace_to("$ru");<br>
            &nbsp; &nbsp; &nbsp; &nbsp; if (t_relay())<br>
            &nbsp; &nbsp; &nbsp; &nbsp; {<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xlog("L_INFO", "$ci t_relay done
            &lt;$ru&gt;\n");<br>
            &nbsp; &nbsp; &nbsp; &nbsp; }<br>
            &nbsp; &nbsp; &nbsp; &nbsp; else<br>
            &nbsp; &nbsp; &nbsp; &nbsp; {<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xlog("L_INFO", "$ci t_relay problem \n");<br>
            &nbsp; &nbsp; &nbsp; &nbsp; }<br>
            &nbsp; &nbsp; &nbsp; &nbsp; exit;<br>
            &nbsp; &nbsp; }<br>
            &nbsp; &nbsp; xlog("L_INFO","$ci ENUM not found\n");<br>
            &nbsp; &nbsp; sl_send_reply("404", "Not Found");<br>
            }</blockquote>
        </div>
        <div><br>
        </div>
        <div>Please note : I've intentionally hidden the IP's in both
          scripts. And the script may not be perfect, as it's only there
          to show you what I'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 "perl method" and simply use some methods of
          the registrar module, or any other ?&nbsp;</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,&nbsp;</div>
        <div><br>
        </div>
        <div class="gmail_extra"><br clear="all">
          <div><b>
              <div><span style="font-weight:normal">Bien cordialement,&nbsp;</span></div>
              <div><span style="font-weight:normal">Best Regards,&nbsp;</span></div>
              <div><span style="font-weight:normal"><br>
                </span></div>
            </b><b>Kevin MATHY</b> |<b>&nbsp;</b>Ing&eacute;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
                moz-do-not-send="true" 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 = "<a moz-do-not-send="true"
                      href="http://foo.com" target="_blank">foo.com</a>";&nbsp;
                    # see <a moz-do-not-send="true"
                      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;&nbsp; # see <a moz-do-not-send="true"
                      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 moz-do-not-send="true" 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'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've made it this afternoon, using a homemade
                        perl script (which I'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'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&nbsp;jeudi 27 mars 2014, Bogdan-Andrei Iancu &lt;<a
                          moz-do-not-send="true"
                          href="mailto:bogdan@opensips.org"
                          target="_blank">bogdan@opensips.org</a>&gt; a
                        &eacute;crit&nbsp;:<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 moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
                              On <a moz-do-not-send="true"
                                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,&nbsp;
                                <div><br>
                                </div>
                                <div>What I'm trying to do may be
                                  "strange" for some people, but here is
                                  the situation :</div>
                                <div>I'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'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'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 ?&nbsp;</div>
                                <div><br>
                                </div>
                                <div>I'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,&nbsp;</span></div>
                                      <div><span
                                          style="font-weight:normal">Best

                                          Regards,&nbsp;</span></div>
                                      <div><span
                                          style="font-weight:normal"><br>
                                        </span></div>
                                    </b><b>Kevin MATHY</b> |<b>&nbsp;</b>Ing&eacute;nieur
                                    VoIP<br>
                                    <div>
                                      <div><b><br>
                                        </b></div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                              <br>
                              <img moz-do-not-send="true"
src="http://www.hexanet.fr/sites/files/hexanet/files/20130205_signature_hexanet.gif"><br>
                              <fieldset></fieldset>
                              <br>
                              <pre>_______________________________________________
Users mailing list
<a moz-do-not-send="true">Users@lists.opensips.org</a>
<a moz-do-not-send="true" 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,&nbsp;</span></div>
                        <div><span style="font-weight:normal">Best
                            Regards,&nbsp;</span></div>
                        <div><span style="font-weight:normal"><br>
                          </span></div>
                      </b><b>Kevin MATHY</b> |<b>&nbsp;</b>Ing&eacute;nieur VoIP<br>
                      <div>
                        <div><b><br>
                          </b></div>
                      </div>
                      <br>
                      <br>
                    </div>
                  </div>
                  <img moz-do-not-send="true"
src="http://www.hexanet.fr/sites/files/hexanet/files/20130205_signature_hexanet.gif"></blockquote>
                <br>
              </div>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
      <br>
      <img moz-do-not-send="true"
src="http://www.hexanet.fr/sites/files/hexanet/files/20130205_signature_hexanet.gif"></blockquote>
    <br>
  </body>
</html>