[Asterisk-Dev] AST_FLAG_DEFER_DTMF (would like dialogic-r4 like
semantics)
Tilghman Lesher
tilghman at mail.jeffandtilghman.com
Wed Nov 30 22:50:40 MST 2005
On Wednesday 30 November 2005 14:37, Steven Critchfield wrote:
> On Wed, 2005-11-30 at 14:27 -0500, Greg Lim wrote:
> > Could someone enlighten me on the use of this flag? It appears to
> > be only used in channel.c, and only for ast_read()...
> > The direction I'd like to go in is to create an AGI module that
> > will allow me to make use of Dialogic-R4-like semantics.
> > For example, there is no easy way in AGI currently to do this:
> >
> > 0. clear dtmf buffer
> > 1. play (menu1, interruptible)
> > 2. if (specialcustomer) play (menu2, interruptible)
> > 3. play (menu3, interruptible)
> > 4. collect dtmf digits
> > etc.
>
> This is already possible. What you may not realise is that any time
> you are playing an interuptable prompt, you need to check the exit
> status to see if digits where received.
<snip>
> Of course, it is much easier putting this logic into the dialplan
> itself as all the checking and collecting of digits is done there.
>
> I'll let someone else do the dialplan example(Tilghman, wanna show
> how it is done?). It will probably look much shorter than the above
> list.
His example is simply a number of Background's, with a single GosubIf:
exten => s,1,Background(menu1)
exten => s,n,GosubIf($[${CALLERID(num)} = 1234]?500)
exten => s,n,Background(menu3)
exten => s,n,WaitExten
exten => s,500,Background(menu2)
exten => s,n,Return
and then you collect the DTMF by defining a number of matchable
extensions:
exten => 1,1,DoOneThing
exten => _2XX,1,DoSomethingDifferent
exten => _3XXX,1,DoAThirdThing
exten => 411,1,Directory
exten => _4NX,1,DoSomethingElse
and we have an extension defined for people who dial DTMF that doesn't
match anything:
exten => i,1,Background(invalid)
exten => i,n,Goto(s,1)
This is a fairly simple IVR, and we haven't even gone into multiple
levels of IVR. However, this has strayed off-topic for this list, and
any further queries on how to do dialplan logic should be directed to
the -users list.
--
Tilghman
More information about the asterisk-dev
mailing list