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

SIP NAT configuration #12

Closed
fholzhauser opened this issue Mar 31, 2017 · 11 comments
Closed

SIP NAT configuration #12

fholzhauser opened this issue Mar 31, 2017 · 11 comments

Comments

@fholzhauser
Copy link

Thanks for working on these docker images! It makes it really easy to have everything installed, very useful.

I'm running the minimal images on a PC for testing/experimenting purposes. I have problems with calls getting disconnected after 30 sec, due to ACK timeout, and also with not having voice.
I believe that the cause of these issues is that the docker setup implies the scenario of having kazoo behind NAT. Kamailio and Freeswitch however do not seem to be configured for this in the images. In the traces I see that the adresses/ports of the kazoo docker network bridge are communicated to the clients on SIP/SDP. This is a problem e.g. when clients want to send an ACK after receiving a 200 OK with the Freeswitch IP/Port in the SIP contact header.

Would it be possible to have Kamailio/Freeswitch configured by default for this "behind NAT" scenario to modify the relevant SIP headers and communicate the RTP endpoints with a "public" IP? Or is this already taken care of and I have missed something completely obvious ?

@jamhed
Copy link
Owner

jamhed commented Mar 31, 2017

Well, it seems it requires some tweaking to make it work as intended. Thanks for the report, I'll take a peek and let you know.

@fholzhauser
Copy link
Author

Thanks. I'll try to figure out those tweaks as well and keep you posted. Probably you'll beat me to it though as I'm not mastering Kamailio (yet).

@jamhed
Copy link
Owner

jamhed commented Apr 3, 2017

@fholzhauser, please update to latest: remove all kazoo images from docker host, and run run.sh again, I've added something.

@jamhed
Copy link
Owner

jamhed commented Apr 3, 2017

See https://github.com/jamhed/kazoo-docker#networking as brief explanation.

@fholzhauser
Copy link
Author

Thanks for the update.

I have noticed that now kamailio only starts with the run script. When trying to start it with the start script it fails with :

0(1) : <core> [core/cfg.y:3407]: yyerror_at(): parse error in config file /usr/local/kamailio/etc/kamailio/local.cfg, line 121, column 59-67: syntax error
0(1) : <core> [core/cfg.y:3407]: yyerror_at(): parse error in config file /usr/local/kamailio/etc/kamailio/local.cfg, line 121, column 59-67: 

Probably it has something to do with the EXT_IP environment not being present during normal start.

Regarding the calls, I still have disconnections after 30 sec, but it might be some other issue. I'll dig into it and see whether it is related or not.

In the mean time I experimented with simply replacing the IP:Port (with subst) in the contact headers going out in the relevant routing paths (). It actually works, but probably you had a good reason not to go that way, so I'll stick to your solution.

@jamhed
Copy link
Owner

jamhed commented Apr 4, 2017

Regarding the calls, I still have disconnections after 30 sec

This is definitely related with sip messages not being passed either to phone, or to Kazoo's freeswitch.

What is your setup? This works on Scaleway: Docker host with no external ip.

@jamhed
Copy link
Owner

jamhed commented Apr 4, 2017

I experimented with simply replacing the IP:Port

By the way, how do you do that? AFAIK it's not that easy in Kazoo.

@jamhed
Copy link
Owner

jamhed commented Apr 4, 2017

I have noticed that now kamailio only starts with the run script.

You probably need to re-install docker image (e.g. remove old one with docker rmi).

@fholzhauser
Copy link
Author

Sorry for the late reply.
With the latest images, calls work fine, thanks. FYI : previously I changed the contact header in the messages sent out using subst in the relevant routing rules in default.cfg of kamailio. Since the new config of yours works, I don't do that anymore.

Regarding the start problem I guess it is caused by the EXT_IP environment being present at subsequent starts of the kamailio container after run. What fixed it for me is to change the sed line in config-local.sh to replace the whole line (not only the "listen=UDP_SIP" text) when adding the advertise bit to local.cfg.

@jamhed
Copy link
Owner

jamhed commented Apr 19, 2017

Yep, fixed last one. I suppose we can close this now.

@jamhed jamhed closed this as completed Apr 19, 2017
@fholzhauser
Copy link
Author

Indeed, thanks for the fix !

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