Re: [SR-Users] set_advertised_address not accepting vars

2020-03-22 Thread Patrick Wakano
There is an open ticket for that: https://github.com/kamailio/kamailio/issues/2137 On Mon, 23 Mar 2020 at 03:20, Sergiu Pojoga wrote: > Thanks Daniel, I'll give it a try using xavps instead. > > Regards, > --Sergiu > > On Sun, Mar 22, 2020 at 9:52 AM Daniel-Constantin Mierla < > mico...@gmail.c

Re: [SR-Users] set_advertised_address not accepting vars

2020-03-22 Thread Sergiu Pojoga
Thanks Daniel, I'll give it a try using xavps instead. Regards, --Sergiu On Sun, Mar 22, 2020 at 9:52 AM Daniel-Constantin Mierla wrote: > Hello, > > there is an alternative where you can use a combination of xavps and corex > module function via_use_xavp_fields() -- see: > > * https://www.ka

Re: [SR-Users] set_advertised_address not accepting vars

2020-03-22 Thread Daniel-Constantin Mierla
Hello, there is an alternative where you can use a combination of xavps and corex module function via_use_xavp_fields() -- see:   * https://www.kamailio.org/wiki/cookbooks/5.3.x/core#xavp_via_fields I think I looked at some point at set_advertised_address() from core to make it accept variables

[SR-Users] set_advertised_address not accepting vars

2020-03-22 Thread Sergiu Pojoga
Hi there, The function doesn't appear to accept vars. For example, set_advertised_address("$var(someaddress)") results in a VIA of string $var(someaddress), instead of var's value. https://www.kamailio.org/wiki/cookbooks/5.3.x/core#set_advertised_address kamailio 5.3.2 (x86_64/linux) 0bed10 Ch

Re: [SR-Users] set_advertised_address

2018-12-05 Thread Daniel-Constantin Mierla
When a phone registers, its traffic comes to one of the two sockets. When that phone is called, after lookup location, the socket associated to the registration of the target user is selected. So you do not need to do anything special for calling between phones. When calling to a PSTN/foreign prov

Re: [SR-Users] set_advertised_address

2018-12-05 Thread Kjeld Flarup
So I could do something like this: listen=192.168.2.9:5070 advertise 20.30.40.50:5070 listen=192.168.2.9:5050 However when I do an invite to 192.168.2.32, would Kamailio choose 5050 or 5070? Same when inviting to 40.40.40.40 If I were to listen to another local IP, then the routing table in L

Re: [SR-Users] set_advertised_address

2018-12-05 Thread Sergiu Pojoga
For whatever reason my initial impression was if it was possible for external devices to connect without port forwarding... I stand corrected. On Wed, Dec 5, 2018 at 11:30 AM Daniel-Constantin Mierla wrote: > It is not about an external network interface, but external > traffic/devices. The NA

Re: [SR-Users] set_advertised_address

2018-12-05 Thread Daniel-Constantin Mierla
It is not about an external network interface, but external traffic/devices. The NAT in this case is a port forwarding firewall, like Amazon or Google cloud, where you have a local address on server and the firewall is forwarding by port all traffic from an assigned public address. Such scenario i

Re: [SR-Users] set_advertised_address

2018-12-05 Thread Sergiu Pojoga
Slightly confused here... didn't he say that Kamailio and PBX are behind NAT? If so, what external interface are we talking about? On Wed, Dec 5, 2018 at 9:18 AM Daniel-Constantin Mierla wrote: > Hello, > > you do not need a second kamailio, the same instance can listen on > multiple sockets. Yo

Re: [SR-Users] set_advertised_address

2018-12-05 Thread Daniel-Constantin Mierla
Hello, you do not need a second kamailio, the same instance can listen on multiple sockets. You can also use a single ip, just listen on one port for traffic from local network and on another port for external traffic (this socket with advertise address). If the router cannot handle dns query bas

Re: [SR-Users] set_advertised_address

2018-12-05 Thread Kjeld Flarup
That might work, provided that the router can handle a local DNS. It would, however still require adding an extra Kamailio instance with another IP. Plus a branch of the invite to both local and public instance. Plus an extra location table. Med Liberalistiske Hilsner ---

Re: [SR-Users] set_advertised_address

2018-12-05 Thread Daniel Tryba
On Wed, Dec 05, 2018 at 09:40:38AM +0100, Kjeld Flarup wrote: > Yes, the Phones may be on either local LAN (Wifi) and Internet via mobile > data. How about use different local address, 1 with an advertise for external clients, 1 without. Have local DNS resolv to the 1 ip without advertise. __

Re: [SR-Users] set_advertised_address

2018-12-05 Thread Kjeld Flarup
Hi Daniel Yes, the Phones may be on either local LAN (Wifi) and Internet via mobile data. Med Liberalistiske Hilsner -- Civilingeniør, Kjeld Flarup - Mit sind er mere åbent end min tegnebog Sofienlundvej 6B, 7560 Hjerm, Tlf: 40 29 41 49 Den ikk

Re: [SR-Users] set_advertised_address

2018-12-04 Thread Daniel-Constantin Mierla
Hello, it is not clear what exactly you want to achieve... Is it that for connected phones from local network to use the local IP and for sip messages with devices outside to use external ip? Cheers, Daniel On 04.12.18 23:33, Kjeld Flarup wrote: > Hello > > I have a PBX behind NAT. > Thus I adv

Re: [SR-Users] set_advertised_address

2018-12-04 Thread Sergiu Pojoga
Sure, eliminate NAT altogether? Haha Don't see how else. On Tue, Dec 4, 2018, 5:34 PM Kjeld Flarup Hello > > I have a PBX behind NAT. > Thus I advertise the public IP, and forwards the port to my PBX. > > listen=LOCALIP:5070 advertise EXTERNALIP:5070 > > Now clients can connect to the PBX from t

[SR-Users] set_advertised_address

2018-12-04 Thread Kjeld Flarup
Hello I have a PBX behind NAT. Thus I advertise the public IP, and forwards the port to my PBX. listen=LOCALIP:5070 advertise EXTERNALIP:5070 Now clients can connect to the PBX from the Internet. And also inside the LAN, because I have enabled NAT loopback. However some customers sysadmins c

Re: [SR-Users] set_advertised_address with variable

2018-10-08 Thread Patrick Wakano
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 wrote: > Hello, > > yesterday afternoon I pushed an alternative for allow

Re: [SR-Users] set_advertised_address with variable

2018-10-05 Thread Daniel-Constantin Mierla
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 serie

Re: [SR-Users] set_advertised_address with variable

2018-10-02 Thread Patrick Wakano
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

Re: [SR-Users] set_advertised_address with variable

2018-10-01 Thread Daniel-Constantin Mierla
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 f

Re: [SR-Users] set_advertised_address with variable

2018-10-01 Thread Henning Westerholt
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 t

Re: [SR-Users] set_advertised_address with variable

2018-09-27 Thread 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? Ki

[SR-Users] set_advertised_address with variable

2018-09-27 Thread Patrick Wakano
Hello list, Hope you all doing fine! I am using version 5.0.7 and I was trying to use the set_advertised_address with an avp variable but it does not replace with the avp value I then find out this thread https://lists.kamailio.org/pipermail/sr-users/2016-March/092327.html, in which is mention