<div><div dir="auto">I thought the same. </div></div><div dir="auto"><br></div><div dir="auto">I tested a couple different scenarios and ways to do it, from my perspective the simplest is:</div><div dir="auto"><br></div><div dir="auto">1- Listen on 2 ports</div><div dir="auto">2- Use the special attribute “socket” in dispatcher.</div><div dir="auto"><br></div><div dir="auto">That way I hardly have to touch the kamailio config and I don’t have to check stuff and select correct socket blablabla.. it’s done automagically by dispatcher. </div><div dir="auto"><br></div><div dir="auto">Cheers,</div><div dir="auto">Joel. </div><div dir="auto"><br></div><div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 17, 2019 at 00:26 Dmitry Sytchev <<a href="mailto:kbdfck@gmail.com">kbdfck@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I've chosen that path with second port for internal traffic.<br>
Not as cool as single port, but for now I found this simplifies my<br>
config file flow. I haven't managed this to be done with conditions,<br>
because it becomes harder when we decide about directions etc...<br>
<br>
I'd be glad to know if you find other ways to do this!<br>
<br>
ср, 16 янв. 2019 г. в 21:06, Joel Serrano <<a href="mailto:joel@textplus.com" target="_blank">joel@textplus.com</a>>:<br>
><br>
> Hello Dmitry,<br>
><br>
> I was wondering if you got this working? I'm facing a similar scenario and I don't know if it's worth going this path vs having a second port on internal IP without advertise just for internal traffic.... ?<br>
><br>
> Thanks,<br>
> Joel.<br>
><br>
> On Mon, Dec 17, 2018 at 3:55 AM Dmitry Sytchev <<a href="mailto:kbdfck@gmail.com" target="_blank">kbdfck@gmail.com</a>> wrote:<br>
>><br>
>> Yes, I'm handling external IP with domain module, so I'm matching it<br>
>> as 'myself'.<br>
>> I'll try to do it this way.<br>
>><br>
>> Thank you, Daniel!<br>
>><br>
>> пн, 17 дек. 2018 г. в 14:49, Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>>:<br>
>> ><br>
>> ><br>
>> > On 17.12.18 12:37, Daniel-Constantin Mierla wrote:<br>
>> > > Hello,<br>
>> > ><br>
>> > ><br>
>> > > On 17.12.18 11:38, Dmitry Sytchev wrote:<br>
>> > >> Hi all!<br>
>> > >> I have a question that arises in mailing list sometimes, but it is<br>
>> > >> still not clear for me how to work with this.<br>
>> > >><br>
>> > >> We have AWS instance with standard Amazon bi-nat, so basically<br>
>> > >> communication with external hosts works with<br>
>> > >> listen udp:ip:port advertise ip:port<br>
>> > >><br>
>> > >> But in case when we need to send external call to internal network by<br>
>> > >> internal ip addresses, we want to have internal host in record-route.<br>
>> > >> As far as I understand, basic recommendation is to use separate port<br>
>> > >> or internal address and select it with appropriate function.<br>
>> > >><br>
>> > >> Maybe it is more theoretical question, but can we do something to<br>
>> > >> generate correct record-routes and VIA for calls coming from external<br>
>> > >> network to make their softswitches happy, and still maintain internal<br>
>> > >> address in messages going to internal hosts, using single host and<br>
>> > >> port on Kamailio behind nat?<br>
>> > > you can do also without setting advertise address for a listen socket.<br>
>> > > Just listen on local IP and then you have to use<br>
>> > > set_advertise_address(...) to set the IP in Via and<br>
>> > > record_route_preset(...) to set the Record-Route header.<br>
>> > ><br>
>> > > Only that the config becomes a bit more complex, you have to add IF<br>
>> > > conditions when to add private or public IP addresses there.<br>
>> ><br>
>> > One thing I forgot: the public IP has to be treated as local IP (to<br>
>> > match against 'myself'), so you have to do conditions on it -- either<br>
>> > directly in the config conditions, or adding an alias or using domain<br>
>> > module.<br>
>> ><br>
>> > Cheers,<br>
>> > Daniel<br>
>> ><br>
>> > --<br>
>> > Daniel-Constantin Mierla -- <a href="http://www.asipto.com" rel="noreferrer" target="_blank">www.asipto.com</a><br>
>> > <a href="http://www.twitter.com/miconda" rel="noreferrer" target="_blank">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" rel="noreferrer" target="_blank">www.linkedin.com/in/miconda</a><br>
>> > Kamailio World Conference - May 6-8, 2019 -- <a href="http://www.kamailioworld.com" rel="noreferrer" target="_blank">www.kamailioworld.com</a><br>
>> > Kamailio Advanced Training - Mar 4-6, 2019 -- <a href="http://www.asipto.com" rel="noreferrer" target="_blank">www.asipto.com</a><br>
>> ><br>
>><br>
>><br>
>> --<br>
>> Best regards,<br>
>><br>
>> Dmitry Sytchev,<br>
>> IT Engineer<br>
>><br>
>> _______________________________________________<br>
>> Kamailio (SER) - Users Mailing List<br>
>> <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
>> <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br>
<br>
<br>
-- <br>
Best regards,<br>
<br>
Dmitry Sytchev,<br>
IT Engineer<br>
</blockquote></div></div>