We have an AGI program that generates a CallerID screen for display on our Cisco phones. Inbound calls from the PSTN are sent to a ring group but we need the CallerID screen to be displayed on all phones so that anyone can pick up the call.
I’m struggling to work out the right location for the AGI program’s execution. Right now it’s located in the [from-zaptel] context in extensions_additional.conf (obviously the wrong place because I have to remember to add it again every time I make a change).
[from-zaptel]
include => from-zaptel-custom
exten => _X.,1,Set(DID=${EXTEN})
exten => _X.,n,Goto(s,1)
exten => s,1,Noop(Entering from-zaptel with DID == ${DID})
exten => s,n,Ringing()
exten => s,n,Set(DID=${IF($["${DID}"= “”]?s:${DID})})
exten => s,n,Noop(DID is now ${DID})
exten => s,n,GotoIf($["${CHANNEL:0:3}"=“Zap”]?zapok:notzap)
exten => s,n(notzap),Goto(from-pstn,${DID},1)
exten => s,n,Macro(Hangupcall,dummy)
exten => s,n(zapok),Noop(Is a Zaptel Channel)
exten => s,n,Set(CHAN=${CHANNEL:4})
exten => s,n,Set(CHAN=${CUT(CHAN,-,1)})
exten => s,n,AGI(callerid.agi)
exten => s,n,Macro(from-zaptel-${CHAN},${DID},1)
exten => s,n,Noop(Returned from Macro from-zaptel-${CHAN})
exten => s,n,Goto(from-pstn,${DID},1)
exten => fax,1,Goto(ext-fax,in_fax,1)
; end of [from-zaptel]
Having looked at the recordingcheck AGI program and where it gets executed from within the dialplan it seems that my callerid.agi script is best defined as a macro. The problem is I can’t figure out with macros how to resume where I left i.e. execute the AGI program and then go to the next step in the dialplan.
I’d appreciate any suggestions for a suitable method for solving this problem.
Many thanks,
Kevin Clark
Connection Software