Giter Site home page Giter Site logo

bettervoice / freeswitch-container Goto Github PK

View Code? Open in Web Editor NEW
235.0 235.0 128.0 75 KB

This project can be used to deploy a FreeSWITCH server inside a Docker container. The container currently uses the latest stable release version 1.6.x. An effort was made to build many modules so the container can be generic enough to serve many purposes.

Home Page: https://www.bettervoice.com

Shell 51.24% Python 48.76%

freeswitch-container's People

Contributors

csindle avatar darless avatar lylepratt avatar thomasquintana avatar wimh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

freeswitch-container's Issues

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

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 ?

fail2ban not starting

Hi, when starting the container fail2ban does not start. It seems it looks for /var/log/auth.log and not finding it, shuts down. I believe creating that file in the Dockerfile should be enough to fix it.

Thanks!

docker: unauthorized: authentication required error when running the docker run command

I am not sure what I am doing wrong see system information below.

System: Ubuntu 22.04. 8gb ram, Intel core i5.
Docker version 20.10.21, build baeda1f

Command;

CID=$(sudo docker run --privileged --name freeswitch -p 5060:5060/tcp -p 5060:5060/udp -p 5080:5080/tcp -p 5080:5080/udp -p 8021:8021/tcp -p 7443:7443/tcp -p 60535-65535:60535-65535/udp -v /home/ubuntu/freeswitch/conf:/usr/local/freeswitch/conf bettervoice/freeswitch-container:1.6.6);

Result:

docker: unauthorized: authentication required.
See 'docker run --help'.]

Thank you in anticipation of your help.

docker public ip

You should consider also the new sintax to retrieve the public IP.

$ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $INSTANCE_ID

I use Docker version 17.12.0-ce and the old method is not working anymore, returns null

$ docker inspect --format '{{ .NetworkSettings.IPAddress }}' $INSTANCE_ID

Please check Docker Docs

fatal error: libavresample/avresample.h: No such file or directory

When building the image I get the following error:

make[4]: Entering directory `/usr/src/freeswitch/src/mod/applications/mod_av'
  CC       mod_av_la-mod_av.lo
  CC       mod_av_la-avformat.lo
avformat.c:40:38: fatal error: libavresample/avresample.h: No such file or directory
 #include <libavresample/avresample.h>
                                      ^
compilation terminated.
make[4]: *** [mod_av_la-avformat.lo] Error 1
make[4]: Leaving directory `/usr/src/freeswitch/src/mod/applications/mod_av'

Does it make any errors when those container were deployed to Kubernetes?

I am trying to deploy Kubernetes cluster on arm,so I need to make sure that what application do I test on first.[for any application make have performance reduction problems in this process]
I have use ordinary freeswitch on my project for many times and I am very curious about that on docker

No audio during the calls from SoftPhone A -> to -> SoftPhone B

I am running a container out of this image with the following port config.

Host Machine IP : 192.168.235.100
Docker Container IP : 172.22.0.2

version: '2.3'
services:
    freeswitch:
        build:
            context: .
            network: host
        image: bettervoice/freeswitch-container:1.6.16
        privileged: true
        restart: always
        ports:
            - "5060:5060/tcp"
            - "5060:5060/udp"
            - "5066:5066/tcp"
            - "5070:5070/udp"
            - "5080:5080/tcp"
            - "5080:5080/udp"
            - "8021:8021/tcp"
            - "7443:7443/tcp"
            - "16384-16394:16384-16394/udp"
        volumes:
            - ./conf:/usr/local/freeswitch/conf

networks:
  default:

And I have connected two(2) SoftPhones into the container and I can place calls from one to another. However there is no audio at all.

I have changed the vars.xml for to put my host machine IP, switch.conf.xml for rtp port ranges, sip_profiles/{internal,external}.xml for ext-{rtp,sip}-ip to use $${external_rtp_ip}. Basically the same changes that you see in the question here : #9

