Archives 2018

Debugging A Call In FreePBX / Asterisk

The purpose of this article is to explain how to track down what happened to a call in Asterisk.

Suppose you want a call trace from a specific call that has already happened, so it’s too late to see it in the console live. First locate the call in the CDR, and get the uniquieid from the system column for the call in question:

Login to the Asterisk/FreePBX Server and grep the Asterisk full logs for that value:

[root@34693894 ~]# grep 1518526777.67 /var/log/asterisk/full*
/var/log/asterisk/full-20180214:[2018-02-13 08:59:37] VERBOSE[24184][C-00000001] pbx.c: Executing [s@macro-user-callerid:1] Set("SIP/5002-00000001", "TOUCH_MONITOR=1518526777.67") in new stack
/var/log/asterisk/full-20180214:[2018-02-13 08:59:37] VERBOSE[24184][C-00000001] pbx.c: Executing [700@from-internal:37] QueueLog("SIP/5002-00000001", "700,1518526777.67,NONE,DID,") in new stack

This will return a few lines, which will include the Asterisk CALL-ID (not to be confused with CallerID), the second number in the square brackets. It will also return a file name, as full logs are rotated daily and purged weekly. Perform a second grep on the CALL-ID and filename like:

[root@34693894 ~]# grep C-00000001 /var/log/asterisk/full-20180214
[2018-02-13 08:59:37] VERBOSE[29432][C-00000001] netsock2.c: Using SIP RTP TOS bits 184
[2018-02-13 08:59:37] VERBOSE[29432][C-00000001] netsock2.c: Using SIP RTP CoS mark 5
[2018-02-13 08:59:37] VERBOSE[24184][C-00000001] pbx.c: Executing [700@from-internal:1] Macro("SIP/5002-00000001", "user-callerid,") in new stack
[2018-02-13 08:59:37] VERBOSE[24184][C-00000001] pbx.c: Executing [s@macro-user-callerid:1] Set("SIP/5002-00000001", "TOUCH_MONITOR=1518526777.67") in new stack
[2018-02-13 08:59:37] VERBOSE[24184][C-00000001] pbx.c: Executing [s@macro-user-callerid:2] Set("SIP/5002-00000001", "AMPUSER=5002") in new stack
[2018-02-13 08:59:37] VERBOSE[24184][C-00000001] pbx.c: Executing [s@macro-user-callerid:3] GotoIf("SIP/5002-00000001", "0?report") in new stack

References:

https://wiki.freepbx.org/display/SUP/Providing+Great+Debug

Enabling G.729 Codec in FreeSWITCH

This tutorial has been created to go over whats needed to configure the non-licensed version of the g729 codec.  This codec would normally cost a license fee, but recently the patent expired, which allows the codec to be used without paying a license fee.

Adding the needed repository:

The repository below is for Centos 7 64 bits:

rpm -ivh http://repo.okay.com.mx/centos/7/x86_64/release/okay-release-1-1.noarch.rpm

Installing g729 codec:

yum install freeswitch-codec-bcg729

Please edit the following config files:

In /etc/freeswitch/autoload_config/modules.conf.xml please replace mod_g729 with mod_bcg729
vim /etc/freeswitch/autoload_config/modules.conf.xml

The file should like the following when complete – Notice the third load module statement.  It now contains the license free mod_bcg729 module versus the mod_g729 module.

In /etc/freeswitch/vars.xml please replace mod_g729 with mod_bcg729.

vim /etc/freeswitch/vars.xml

Within the same config file edit the following line following line to ensure g729 is a preferred codec along with any other codec you have installed.

If the install has been done correctly you should be able to use g729 codec without an issue.