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.