<div dir="ltr">Hi Bogdan, <div><br></div><div>Thanks for those informations, but I already know them :-) </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 : </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("reply");<br> if (enum_query("asbc2.e164.local."))<br> {<br> xlog("L_INFO","$ci Sending INVITE to customer / ENUM\n");<br> if(!serialize_branches(1))<br>
{<br> xlog("L_ERR", "$ci SERIALIZE_BRANCHES Failed\n");<br> }<br> next_branches();<br> t_on_failure("failenum");<br> xlog("L_INFO", "$ci ENUM lookup returned <$ru>\n");<br>
xlog("L_INFO", "$ci ENUM lookup returned rd : <$rd>\n");<br><br><b> $avp(ruriDomain)=$rd;<br> perl_exec("locationRuriUpdate");<br> if(is_avp_set("$avp(newRuriDomain)"))<br>
{<br> #xlog("L_INFO","$ci New RURI Domain = $avp(newRuriDomain)\n");<br> #xlog("L_INFO","$ci New RURI Port = $avp(newRuriPort)\n");<br> $rd = $avp(newRuriDomain) + ":" + $avp(newRuriPort);<br>
xlog("L_INFO", "$ci We modified rd : <$rd>\n");<br> }<br></b><br> uac_replace_from("sip:$fU@<b>XX.XX.XX.XX</b>");<br> uac_replace_to("$ru");<br>
if (t_relay())<br> {<br> xlog("L_INFO", "$ci t_relay done <$ru>\n");<br> }<br> else<br> {<br> xlog("L_INFO", "$ci t_relay problem \n");<br>
}<br> exit;<br> }<br> xlog("L_INFO","$ci ENUM not found\n");<br> 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 ? </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"><<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>></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 href="http://foo.com" target="_blank">foo.com</a>"; # 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'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 jeudi 27 mars 2014, Bogdan-Andrei Iancu <<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>>
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'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
? </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, </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">