[asterisk-users] Send event from dialplan

Richard Lyman pchammer at dynx.net
Wed Nov 22 10:59:09 MST 2006


Gregory Duchatelet wrote:
>
> Hi all,
>
> Another question for today, hope an answer for this one…
>
> I have a program talking with asterisk via the AMI. I receive events, 
> and I would like to insert some events in the dialplan, which could be 
> catch by my program.
>
> Any idea how to do this ?
>
> Greg
>
this easiest way is to use UserEvent below is an example

exten => 
8,n,UserEvent(${IF(${ISNULL(${AGENTNUM})}?Queue:Schedule)}${ISTRANSFER}|CallerIDName: 
${CALLERIDNAME})

the above from a dialplan would show up on the AMI as events that look like
(in this example AGENTNUM and ISTRANSFER are empty)

Event: Newexten
Privilege: call,all
Channel: Zap/17-1
Context: gdincoming
Extension: talk
Priority: 4
Application: UserEvent
AppData: Queue|CallerIDName: ~315CLD02-6945-true~
Uniqueid: 1156985743.5540

Event: UserEventQueue
Privilege: user,all
Channel: Zap/17-1
Uniqueid: 1156985743.5540
CallerIDName: ~315CLD02-6945-true~


side note: if you use ael then you will need to add a space after the | 
otherwise it will fail
example

Playback(pls-hold-while-try);
UserEvent(Queue${ISTRANSFER}| CallerIDName: ${CALLERID(name)});
^^^ note the space in here


goodluck



More information about the asterisk-users mailing list