I have tested it by changing settings of chan_dahdi.conf.
[trunkgroups]
[channels]
context=default
usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
canpark=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
relaxdtmf=yes
rxgain=0.0
txgain=0.0
signalling=fxs_ks
group=1
callgroup=1
pickupgroup=1
immediate=no
callerid=asreceived
cidsignalling=dtmf
cidstart=polarity
answeronpolarityswitch=yes
useincomingcalleridondahditransfer = yes
hanguponpolarityswitch=yes
busydetect=yes
busycount=3
;callprogress=yes
sendcalleridafter=2
;Sangoma AFT-A200 [slot:2 bus:1 span:1]
context=from-internal
group=1
echocancel=yes
signalling = fxo_ks
channel => 1
context=from-internal
group=1
echocancel=yes
signalling = fxo_ks
channel => 2
context=from-zaptel
group=0
callerid=asreceived
echocancel=yes
signalling = fxs_ks
channel => 3
context=from-zaptel
callerid=asreceived
group=0
echocancel=yes
signalling = fxs_ks
channel => 4
If callprogress=yes disposition is still answered otherwise busy(billsec=0).
Console output is :
testCLI>
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [0XXXXXXXXXX@from-internal:1] ResetCDR(“SIP/101-00000007”, “”) in new stack
– Executing [0XXXXXXXXXX@from-internal:2] Dial(“SIP/101-00000007”, “dahdi/g0/0XXXXXXXXXX,30000,gtTCcHh”) in new stack
– Called dahdi/g0/0XXXXXXXXXX
– DAHDI/3-1 is busy
– Hanging up on ‘DAHDI/3-1’
– Hungup ‘DAHDI/3-1’
== Everyone is busy/congested at this time (1:1/0/0)
– Executing [0XXXXXXXXXX@from-internal:3] Verbose(“SIP/101-00000007”, “Dial Status : BUSY”) in new stack
Dial Status : BUSY
– Executing [0XXXXXXXXXX@from-internal:4] Goto(“SIP/101-00000007”, “s-BUSY,1”) in new stack
– Goto (from-internal,s-BUSY,1)
– Executing [s-BUSY@from-internal:1] NoOp(“SIP/101-00000007”, “busy”) in new stack
– Executing [s-BUSY@from-internal:2] Hangup(“SIP/101-00000007”, “”) in new stack
== Spawn extension (from-internal, s-BUSY, 2) exited non-zero on ‘SIP/101-00000007’
– Executing [h@from-internal:1] Verbose(“SIP/101-00000007”, “”) in new stack
– Executing [h@from-internal:2] Verbose(“SIP/101-00000007”, “”) in new stack
– Executing [h@from-internal:3] Hangup(“SIP/101-00000007”, “”) in new stack
== Spawn extension (from-internal, h, 3) exited non-zero on 'SIP/101-00000007’
testCLI>
and debug log
[Sep 14 14:13:43] DEBUG[14361] sig_analog.c: analog_exception 3
[Sep 14 14:13:43] DEBUG[14361] sig_analog.c: Exception on 21, channel 3
[Sep 14 14:13:43] DEBUG[14361] sig_analog.c: __analog_handle_event 3
[Sep 14 14:13:43] DEBUG[14361] sig_analog.c: Got event ANALOG_EVENT_HOOKCOMPLETE(9) on channel 3 (index 0)
[Sep 14 14:13:43] DEBUG[14361] chan_dahdi.c: Channel 3: Sending ‘T0XXXXXXXXXXw’ to DAHDI_DIAL.
[Sep 14 14:13:43] DEBUG[14361] sig_analog.c: Sent deferred digit string on channel 3: T0XXXXXXXXXXw
[Sep 14 14:13:46] DEBUG[14311] manager.c: Running action ‘Command’
[Sep 14 14:13:46] DEBUG[14311] manager.c: Running action ‘Command’
[Sep 14 14:13:46] DEBUG[14311] manager.c: Running action ‘Command’
[Sep 14 14:13:46] DEBUG[14311] manager.c: Running action ‘MailboxStatus’
[Sep 14 14:13:46] DEBUG[14361] sig_analog.c: analog_exception 3
[Sep 14 14:13:46] DEBUG[14361] sig_analog.c: Exception on 21, channel 3
[Sep 14 14:13:46] DEBUG[14361] sig_analog.c: __analog_handle_event 3
[Sep 14 14:13:46] DEBUG[14361] sig_analog.c: Got event ANALOG_EVENT_DIALCOMPLETE(6) on channel 3 (index 0)
[Sep 14 14:13:46] DEBUG[14361] chan_dahdi.c: Enabled echo cancellation on channel 3
[Sep 14 14:13:46] DEBUG[14361] res_rtp_asterisk.c: Setting the marker bit due to a source update
[Sep 14 14:13:46] DEBUG[14361] res_rtp_asterisk.c: Ooh, format changed from unknown to ulaw
[Sep 14 14:13:46] DEBUG[14361] res_rtp_asterisk.c: Created smoother: format: ulaw ms: 20 len: 160
[Sep 14 14:13:46] DEBUG[14361] res_rtp_asterisk.c: Starting RTCP transmission on RTP instance ‘0x8e6d6d0’
[Sep 14 14:13:46] DEBUG[14361] res_rtp_asterisk.c: Setting the marker bit due to a source update
[Sep 14 14:13:46] DEBUG[14311] manager.c: Running action ‘MailboxCount’
[Sep 14 14:13:46] DEBUG[14361] res_rtp_asterisk.c: Setting the marker bit due to a source update
[Sep 14 14:13:46] DEBUG[14361] res_rtp_asterisk.c: Setting the marker bit due to a source update
.
.
.
.
[Sep 14 11:50:37] DEBUG[13043] dsp.c: Requesting Hangup because the busy tone was detected on channel DAHDI/3-1
[Sep 14 11:50:37] DEBUG[13043] channel.c: Hanging up channel ‘DAHDI/3-1’
[Sep 14 11:50:37] DEBUG[13043] chan_dahdi.c: dahdi_hangup(DAHDI/3-1)
[Sep 14 11:50:37] DEBUG[13043] sig_analog.c: analog_hangup 3
[Sep 14 11:50:37] DEBUG[13043] sig_analog.c: Hangup: channel: 3 index = 0, normal = 1, callwait = 0, thirdcall = 0
[Sep 14 11:50:37] DEBUG[13043] chan_dahdi.c: Disabled echo cancellation on channel 3
[Sep 14 11:50:37] DEBUG[13043] chan_dahdi.c: Set option TONE VERIFY, mode: OFF(0) on DAHDI/3-1
[Sep 14 11:50:37] DEBUG[13043] chan_dahdi.c: Set option TDD MODE, value: OFF(0) on DAHDI/3-1
[Sep 14 11:50:37] DEBUG[13043] sig_analog.c: Updated conferencing on 3, with 0 conference users
[Sep 14 11:50:37] DEBUG[13043] app_dial.c: Exiting with DIALSTATUS=BUSY.
[Sep 14 11:50:37] DEBUG[13043] pbx.c: Result of ‘DIALSTATUS’ is ‘BUSY’
[Sep 14 11:50:37] DEBUG[13043] pbx.c: Launching ‘Verbose’
[Sep 14 11:50:37] DEBUG[13043] pbx.c: Result of ‘DIALSTATUS’ is ‘BUSY’
[Sep 14 11:50:37] DEBUG[13043] pbx.c: Launching ‘Goto’
[Sep 14 11:50:37] DEBUG[13043] pbx.c: Launching ‘NoOp’
[Sep 14 11:50:37] DEBUG[13043] pbx.c: Launching ‘Hangup’
[Sep 14 11:50:37] DEBUG[13043] pbx.c: Spawn extension (from-internal,s-BUSY,2) exited non-zero on ‘SIP/101-00000000’
[Sep 14 11:50:37] DEBUG[13043] channel.c: Soft-Hanging up channel ‘SIP/101-00000000’
[Sep 14 11:50:37] DEBUG[13043] pbx.c: Function result is ‘(null)’
[Sep 14 11:50:37] DEBUG[13043] pbx.c: Launching ‘Verbose’
[Sep 14 11:50:37] DEBUG[13043] pbx.c: Function result is ‘(null)’
[Sep 14 11:50:37] DEBUG[13043] pbx.c: Launching ‘Verbose’
[Sep 14 11:50:37] DEBUG[13043] pbx.c: Launching ‘Hangup’
[Sep 14 11:50:37] DEBUG[13043] pbx.c: Spawn extension (from-internal,h,3) exited non-zero on ‘SIP/101-00000000’
[Sep 14 11:50:37] DEBUG[13043] channel.c: Hanging up channel ‘SIP/101-00000000’
[Sep 14 11:50:37] DEBUG[13043] chan_sip.c: Hanging up zombie call. Be scared.
[Sep 14 11:50:37] DEBUG[13043] chan_sip.c: Updating call counter for incoming call
[Sep 14 11:50:37] DEBUG[13043] chan_sip.c: Hanging up channel in state Ring (not UP)
[Sep 14 11:50:37] DEBUG[13043] res_rtp_asterisk.c: Setting RTCP address on RTP instance ‘0x9557688’
[Sep 14 11:50:37] DEBUG[13043] chan_sip.c: AST hangup cause 16 (no match found in SIP)
[Sep 14 11:50:37] DEBUG[13043] chan_sip.c: Trying to put ‘SIP/2.0 603’ onto UDP socket destined for 192.168.5.15:46825
[Sep 14 11:50:37] DEBUG[13035] manager.c: Examining event:
please check analog exception 3 and AST hangup cause 16 (no match found in SIP) lines. Is this normal output?
I faced one more issue during testing when cidstart=polarity_IN incomming calls stop working.