[SR-Users] Need kamailio to use advertise public IP only in cases of SIP communication over internet.

David Villasmil david.villasmil.work at gmail.com
Wed Oct 6 12:30:43 CEST 2021


And use the function rfc1918($si) to figure if the source or destination ip
Is a private ip. You can achieve the same with socket received, etc.

On Wed, 6 Oct 2021 at 00:10, Sergey Safarov <s.safarov at gmail.com> wrote:

> you need to configure two listen directive
>
> one for local lan devices
> second for call via the Internet.
>
> The second listen socket need to be bound to port different than 5060 (say
> 5080).
> configure NAT rules on router to forward packets from internet to port
> like 5080.
> And in listen, directive advertise public with port 5060
>
>
>
> On Tue, Oct 5, 2021 at 8:27 PM Alex Balashov <abalashov at evaristesys.com>
> wrote:
>
>> It seems to me you should look at the “advertise” parameter to the core
>> “listen” directive:
>>
>>
>> https://www.kamailio.org/wiki/cookbooks/5.5.x/core?s%5B%5D=advertise#listen
>>
>>>> Sent from mobile, with due apologies for brevity and errors.
>>
>> On Oct 5, 2021, at 1:20 PM, Voip support <voipexpert0 at gmail.com> wrote:
>>
>> 
>> Dear Community,
>>
>> I have a need of communicating with other servers using private IP with
>> private IP in Via and SDP connection information but at same time sometime
>> need connect to public IP SIP server and on outgoing INVITE's i need
>> advertise public IP in Record-Route and SDP Connection information.
>>
>> Currently if i work on listen=udp:privateip:5060 i get working the
>> LAN part but cannot work over internet (no audio) but when i add advertise
>> i get SDP public IP also over local network.
>>
>> Is it possible to solve this case using one NIC adapter?
>> I am using RTPProxy.
>>
>> Please help me out. I tried to add second network adapter with advertise
>> and mhomed=1 something started to work but i think i would need work on the
>> call direction and different rtpproxy_manage handling on outside INVITEs
>> and incoming 200 OK responses.
>>
>> I am not sure if this is  the right way to do it - maybe there is some
>> easier method of achieving what i need using one interface ?
>>
>> Best regards,
>> Tom
>> __________________________________________________________
>> Kamailio - Users Mailing List - Non Commercial Discussions
>>  * sr-users at lists.kamailio.org
>> Important: keep the mailing list in the recipients, do not reply only to
>> the sender!
>> Edit mailing list options or unsubscribe:
>>  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>> __________________________________________________________
>> Kamailio - Users Mailing List - Non Commercial Discussions
>>   * sr-users at lists.kamailio.org
>> Important: keep the mailing list in the recipients, do not reply only to
>> the sender!
>> Edit mailing list options or unsubscribe:
>>   * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions
>   * sr-users at lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to
> the sender!
> Edit mailing list options or unsubscribe:
>   * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
-- 
Regards,

David Villasmil
email: david.villasmil.work at gmail.com
phone: +34669448337
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20211006/f9c22a17/attachment.htm>


More information about the sr-users mailing list