AGI: stream file or exec background

Hi,

Calling Background() in the dialplan allows for jumping to an extension of any length.
eg.:

exten => s,n,Background(HELLO)
exten => s,n,WaitExten(,)

exten => 9,1,NoOp(Pressed 9)

Instead of

exten => 9

it could have been

exten => 91
[...]
exten => 92
[...]
exten => _XXXX
[...]
and so on.

I’m trying to do the same with AGI.
I think the only option I have is to either use “STREAM FILE $file $keys” where $keys is a set of 1-digit keys the user can press to interrupt file streaming or EXEC BACKGROUND $file.

What are my best options?

vinayak-workstation*CLI> agi show commands topic GET DATA

-= Info about agi ‘GET DATA’ =-

[Syntax]
get data [] []

[Description]
Stream the given , and receive DTMF data.
Returns the digits received from the channel at the other end.

[Synopsis]
Prompts for DTMF on a channel

[Runs Dead]
No

[See Also]
AGI()

Background is not a normal application. It actually only reads one digit, then returns to the dialplan interpreter in a way that causes the dialplan interpreter to read the rest of the number, basically as though this were a new incoming call.

If used from AGI, it goes into a special mode in which it still only reads one digit but passes that back in a different way.

You are not going to be able to get a complete match for the dialplan behaviour of these applications where AGI is preventing the dialplan actually regaining control. Alternative ways of handling multi-digit input in AGI were discussed here less than about a month ago.

Thanks to both of you, especially to Vinayak for the straight answer. “GET DATA” works for me and acts much like Background() – at least from an end-user point of view.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.