Hello
Not sure if this is the correct forum, if not, please move
I have the below script that I use for immediate call forwarding. I also use A2billing with CallerID authentication for outgoing calls. A issue has just arisen where someone has forwarded their phone to an outside number. The call fails at the A2billing stage due to a CallerID that is not in the table. I have worked round this by adding a route that looks for numbers starting with 77 to bypass A2billing.
My question is - Is it possible to modify the below code so if someone enters an external number (beginning with 9) that it automatically adds 77 to the beginning. However if they enter a 4 digit internal number which in my case can begin with 3, 4, 5 or 7 then it does not add the leading 77. The leading 77 would only be added if the number they enter begins with 9
eg - if they enter 90536849564 the system saves it as 7790536849564
[custom-cf-on]
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Playback(call-fwd-unconditional)
exten => s,n(startread),Playback(ent-target-attendant)
exten => s,n,Read(toext,then-press-hash,)
exten => s,n,GotoIf($[“foo${toext}”=“foo”]?startread)
exten => s,n,Wait(1)
exten => s,n,Set(DB(CF/${AMPUSER})=${toext})
exten => s,n,Playback(call-fwd-unconditional)
exten => s,n,Playback(is-set-to)
exten => s,n,SayDigits(${toext})
exten => s,n,Macro(hangupcall,)
Thanks