7572 External callback fix
split sub [sub-sip{x}-ccbs-external]
(was under [sip{x}-direct] before fix)
with external call back enabled
[sub-sip0-ccbs-external]
exten => s,1,NoOp()
exten => s,n,Set(header=${PJSIP_HEADER(read,Alert-Info,1)})
exten => s,n,GotoIf($["${header}" = "<http://www.uktel.org.uk/SIPAlertInfoExtns?RC03>"]?ringback:noringback)
exten => s,n(ringback),Set(CALLERID(name)=RINGBACK)
exten => s,n(noringback),NoOp()
exten => s,n,Return()
with external call back disabled
[sub-sip0-ccbs-external]
exten => s,1,NoOp()
exten => s,n,Return()
Insert external call back checker (GoSub(sub-sip0-ccbs-external,s,1)) in [call_line]
[call_line]
; Incoming calls will end up in this context when a local line should be dialled
exten => 204,1,GoSub(sub-call_filter0-incoming,s,1)
exten => 204,n,Set(__TRANSFER_CONTEXT=${CHANNEL(endpoint)}-transfer)
exten => 204,n,GotoIf($[["${CALLERID(NUM):0:3}" = "+44"] & ["${CALLERID(NUM):0:1}" = "+"]]?rewrite:norewrite)
exten => 204,n(rewrite),Set(CALLERID(num)=0${CALLERID(num):3})
exten => 204,n(norewrite),NoOp()
exten => 204,n,GotoIf($[$["${CALLERID(NUM):0:1}"] = "+"]?write:ignore)
exten => 204,n(write),Set(CALLERID(num)=00${CALLERID(num):1})
exten => 204,n(ignore),NoOp()
exten => 204,n,GoSub(sub-sip0-ccbs-external,s,1)
exten => 204,n,GotoIf(${DB_EXISTS(CFBS/sip0)}?cfbs)
exten => 204,n,Dial(TELCHAN\/0&&TELCHAN\/1&&TELCHAN\/2,,tF(hangup,h,2))
exten => 204,n,Goto(204,nocfbs)
exten => 204,n(cfbs),Dial(TELCHAN\/0&&TELCHAN\/1&&TELCHAN\/2,20,tF(hangup,h,2))
exten => 204,n(nocfbs),NoOp()
exten => 204,n,GotoIf($["${DIALSTATUS}"="ANSWER"]?endcall)
exten => 204,n,GotoIf($["${DIALSTATUS}"="BUSY"]?noanswer)
exten => 204,n,GotoIf($["${DIALSTATUS}"="NOANSWER"]?noanswer:endcall)
exten => 204,n(noanswer),GoSub(sub-callhandler-noanswer,s,1(${CHANNEL(endpoint)}))
exten => 204,n(endcall),Hangup()
For valid external call back enable config:
asterisk.set1.ccbs_enable='1'
asterisk.set1.internal_service='0'
Edited by Wenpeng Song