FreeSWITCH D500 PCI Express Codec Distributed Module Configuration
FreeSWITCH Codec Module Configuration
This step will create FreeSWITCH codec module configuration files. Perform the following step ONLY on the FreeSWITCH machine(s) that will be sngtc server clients to the remote box with the hardware transcoder.
This step must be performed for each server that is a client to the remote box containing the transcoder
Note: If you have FreeSWITCH on the same box hosting the sngtc_server/transcoder and configuring for this box, skip the download portion of step 1, as the Transcode Software is already downloaded from previous steps
Download and install Sangoma Transcode Software
-> cd /usr/src/
-> wget <URL of Package>
-> tar xfz sng-tc-<ver>-<arch>.tgz
-> cd sng-tc-<arch>-<ver>
-> make
-> make installThe Sangoma FreeSWITCH codec is part of the FreeSWITCH git repository. It can be easily attained by running the following command in linux CLI:
--> git clone https://freeswitch.org/stash/scm/fs/freeswitch.git
Note* You must have git installed
In the freeSWITCH source code edit:
--> modules.conf and uncomment:
--> # codecs/mod_sangoma_codecThen compile FreeSWITCH Sangoma codec module:
1. make mod_sangoma_codec
2. make mod_sangoma_codec-installThe FreeSWITCH Codec Module is now installed and requires configuration via the following steps. This step will auto detect ALL D500 transcoders and modules located on the same network and will create FreeSWITCH codec module configuration files. All transcoders detected will be configured to all be treated as one big transcoding resource. There is no option to manually control particular modules onboard the D500 cards. Auto detection is performed through the Ethernet interface of your main LAN.
--> sngtc_cfg --freeswitch
or
--> sngtc_cfg --freeswitch --fsdir=/usr/local/freeswitch/conf/autoload_configsThe result of the above command creates an IP address for the transcoding card, by default [<X.X.X>.150] is used
FreeSWITCH Sangoma Transcoding Config file:
/usr/local/freeswitch/conf/autoload_configs/sangoma_codec.conf.xmlFreeswitch now needs to be configured to load the "mod_sangoma_codec" module each time it starts.
--> vi conf/autoload_configs/modules.conf.xml
--> Add the line "<load module="mod_sangoma_codec"/>" into the file; save and quit
By default G729 is the only codec registered with FreeSWITCH. If you require additional codecs please go to the FreeSWITCH Codec Configuration page
After the above configuration file has been created, it must be edited in order to specify:
a. the location of the Sngtc server on the network from this particular sngtc client in order to send transcoding session requests
b. the return location of the transcoded session(s) from the remote transcoder hardware--> vi /usr/local/freeswitch/conf/autoload_configs/sangoma_codec.conf.xml
add the following lines:
--> soapserver= <LAN IP of machine hosting sngtc_server>:<Port of machine hosting sngtc_server>
--> rtpip= <LAN IP of FreeSWITCH sngtc client>The PORT information for the sngtc server specified above must match the information you selected in /etc/sngtc/sngtc_server.conf for 'bindport" (on server hosting sngtc_server. If you also decided to specify a unique "bindaddr" in the same file, then you must match that IP address with the value for "soapserver" above
Start the Sngtc server on the box hosting the sngtc_server/D500, so that the sngtc server clients (this FreeSWITCH box) can interact with the transcoder hardware via the box with the sngtc_server
--> sngtc_server_ctrl start
If any changes are made to any of the above files, the sngtc server must be restarts:
--> sngtc_server_ctrl restart
FreeSWITCH Routing Configuration
For the purpose of the rest of the discussion, Host A will represent this FreeSWITCH server (sngtc client) and Host B will represent the server hosting the sngtc_server
When Host A requires a transcoding session from the remote transcoder accessible via Host B, it will require to know how to route to the transcoder (ex. 10.1.1.151) via Host B. Since the transcoder IP is unknown to Host A, a route must be added in the Host A's routing table to Host B. To add a route to the routing table in Host A, type the following in the Linux CLI:
-> route add -net 10.1.1.0 netmask 255.255.255.0 gw <LAN IP of Host B> dev <ethX> , where "ethX" represents the Ethernet device of Host A's main LAN
---> Multiple routes can be added in Host A if you have multiple connections to the network and want more than one access point for transcoding requests. Simply add a new route with the ethX of the next Ethernet interface to configure
---> Perform the above step for all Asterisk serversA route in Host B's routing table will NOT be required because when the returning transcoded RTP stream from the vocallo module cannot find its destination through Host B's routing table (i.e. rtpip=Host A) it will route to Host B's default gateway, which will know about Host A and send the stream back to Host A.
* If you are certain that your default gateway does not know about Host A, then you will require to add the route:
-> route add -net <first 3 octets of Host A. 0> netmask 255.255.255.0 gw <gateway> dev <ethX> ,where "ethX" represents the ethernet device of Host B's main LAN
-> Proceed to Operation