Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I try to use this container:
https://hub.docker.com/r/tiredofit/freepbx/
For that i have created this compose file:
https://pastebin.com/CkL1y0jd
I have proxied port 80 to my internal IP 172.20.0.45. This works great. But Port 5160 is not reachable from the outside.
On my Docker host i have ran
ngrep -W byline -d eno1 port 5160
This gives me the following output:
U 192.168.30.22:54194 -> 192.168.50.20:5160
REGISTER sip:pbx.UsualyMyDomain.ch:5160;transport=UDP SIP/2.0.
Via: SIP/2.0/UDP 212.XX.XX.XXX:54194;branch=z9hG4bK-524287-1---9bb8a42e6116af86;rport.
Max-Forwards: 70.
Contact: <sip:120@212.XXX.XXX.XXX:54194;rinstance=c4ebbf8b0a8fd276;transport=UDP>.
To: "4141XXXXXXX"<sip:120@pbx.UsualyMyDomain.ch:5160;transport=UDP>.
From: "4141XXXXXXX"<sip:120@pbx.UsualyMyDomain.ch:5160;transport=UDP>;tag=b4afdd24.
Call-ID: uXyh0WASXl2Cpp3oD0RYtw...
CSeq: 2 REGISTER.
Expires: 60.
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE.
User-Agent: Zoiper rv2.9.RC37-15-g9fc1f76ee4.
Allow-Events: presence, kpml, talk.
Content-Length: 0.
But if i run the above command inside of my container, then i get no packets at all:
ngrep -W byline -d eno1 port 5160
interface: eno1 (172.20.0.0/255.255.255.0)
filter: (ip or ip6) and ( port 5160 )
So where do i have to search for problems now?
netstats -tln
shows:
tcp6 0 0 :::5160 :::* LISTEN 13316/docker-proxy
But no UDP6 or UDP.
Could that be the problem?
Thanks in advance
For all those out there who find a similar problem.
Read this: http://bhashitparikh.com/2016/02/03/when-port-forwarding-didnt-work-in-docker.html
One of the problems was that you must insert your Docker IP under SIP-CHAN Settings as bind address. Then also use static-ip and enter your docker ip.
And last but not least, add this to the compose file:
5160:5160/udp
5060:5060/udp
Otherwise it will only listen to tcp traffic!
now it works :)
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.