[SR-Users] set_advertised_address with variable

Patrick Wakano pwakano at gmail.com
Mon Oct 8 13:32:04 CEST 2018


Hi Daniel!
Thanks for the effort! Really appreciate it!
I am not using the 5.2 version yet, so it I won't be able to test it right
away...

Best regards,
Patrick Wakano

On Fri, 5 Oct 2018 at 18:37, Daniel-Constantin Mierla <miconda at gmail.com>
wrote:

> Hello,
>
> yesterday afternoon I pushed an alternative for allowing setting the
> address and port in local Via headers using XAVP, see:
>
>   - https://www.kamailio.org/wiki/cookbooks/devel/core#xavp_via_fields
>
> 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.
>
> 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.
>
> Cheers,
> Daniel
>
> On 03.10.18 03:28, Patrick Wakano wrote:
>
> Thanks for the replies Daniel and Henning!
> 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....
> 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.....
> 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.....
>
> Cheers,
> Patrick Wakano
>
> On Tue, 2 Oct 2018 at 15:39, Daniel-Constantin Mierla <miconda at gmail.com>
> wrote:
>
>> Hello,
>>
>> the pseudo-variable is read only.
>>
>> The recommended way would be to use listen with advertise, like:
>>
>> listen=udp:1.2.3.4:5060 advertise 5.6.7.8:5060
>>
>> That will take care of both Via and Record-Route headers as well as
>> matching myself, no need to do other stuff in route blocks. Doesn't work
>> for you?
>>
>> Cheers,
>> Daniel
>>
>>
>> On 01.10.18 22:16, Henning Westerholt wrote:
>> > Am Freitag, 28. September 2018, 07:16:18 CEST schrieb Patrick Wakano:
>> >> Sorry to annoy again, but I did find a couple of more emails asking
>> around
>> >> about the possibility to pass a variable to the
>> set_advertised_address, but
>> >> no one was replied....
>> >> How is the status of these old core functions that don't accept
>> variables
>> >> as parameters? Is it something being worked on?
>> > Hi Patrick,
>> >
>> > about the old core function - I think that indeed some of them are still
>> > missing PV support. Regarding your question, have you already tried to
>> use
>> > this PV:
>> >
>> >
>> https://www.kamailio.org/wiki/cookbooks/devel/pseudovariables#rai_-_received_advertised_ip_address
>> >
>> > Best regards,
>> >
>> > Henning
>> >
>>
>> --
>> Daniel-Constantin Mierla -- www.asipto.com
>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>> Kamailio World Conference -- www.kamailioworld.com
>> Kamailio Advanced Training, Nov 12-14, 2018, in Berlin -- www.asipto.com
>>
>>
>> _______________________________________________
>> Kamailio (SER) - Users Mailing List
>> sr-users at lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>
> --
> Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio World Conference -- www.kamailioworld.com
> Kamailio Advanced Training, Nov 12-14, 2018, in Berlin -- www.asipto.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20181008/c797a9dd/attachment.html>


More information about the sr-users mailing list