[asterisk-users] Can AGI do this?

Octavio Ruiz (Ta^3) tacvbo at tacvbo.net
Tue Nov 14 17:57:29 MST 2006


Bret Schuhmacher, who happens to be smarter than you, thinks:
> Please pardon the absolute noob questions.  Someone has asked me to 
> interface with Asterisk and have it dial 4 numbers in succession

I dont understand this: 

> to have 
> it track down an on-call person.

> If not, is it possible to write an AGI program that gets all 4 numbers, 
> then somehow hands them one-by-one to Asterisk?  If so, how does 
> Asterisk manage the communication of "failed to complete the call" with 
> the AGI app?  Does the AGI just monitor stdin looking for status 
> messages and returns the next number?
> 
> If Asterisk/AGI can do both, is the first method better than the 
> second?  It certainly seems easier.

The AGI script can die when it finished they job, probably I'm
missunderstanding what you want but maybe this examples helps:

exten => 123,1,Answer
exten => 123,n,AGI(somescript)
exten => 123,n,Dial(${TRUNK}/${FOURDIGITNUMBER})
exten => 123,n,Hangup

somescript: just sends AGI command SETVAR FOURDIGITNUMBER 2468

[context]
exten => s,1,Answer
exten => s,n... (set timeouts, et all).
exten => s,n,Background(audio)
exten => s,n,WaitExten

exten => _XXXX,1,Dial(${EXTEN})

exten => t,..
exten => h,...

-- 
Onward through the fog.


More information about the asterisk-users mailing list