freeswitch@localhost> sofia status profile external
=================================================================================================
Name             	external
Domain Name      	N/A
Auto-NAT         	false
DBName           	sofia_reg_external
Pres Hosts
Dialplan         	XML
Context          	public
Challenge Realm  	auto_to
RTP-IP           	172.22.0.2
Ext-RTP-IP       	192.168.235.100
SIP-IP           	172.22.0.2
Ext-SIP-IP       	192.168.235.100
URL              	sip:[email protected]:5080
BIND-URL         	sip:[email protected]:5080;maddr=172.22.0.2;transport=udp,tcp
HOLD-MUSIC       	local_stream://moh
OUTBOUND-PROXY   	N/A
CODECS IN        	OPUS,G722,PCMU,PCMA,VP8
CODECS OUT       	OPUS,G722,PCMU,PCMA,VP8
TEL-EVENT        	101
DTMF-MODE        	rfc2833
CNG              	13
SESSION-TO       	0
MAX-DIALOG       	0
NOMEDIA          	false
LATE-NEG         	true
PROXY-MEDIA      	false
ZRTP-PASSTHRU    	true
AGGRESSIVENAT    	false
CALLS-IN         	0
FAILED-CALLS-IN  	0
CALLS-OUT        	0
FAILED-CALLS-OUT 	0
REGISTRATIONS    	0

You can see that my two(2) softphones are registered into the internal profile as it says REGISTRATIONS 2

freeswitch@localhost> sofia status profile internal
=================================================================================================
Name             	internal
Domain Name      	N/A
Auto-NAT         	false
DBName           	sofia_reg_internal
Pres Hosts       	172.22.0.2,192.168.235.100
Dialplan         	XML
Context          	public
Challenge Realm  	auto_from
RTP-IP           	172.22.0.2
Ext-RTP-IP       	192.168.235.100
SIP-IP           	172.22.0.2
Ext-SIP-IP       	192.168.235.100
URL              	sip:[email protected]:5060
BIND-URL         	sip:[email protected]:5060;maddr=172.22.0.2;transport=udp,tcp
WS-BIND-URL     	sip:[email protected]:5066;transport=ws
WSS-BIND-URL     	sips:[email protected]:7443;transport=wss
HOLD-MUSIC       	local_stream://moh
OUTBOUND-PROXY   	N/A
CODECS IN        	OPUS,G722,PCMU,PCMA,VP8
CODECS OUT       	OPUS,G722,PCMU,PCMA,VP8
TEL-EVENT        	101
DTMF-MODE        	rfc2833
CNG              	13
SESSION-TO       	0
MAX-DIALOG       	0
NOMEDIA          	false
LATE-NEG         	true
PROXY-MEDIA      	false
ZRTP-PASSTHRU    	true
AGGRESSIVENAT    	false
CALLS-IN         	2
FAILED-CALLS-IN  	0
CALLS-OUT        	1
FAILED-CALLS-OUT 	0
REGISTRATIONS    	2

I would really appreciate some help here.

Testing for docker changes

Have there been thoughts on how best to test changes that are done for the Dockerfile?
So far I would guess its a manual process, it would be nice to test these changes automatically. I'm interested on hearing people's thoughts.

My thought would be as follows:

  • Use Travis CI. Travis CI does support dockerfiles but for how this works we might need to have access to more than just the docker but to multiple local IPs so we can start up 2 docker instances of freeswitch so we can test calls.
  • We could potentially use AWS which would spin up AMIs that are already configured with support for docker/git/.
  • Then travis would run a test program to go through our tests and do the various tests via a python interaction with the docker instances via the event socket 8021.

What happens if I run this as a service?

My plan is to run FreeSWITCH containers as a service on a Docker Swarm.
What I want to understand is:
What would happen if I make a request via ESL (let's say I want to execute certain commands for a channel) and that channel does not exist on the instance?
Is there a way where I can route the request to a specific FreeSWITCH? Or something that sends it to all the available containers in the swarm and outputs only the valid response?
I am sorry if this is not the right place to ask this question, but, any help would be greatly appreciated.

Cannot run/setup

I am attempting to dockerize freeswitch for work, but I am running into all sorts of roadblocks. The first one occurs after I build the image using the dockerfile. After I get the image I try to start it using the command that you guys listed in the description under running the container. That pulls down more data, although this might be because I didnt change the version number so it thought I wanted an older version (I'm not sure where I went wrong on this).

After that a container does show up when I check it with docker ps -a. Running it does not work with the command provided, and I cannot seem to start like I usually do with containers.

Any ideas? If someone has setup a freeswitch containerr, which I am assuming most of everyone reading this has do you might posting the exact steps you did. Maybe I am overlooking something or missing something, its hard to say especially since docker is pretty new to me along with everything else I am doing currently.

Freeswitch logs are missing - from docker logs

Issue is happening on debian 9 only.

Basically, if I pull the same image with "1.6.16" tag and if I spin up container on ubuntu 16.04 (on my localhost) I can see freeswitch logs just fine (with docker logs).

If I do the same on the debian 9 (on server side), then freeswitch logs are missing and they are not accessible with docker logs.

Both machines are using same docker version 17.09.0-ce

Did anyone encounter similar issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.