;--------------------------------------------------------------------------------------------------------------------------------
;Change Forward-To Number for Customer/Programmable Call Forwarding Busy Line (*40)
;Access Code followed by directory number is used to change the forwarded-to number for Call Forwarding Busy Line (CFBL). The state
;of CFBL is not changed when this access code is used. This feature will utilize the activation code of *90 and deactivation code *91
;with the following exceptions:activation will not require/allow the identification of a forwarded-to directory number and deactivation
;will not clear the forwarded-to directory number.
;--------------------------------------------------------------------------------------------------------------------------------
[app-cpcfb]
exten = *40,1,Answer
exten = *40,n,Wait(1)
exten = *40,n,Playback(cust-pro-call-fwd-busy)
exten = *40,n,Playback(please-enter-your&extension)
exten = *40,n,Read(fromext,then-press-pound)
exten = *40,n,Set(fromext=$/{IF($["foo${fromext}"="foo"]?${CALLERID(number)}:${fromext})})
exten = *40,n,Wait(1)
exten = *40,n(startread),Playback(ent-target-attendant)
exten = *40,n,Read(toext,then-press-pound)
exten = *40,n,GotoIf($["foo${toext}"="foo"]?startread)
exten = *40,n,Wait(1)
exten = *40,n,Set(DB(CFB/${fromext})=${toext})
exten = *40,n,Playback(call-fwd-busy&for&extension)
exten = *40,n,SayDigits(${fromext})
exten = *40,n,Playback(is-set-to)
exten = *40,n,SayDigits(${toext})
exten = *40,n,Macro(hangupcall)