IMX6 audio streaming solution using SIP protocol

Here described IMX6 audio  streaming VOIP solution using  NetSoM development board based on IMX6ULL SoM as SIP client.

Hardware requirements.

You have to stick WM8960 audio module to NetSoM development board. This setup will act as SIP client allowing to make a voice calls to/from another devices in network

Software requirements.

You have to use audio_stream_ethernet or audio_stream_wifi images. Steps to update NetSoM firmware described here.

 

SIP Server setup.

Easiest way to get it — is running Freeswitch SIP server in docker container.

Look here if you don’t have docker installed yet. In short it removes the headache of installing software with all its dependencies.

Clone the project:

$ git clone -b vanilla https://github.com/wireless-road/docker-freeswitch.git
$ cd docker-freeswitch

build Docker image:

$ docker build -t fs .

and run it:

$ docker run -it —privileged=true —net=»host» —name=FS -v /home/user/docker-freeswitch/freeswitch_config_example:/etc/freeswitch fs

where /home/user/docker-freeswitch/freeswitch_config_example is path to freeswitch_config_example folder of the repo you clone above. This config defines three client’s IDs: 1000, 1001 and 1002 with passwords same as ID. Server address set to 192.168.0.118. You have to change it to IP address of your server in dialplan/default/20-interconnect.xml and directory/private.xml files. Here and below you can use domain name of your server instead of IP address.

You have to configure following ports accessible outside: 5060, 5080, 16384-16393. On ubuntu you can do it by typing:

$ sudo ufw status
$ sudo ufw allow 5060
$ sudo ufw allow 5080
$ sudo ufw allow 16384
$ sudo ufw allow 16385

$ sudo ufw allow 16393
$ sudo ufw status

After you got SIP server it is time to run SIP client. One on NetSoM development board and the second on any another PC/laptop.

Running baresip client on NetSoM.

First edit config file:

# vi /etc/baresip/accounts

comment everything in that file and add just one line:

<sip:1001@192.168.0.118>;auth_pass=1001
here 192.168.0.118 is IP address of  freeswitch server.
Save and exit from file.
Then run baresip client:
# baresip -f /etc/baresip

You should see logmessage similar to following:

1001@192.168.0.118: {0/UDP/v4} 200 OK () [1 binding]
All 1 useragent registered successfully! (14 ms)
Now you have to run second baresip client on any other machine.

Running baresip client on PC/laptop.

Just install baresip:

$ sudo apt-get install baresip

Edit config file (probably ~/.baresip/accounts):

$ nano ~/.baresip/accounts

Similar to previous chapter comment everything in that file and add following line:

<sip:1002@192.168.0.118>;auth_pass=1002
Then just run baresip without providing any arguments:
$ baresip

 

Make a call.

Now everything should be ready to make a call: you have SIP server running and two SIP clients (1001 on NetSoM development board and 1002 on laptop). Probably you have to place them in different rooms far away from each other.

So, finally, let’s make a call from NetSoM to laptop. Just type d and then address of laptop 1002. After that laptop should inform you that «the phone is ringing«. Type a to answer a call. Enjoy it!

Here you can find guide of audio playing/recording from/to file.