3

I need to setup a docker container running an Asterisk PBX.

The problem is that I receive the wrong ip in sdp replies. In fact Asterisk is using the container internal IP.

The second problem is that I must use docker for windows and as such, I can’t use —net=host

So I tried to setup nat in asterisk, setting in sip.conf this :

nat = force_rport,comedia
localnet = 172.17.0.0/16
externaddr = 192.165.10.206

But it doesn’t seems to do anything.

What to I miss here ?

PS : I am using Asterisk 15

iXô
  • 363

1 Answers1

2

My config is as follows:

docker-compose

  asterisk:
    image: asterisk:testing
    ports:
     - "5060:5060/udp"
     - "5060:5060/tcp"
     - "10000-10099:10000-10099/udp"
     - "8088:8088"
     - "8089:8089"
    volumes:
     - "./asterisk/conf:/etc/asterisk"
    labels:
     - "traefik.enable=false"

This allows me to open the necessary ports.

In my sip.conf, I have the following:

[general]
externip = 192.168.1.61
localnet=192.168.0.0/255.255.0.0;
nat=yes

...

And, this works like a charm.

rdehuyss
  • 143