0

I am very frustrated because I haven't been able to call to FreeSWITCH Event Socket (which is in the outside world) from a docker container.

I want to make it possible without need to install FreeSWITCH for this container, because FreeSWITCH is already installed in the outside world, that is my host machine.

It is not about to make the container listens the port 8021. It is about that the container can interact with the outside to recognize that FreeSWITCH Event Socket is in the IP 127.0.0.1 port 8021, and so finally get over that error.

It has spent me many hours trying to solve it, but I haven't achieved, and I'm frustrated.

Any help, I'll thank for that. If anybody believes that I want to do is not possible, I'll comprehend it.

  • Does [From inside of a Docker container, how do I connect to the localhost of the machine?](https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach) answer your question, or do you need more than a simple TCP connection to the host process? Is there a specific application this is in support of, or is this an abstract network-setup question? – David Maze Feb 02 '21 at 00:22
  • Sorry. I made that question, because none of the answers from that forum didn't work for me. – Christian Norena Feb 02 '21 at 14:34

2 Answers2

0

Inside the container, 127.0.0.1 means the container itself. If you want to connect the host, you need to use the host IP (something like 192.168.x.x). You can pass to the container in env variables (-e on the run command).

Cyril G.
  • 1,879
  • 2
  • 5
  • 19
0

In host machine, show IP by:

ip address

And connect the IP you get from docker.

Lin Yu Cheng
  • 667
  • 9
  • 21