Monday, March 30, 2009

AMR with Yate

To install amr codec with yate:
  • Download amr (nb + wb) from the web
  • compile and install amr codec
./configure
make
make install
./configure --prefix=/ --with-amrnb=/usr/local
make
make install
  • Add /usr/local/lib to /etc/ld.so.conf
  • run command 
ldconfig

Thursday, September 25, 2008

Install sysstat on CentOS

Install sysstat

yum -y install sysstat

Data will be in '/var/log/sa'. Performance will be kept for 1 week old. Viewing data by using:

sar

or download kSar which is java program that display data in graphical format.

Setting CPU affinity for process

Using taskset command

taskset -cp cpu_list process_id

example

taskset -cp 1,2,3 3215

Wednesday, August 27, 2008

E1 Tapping with Sangoma card

Need to do E1 tapping to capture voice data and found that E1 card from Sangoma has "High Impedance" mode which can be used to tap E1 data. However, this will require 2 E1 for tapping, one to tap on Rx and another one to tap Tx.

Development for proof of concept shows that captures voice from E1 channel is working. Voice stream from Sangoma E1 card is 8 bytes for each channel and concatenate for each channel to combine into 1 packet. For example, if span has 15 channels, the voice stream will be 15 bytes per block:

CH1CH2CH3CH4CH5...CH15

And we set MTU to 1200, there will be 80 block of 15 bytes in one packet. Therefore, application must extract correct data for the channel from voice stream. Voice stream is in a-law or u-law depends on configuration.

In order to minimize span setting, use the following format for each E1:

1-15.17-31

which mean, this span contains channel 1-15 and 17-31.

Asterisk CAS connection with Ericsson MD110

Just have project to connect Asterisk with Ericsson MD110 using E1 line side. In order to make correct connection, DAHDI (zaptel) needs a patch for CAS signal bit. MD110 E1 line side can be configured to multiple type such as: Mobility Server, Voice Mail System, Multiplexer 2 Mb/s RSM standard or P7 signaling.

From MD110 manual, we can see signaling bit pattern of Multiplexer 2 Mb/s P7 signaling as following:
On Asterisk, we have set signaling in zaptel.config to "fxsks". But bit patterns of "fxsks" doesn't match with setting on MD110. Therefore, I need to change bit pattern for "fxsks" to match MD110.

CAS bit pattern are defined in zaptel-base.c in function zt_rbs_sethook(). In this function, there is array "outs[NUM_SIGS][5]" that define bit pattern for each signaling. Original bit pattern for "fxsks" is:

ZT_SIG_FXSKS, 
ZT_BBIT | ZT_DBIT, 
ZT_ABIT | ZT_BBIT | ZT_CBIT | ZT_DBIT,
ZT_ABIT | ZT_BBIT | ZT_CBIT | ZT_DBIT,
0

The first line is signaling name. The second is bit pattern for idle or onhook state which is 0101. The third is bit pattern for offhook state which is 1111. So I just change bit pattern to:

ZT_SIG_FXSKS, 
ZT_ABIT | ZT_DBIT, 
ZT_DBIT,
ZT_DBIT,
0

Now bit pattern for onhook will be 1001 and offhook will be 0001. Recompile zaptel and now Asterisk connection with MD110 works OK.

When calling from MD110 to Asterisk and the caller hangup, bit pattern from MD110 is changed to idle (1001) but Asterisk doesn't hang up E1 channel. Asterisk will release E1 channel when its extension hangs up only. This need to do more checking.

Sunday, August 24, 2008

Q.Sig Path Replacement between Asterisk and Ericsson

Try to setting up E1 connection between Asterisk and Ericsson MD110, the connection was OK using Q.Sig but requirement to call transfer back and forth between 2 systems without holding E1 channel if both caller and calling are on the same system. This feature is called "Path Replacement" or "Route Optimization". Seems this possible by setting as following:

Asterisk:
1. use latest version of libpri 
2. set DAHDI (or zaptel) signaling to 'qsig' or 'pri_cpe'
3. set 2 parameters in zapata.conf
facilityenable=yes
transfer=yes
4. use Transfer command to transfer the call back to Ericsson

Ericsson:
1. enable "Route Optimization" by using command

ASPAC:PARNUM=66,PARVAL=1  // enable route optimization
ASPAC:PARNUM=66,PARVAL=0 // disable route optimization

At the time of this post, no actual test has been done. I will update the test result if this setting is actually work.

I found 2 references that good for reading:

Zaptel compile error

Zaptel compile error on CentOS 5.1 and the error was in 'kernel/xpp/xdef.h:117'. This error is about redefined of type 'bool'. To fix this error, apply the patch from http://bugs.digium.com/view.php?id=12889