Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

freeswitch use private address for rtp ( osx + docker + x-lite ) #9

Open
edwinfound opened this issue Jan 22, 2018 · 1 comment
Open

Comments

@edwinfound
Copy link

Environment

OSX: 10.12.2 (16C68)
Docker: Version 17.03.1-ce-mac12 (17661)
freeswitch container: https://hub.docker.com/r/bettervoice/freeswitch-container/

Network

Docker container IP: 172.17.0.2
Docker host IP: 192.168.1.121

Docker setup

docker run -d \
        --name freeswitch \
        -p 5060:5060/tcp \
        -p 5060:5060/udp \
        -p 5066:5066/tcp \
        -p 5080:5080/tcp \
        -p 5080:5080/udp \
        -p 8021:8021/tcp \
        -p 7443:7443/tcp \
        -p 60535-60635:60535-60635/udp \
        -v /my/docker/freeswitch/conf:/usr/local/freeswitch/conf:rw \
        -v /my/docker/freeswitch/default_freeswitch:/etc/default/freeswitch \
        bettervoice/freeswitch-container:1.6.16

Only change the follow settings:

vars.xml

<X-PRE-PROCESS cmd="set" data="external_sip_ip=192.168.1.121"/>
<X-PRE-PROCESS cmd="set" data="external_rtp_ip=192.168.1.121"/>

sip_profiles/internal.xml:

<param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
<param name="ext-sip-ip" value="$${external_sip_ip}"/>

sip_profiles/external.xml:

<param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
<param name="ext-sip-ip" value="$${external_sip_ip}"/>

switch.conf.xml

<param name="rtp-start-port" value="60535"/>
<param name="rtp-end-port" value="60635"/>

default_freeswitch

# /etc/default/freeswitch
DAEMON_OPTS="-rp"

When I call X-Lite A (1000) -> X-Lite B(1001) , it use the private address 172.17.0.2 for rtp address. Actually I want these two X-Lite use 192.168.1.121 for rtp.

Could anyone give me some help ?

@thomasquintana
Copy link
Contributor

thomasquintana commented Jan 26, 2018

The FreeSWITCH instance inside the container will not see the host's IP address. There are a few options:

  • You could use --net=host when launching your container and it will share the same network stack as the host.
  • You could use port forwarding which is very easy with docker the -p option will handle iptables on your behalf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants