<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello,</p>
<p>yesterday afternoon I pushed an alternative for allowing setting
the address and port in local Via headers using XAVP, see:</p>
<p> -
<a class="moz-txt-link-freetext" href="https://www.kamailio.org/wiki/cookbooks/devel/core#xavp_via_fields">https://www.kamailio.org/wiki/cookbooks/devel/core#xavp_via_fields</a></p>
<p>I didn't have the time to do any tests, but was in master before
freezing code for 5.2.x series, so it will be in the next major
release. Test and if there is any bug, report and it will be
fixed.</p>
<p>I also looked at extending the set_advertised_address(), but it
actually uses pointers to some static values available at kamailio
startup, so making that dynamic would have been more complex to do
in a short time.</p>
<p>Cheers,<br>
Daniel<br>
</p>
<br>
<div class="moz-cite-prefix">On 03.10.18 03:28, Patrick Wakano
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAPu3kNX4u-AeyU-nXUGTxnDLp-Y_SP6Cioucjc+3Z+o8dC0Ktw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<div dir="ltr">
<div dir="ltr">
<div>Thanks for the replies Daniel and Henning!</div>
<div>The problem with the listen address is that it can't be
set at run time per call, for example, after reading the
value from the DB.... And also it is way too dirty to use
the set_advertised_address with a static string value....<br>
</div>
<div>Long story short, we have a weird telco setup which only
allows the SIP trunk to terminate in their own network,
which then puts my Kamailio behind a NAT box only for them.
And because they are the biggest carrier in that country, we
will have to workaround the issue..... <br>
</div>
<div>Kamailio itself has only one network interface to
communicate with everyone (other provider and extensions),
so I was trying to actually only set the advertise address
before sending call to this specific telco. For calls to
anyone else I would not set the advertise address. Looks
simple, but seems not that easy to implement.....<br>
</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Patrick Wakano<br>
</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Tue, 2 Oct 2018 at 15:39, Daniel-Constantin
Mierla <<a href="mailto:miconda@gmail.com"
moz-do-not-send="true">miconda@gmail.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
the pseudo-variable is read only.<br>
<br>
The recommended way would be to use listen with advertise,
like:<br>
<br>
listen=udp:<a href="http://1.2.3.4:5060" rel="noreferrer"
target="_blank" moz-do-not-send="true">1.2.3.4:5060</a>
advertise <a href="http://5.6.7.8:5060" rel="noreferrer"
target="_blank" moz-do-not-send="true">5.6.7.8:5060</a><br>
<br>
That will take care of both Via and Record-Route headers as
well as<br>
matching myself, no need to do other stuff in route blocks.
Doesn't work<br>
for you?<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<br>
On 01.10.18 22:16, Henning Westerholt wrote:<br>
> Am Freitag, 28. September 2018, 07:16:18 CEST schrieb
Patrick Wakano:<br>
>> Sorry to annoy again, but I did find a couple of more
emails asking around<br>
>> about the possibility to pass a variable to the
set_advertised_address, but<br>
>> no one was replied....<br>
>> How is the status of these old core functions that
don't accept variables<br>
>> as parameters? Is it something being worked on?<br>
> Hi Patrick,<br>
><br>
> about the old core function - I think that indeed some of
them are still<br>
> missing PV support. Regarding your question, have you
already tried to use<br>
> this PV:<br>
><br>
> <a
href="https://www.kamailio.org/wiki/cookbooks/devel/pseudovariables#rai_-_received_advertised_ip_address"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://www.kamailio.org/wiki/cookbooks/devel/pseudovariables#rai_-_received_advertised_ip_address</a><br>
><br>
> Best regards,<br>
><br>
> Henning<br>
><br>
<br>
-- <br>
Daniel-Constantin Mierla -- <a href="http://www.asipto.com"
rel="noreferrer" target="_blank" moz-do-not-send="true">www.asipto.com</a><br>
<a href="http://www.twitter.com/miconda" rel="noreferrer"
target="_blank" moz-do-not-send="true">www.twitter.com/miconda</a>
-- <a href="http://www.linkedin.com/in/miconda"
rel="noreferrer" target="_blank" moz-do-not-send="true">www.linkedin.com/in/miconda</a><br>
Kamailio World Conference -- <a
href="http://www.kamailioworld.com" rel="noreferrer"
target="_blank" moz-do-not-send="true">www.kamailioworld.com</a><br>
Kamailio Advanced Training, Nov 12-14, 2018, in Berlin -- <a
href="http://www.asipto.com" rel="noreferrer"
target="_blank" moz-do-not-send="true">www.asipto.com</a><br>
<br>
<br>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank"
moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
<a
href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio World Conference -- <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a>
Kamailio Advanced Training, Nov 12-14, 2018, in Berlin -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a></pre>
</body>
</html>