[Freeswitch-users] [Q] nat is not detected, when running freeswitch in docker from local machine.

Ruslan Shevchenko ruslan at shevchenko.kiev.ua
Wed Jul 29 20:44:46 UTC 2020


Yes, this can be an option ;)

On Wed, Jul 29, 2020 at 11:41 PM Marcel Haldemann <
marcel.haldemann at convercom.ch> wrote:

>
>
>    - Use Virtualbox or whatever VM-Platform exists on OS X.
>    - Setup a VM with a « Bridged  Network Connection » (The VM will get a
>    own IP from DHCP or you can just set a static one)
>    - Install Debain 10 in the VM
>    - Install Docker in the VM
>    - Setup the Docker container in the VM using –network=host
>
>
>
> *Von:* FreeSWITCH-users <freeswitch-users-bounces at lists.freeswitch.org> *Im
> Auftrag von *Ruslan Shevchenko
> *Gesendet:* Mittwoch, 29. Juli 2020 21:44
> *An:* FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
> *Betreff:* Re: [Freeswitch-users] [Q] nat is not detected, when running
> freeswitch in docker from local machine.
>
>
>
> The problem that --network=host  is not an option for macOS.
>
> (because on macOS this is running non in the host system but in docker
> virtual machine inside.
>
>   Here is a long-standing discussion about this:
> https://github.com/docker/for-mac/issues/2716
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdocker%2Ffor-mac%2Fissues%2F2716&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=n3Ooj4ldfadPCD19W51BqJ6xxXn8Sjfgkv08492%2B%2Fo0%3D&reserved=0>
> ).
>
>
>
>
>
>
>
> On Wed, Jul 29, 2020 at 8:42 PM David Villasmil <
> david.villasmil.work at gmail.com> wrote:
>
> Run the container with —network=host
>
>
>
>
>
> On Wed, 29 Jul 2020 at 16:35, Ruslan Shevchenko <ruslan at shevchenko.kiev.ua>
> wrote:
>
>
>
> Hi, colleagues.
>
>
>
> I discovered a strange problem when running Freeswitch from docker on the
> local machine,
>
>
>
> I have my machine API:  192.168.88.236
>
> and docker with internal ip. 172.17.0.2. (local_ip_v4)
>
>
>
> With the next changes relative to vanilla install:
>
> valr.xml :
>
>       external_rtp_ip=stun:stun.freeswitch.org
> <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fstun.freeswitch.org%2F&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=HotwQ3tN6L47kogMIatsLI61vIz7knjuKa%2Bles7X1Bs%3D&reserved=0>
> - changed to external_rtp_ip=192.168.88.236
>
>       external_sip_ip=stun:stun.freeswitch.org
> <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fstun.freeswitch.org%2F&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=HotwQ3tN6L47kogMIatsLI61vIz7knjuKa%2Bles7X1Bs%3D&reserved=0>
>  - same
>
>
>
> autoload_configs/switch.conf.xml  --- a narrow set of RTP ports.
>
>
>
> sip_profiles:
>
>     internal.xml -- change ext-rtp-ip and ext-sip-ip to 192.168.88.236
>
>    external.xml -- same
>
>
>
> Then I trying to run docker from macos which publish ports:
>
> docker run -d -p 5060:5060/udp -p 5060:5060/tcp -p5061:5061/tcp -p
> 5080:5080/udp -p 5080:5080/tcp -p 5066:5066/tcp -p 7443:7443/tcp -p
> 63535-63635:63535-63635/tcp  -p63535-64535:63535-64535/udp  -p5555:5555
> -p5050:5050 -p8000:8000  --hostname zaka-voice
>  zaka-freeswitch-recognition:0.0.1
>
>
>
> And then when I try to call Freeswitch from linphone from the local net, I
> can hear an answer, but looks like  IVR on the Freeswitch side not receive
> RTP stream.
>
>
>
> I can't understand why.
>
>
>
> One hypothesizes -- that  FreeSWITCH not determinate existence of
> external_ip as NAT mode (?)  and ask the phone to send RTP to 172.17.0.2.
>
>
>
> How to verify this?    Maybe exists some ideas, how to debug such
> situation behind a sip trace?
>
>
>
> Thanks.
>
>
>
> P.S.  Additional info, if anybody found this interesting:
>
>
>
> I.e. I see SIP invite from FreeSWITCH
>
>
>
> SIP/2.0 100 Trying
> Via: SIP/2.0/TCP 192.168.88.238:50091
> ;branch=z9hG4bK.rNrD-0O~i;rport=51208;received=172.17.0.1
> From: <sip:1002 at 192.168.88.236>;tag=4bI6NNSIi
> To: "33332220" <sip:33332220 at 192.168.88.236>
> Call-ID: 7At9kxIfv2
> CSeq: 21 INVITE
> User-Agent: FreeSWITCH-mod_sofia/1.10.4-dev-2421-8a5850ff26~64bit
> Content-Length: 0
>
>
>
> then  Ok and Acc from linphone (which freeswitch see as on 172.17.0.2)
>
>
>
> recv 354 bytes from tcp/[172.17.0.1]:51208 at 09:20:26.099724:
> ------------------------------------------------------------------------
> SIP/2.0 200 Ok
> Via: SIP/2.0/TCP 192.168.88.236;branch=z9hG4bK8502eXUvmSKyN
> From: <sip:1002 at 172.17.0.2>;tag=mrr024e5DH57Q
> To: <sip:1002 at 172.17.0.2>;tag=ftaVWOB
> Call-ID: 940c69ac-4c1f-1239-4cb1-0242ac110002
> CSeq: 23453420 NOTIFY
> User-Agent: LinphoneiOS/4.3.1 (iPad Ruslan) LinphoneSDK/4.4.0
> Supported: replaces, outbound, gruu
> Content-Length: 0
>
>
>
> recv 640 bytes from tcp/[172.17.0.1]:51208 at 09:20:26.514163:
> ------------------------------------------------------------------------
> ACK sip:33332220 at 192.168.88.236:5060;transport=tcp SIP/2.0
> Via: SIP/2.0/TCP 192.168.88.238:50091;rport;branch=z9hG4bK.iYrbMWTLP
> From: <sip:1002 at 192.168.88.236>;tag=4bI6NNSIi
> To: "33332220" <sip:33332220 at 192.168.88.236>;tag=N1HS4ZZ8atUtK
> CSeq: 21 ACK
> Call-ID: 7At9kxIfv2
> Max-Forwards: 70
> Proxy-Authorization:  Digest realm="192.168.88.236",
> nonce="44104e4a-30cb-4277-8c31-61e437b6cbd1", algorithm=MD5,
> username="1002",  uri="sip:33332220 at 192.168.88.236",
> response="756a3d3e3a76996988afa09a5544f1d1", cnonce="CWKOLtHm9Z8eVYIm",
> nc=00000001, qop=auth
> User-Agent: LinphoneiOS/4.3.1 (iPad Ruslan) LinphoneSDK/4.4.0
> Content-Length: 0
>
>
>
> Then  freeswitch not see any activity and says BYE:
>
> BYE sip:1002 at 172.17.0.1:51208;transport=tcp SIP/2.0
> Via: SIP/2.0/TCP 192.168.88.236;branch=z9hG4bK9etUgrc0H29gH
> Max-Forwards: 70
> From: "33332220" <sip:33332220 at 192.168.88.236>;tag=N1HS4ZZ8atUtK
> To: <sip:1002 at 192.168.88.236>;tag=4bI6NNSIi
> Call-ID: 7At9kxIfv2
> CSeq: 23453425 BYE
> User-Agent: FreeSWITCH-mod_sofia/1.10.4-dev-2421-8a5850ff26~64bit
> Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER,
> REFER, NOTIFY, PUBLISH, SUBSCRIBE
> Supported: timer, path, replaces
> Reason: Q.850;cause=16;text="NORMAL_CLEARING"
> Content-Length: 0
>
>
>
> ---
>
>   status of Sofia profile:
>
>
>
> ---
>
>
> freeswitch at zaka-voice> sofia status profile internal
>
> =================================================================================================
> Name             internal
> Domain Name       N/A
> Auto-NAT         false
> DBName           sofia_reg_internal
> Pres Hosts       172.17.0.2,172.17.0.2
> Dialplan         XML
> Context           public
> Challenge Realm   auto_from
> RTP-IP           172.17.0.2
> Ext-RTP-IP       192.168.88.236
> SIP-IP           172.17.0.2
> Ext-SIP-IP       192.168.88.236
> URL               sip:mod_sofia at 192.168.88.236:5060
> <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsip%3Amod_sofia%40192.168.88.236%3A5060%2F&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=oJxrkCt8Zr0AmBXh0gBivtWIrvZG1X09Q%2BrUaoOjlXI%3D&reserved=0>
> BIND-URL
> sip:mod_sofia at 192.168.88.236:5060;maddr=172.17.0.2;transport=udp,tcp
> WS-BIND-URL     sip:mod_sofia at 172.17.0.2:5066;transport=ws
> WSS-BIND-URL     sips:mod_sofia at 172.17.0.2:7443;transport=wss
> HOLD-MUSIC       local_stream://moh
> OUTBOUND-PROXY   N/A
> CODECS IN         OPUS,G722,PCMU,PCMA,H264,VP8
> CODECS OUT       OPUS,G722,PCMU,PCMA,H264,VP8
> TEL-EVENT         101
> DTMF-MODE         rfc2833
> CNG               13
> SESSION-TO       0
> MAX-DIALOG       0
> NOMEDIA           false
> LATE-NEG         true
> PROXY-MEDIA       false
> ZRTP-PASSTHRU     true
> AGGRESSIVENAT     false
> CALLS-IN         0
> FAILED-CALLS-IN   0
> CALLS-OUT         0
> FAILED-CALLS-OUT 0
> REGISTRATIONS     0
>
>
>
>
> --
>
> Ruslan Shevchenko
> Software Engineer.
> http://ua.linkedin.com/in/ruslanshevchenko
> <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fua.linkedin.com%2Fin%2Fruslanshevchenko&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=ev7w2bxWqUd8wQQLXJhlpq8ZpB4L5%2FCFySLs%2FZAmLuw%3D&reserved=0>
>
> _________________________________________________________________________
>
> The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsignalwire.com%2F&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=c%2BbaTGx4iiQmCPJWAc9mCzpuQ94MZqRSRmEfOZ0qBmg%3D&reserved=0>
> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
> services.
> Build your next product on our scalable cloud platform.
>
> Join our online community to chat in real time
> https://signalwire.community
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsignalwire.community%2F&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=U5b9Z7K6RfhY%2FryXtN%2Bk4fT2pA%2F7rsfwVSaMDxR0LN0%3D&reserved=0>
>
> Professional FreeSWITCH Services
> sales at freeswitch.com
> https://freeswitch.com
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffreeswitch.com%2F&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=JBtA1l6LeMKtBPArY7lkRkdZvzepIZwv5pL3MY7oFf0%3D&reserved=0>
>
> Official FreeSWITCH Sites
> https://freeswitch.com/oss
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffreeswitch.com%2Foss&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=pSIzoFTaVNvzjYtcDywjtSp832Bkx8FIzqkDBjupEKQ%3D&reserved=0>
> https://freeswitch.org/confluence
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffreeswitch.org%2Fconfluence&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=HVWEyy2Bf3wwIia3w43hc6p2auZ4Ej5IBw9112iMm0E%3D&reserved=0>
> https://cluecon.com
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcluecon.com%2F&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=WWbTCZZDZmj7vJUK%2B%2F4NgKsnV6Ib%2FhVwVppeunCHvGI%3D&reserved=0>
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.freeswitch.org%2Fmailman%2Flistinfo%2Ffreeswitch-users&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=dXuhTCJORrM%2Fw5%2BqURaVrUeTcwWeBRlgBNrpT1kzS9A%3D&reserved=0>
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.freeswitch.org%2Fmailman%2Foptions%2Ffreeswitch-users&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=w2Hzm16JxdpWP9gOyanLVzBAjVET8Hv1TupEXrWspSg%3D&reserved=0>
> https://freeswitch.com
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffreeswitch.com%2F&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=JBtA1l6LeMKtBPArY7lkRkdZvzepIZwv5pL3MY7oFf0%3D&reserved=0>
>
> --
>
> Regards,
>
>
>
> David Villasmil
>
> email: david.villasmil.work at gmail.com
>
> phone: +34669448337
>
> _________________________________________________________________________
>
> The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsignalwire.com%2F&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=c%2BbaTGx4iiQmCPJWAc9mCzpuQ94MZqRSRmEfOZ0qBmg%3D&reserved=0>
> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
> services.
> Build your next product on our scalable cloud platform.
>
> Join our online community to chat in real time
> https://signalwire.community
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsignalwire.community%2F&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=U5b9Z7K6RfhY%2FryXtN%2Bk4fT2pA%2F7rsfwVSaMDxR0LN0%3D&reserved=0>
>
> Professional FreeSWITCH Services
> sales at freeswitch.com
> https://freeswitch.com
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffreeswitch.com%2F&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=JBtA1l6LeMKtBPArY7lkRkdZvzepIZwv5pL3MY7oFf0%3D&reserved=0>
>
> Official FreeSWITCH Sites
> https://freeswitch.com/oss
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffreeswitch.com%2Foss&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=pSIzoFTaVNvzjYtcDywjtSp832Bkx8FIzqkDBjupEKQ%3D&reserved=0>
> https://freeswitch.org/confluence
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffreeswitch.org%2Fconfluence&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=HVWEyy2Bf3wwIia3w43hc6p2auZ4Ej5IBw9112iMm0E%3D&reserved=0>
> https://cluecon.com
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcluecon.com%2F&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=WWbTCZZDZmj7vJUK%2B%2F4NgKsnV6Ib%2FhVwVppeunCHvGI%3D&reserved=0>
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.freeswitch.org%2Fmailman%2Flistinfo%2Ffreeswitch-users&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=dXuhTCJORrM%2Fw5%2BqURaVrUeTcwWeBRlgBNrpT1kzS9A%3D&reserved=0>
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.freeswitch.org%2Fmailman%2Foptions%2Ffreeswitch-users&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=w2Hzm16JxdpWP9gOyanLVzBAjVET8Hv1TupEXrWspSg%3D&reserved=0>
> https://freeswitch.com
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffreeswitch.com%2F&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=JBtA1l6LeMKtBPArY7lkRkdZvzepIZwv5pL3MY7oFf0%3D&reserved=0>
>
>
>
>
> --
>
> Ruslan Shevchenko
> Software Engineer.
> http://ua.linkedin.com/in/ruslanshevchenko
> <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fua.linkedin.com%2Fin%2Fruslanshevchenko&data=01%7C01%7Cmarcel.haldemann%40convercom.ch%7C8834d62ba3c14be3553908d833fc8928%7C7ce740fda23249b386211580d81623b0%7C0&sdata=ev7w2bxWqUd8wQQLXJhlpq8ZpB4L5%2FCFySLs%2FZAmLuw%3D&reserved=0>
> _________________________________________________________________________
>
> The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
> services.
> Build your next product on our scalable cloud platform.
>
> Join our online community to chat in real time
> https://signalwire.community
>
> Professional FreeSWITCH Services
> sales at freeswitch.com
> https://freeswitch.com
>
> Official FreeSWITCH Sites
> https://freeswitch.com/oss
> https://freeswitch.org/confluence
> https://cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> https://freeswitch.com



-- 
Ruslan Shevchenko
Software Engineer.
http://ua.linkedin.com/in/ruslanshevchenko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20200729/13d4c685/attachment-0001.html>


More information about the FreeSWITCH-users mailing list