Hello
Due to the default nature of Asterisk call forwarding which does not suit my needs (anyone can forward any phone without any authentication) I have written my own macro which works very well in simplifying the whole process. However it does not check to see if the remote end has any forwards which may cause a loop if it’s set to forward back to itself.
I can’t get this to work. Can anyone point me in the right direction for this?
This is my macro for a immediate forward:
;sets a immediate forward
[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($[${toext:0:1} = 9]?external:internal)
exten => s,n(internal),Set(DB(CF/${AMPUSER})=${toext})
exten => s,n,Playback(auth-thankyou&goodbye)
exten => s,n,Macro(hangupcall,)
exten => s,n(external),Set(DB(CF/${AMPUSER})=77${toext})
exten => s,n,Playback(auth-thankyou&goodbye)
exten => s,n,Macro(hangupcall,)
As it stands just now it will loop for a second then ring out to the original extensions VM but I would prefer the forward attempt to fail in the firsplace due to a loop condition.
I’m using FreePBX 2.11.0.11 (1.89.210.57-2 ) Asterisk 1.8
Thanks