Skip to main content

mod_dptools: event


Event application can be used to fire aribtrary events.


Event Event-Name=$event_name[,Event-Subclass=$event_subclass][,header=value,header=value]

This application may be run inline from the XML dialplan.


by Pawel Pierscionek

<action application="event" data="Event-Subclass=myevent::notify,Event-Name=CUSTOM,key1=value1,key2=value2"/>

I find it useful in driving inbound event socket finite state machines that do not subscribe to CHANNEL_EXECUTE* events yet need signals when some actions of inline dialplans are completed. Eg: fire a custom notification that a file has been played and the channel is now waiting for more instructions while the customer listens to MOH.

<extension name="ACDIntro">
<condition field="destination_number" expression="^queue_beta$">
<action application="set" data="acd_line_ext=150"/>
<action application="answer" />
<action application="playback" data="intro.wav" />
<action application="event" data=",Event-Name=CUSTOM,state=Intro,condition=IntroPlayed"/>
<action application="playback" data="local_stream://moh" />

This is how such an event appears on the wire:

Core-UUID: 1ebe7b98-1533-11de-a612-0b68f08ca0e3
Event-Name: CUSTOM
state: Intro
condition: IntroPlayed

If you wish to schedule an event to be triggered from a dialplan, you can use the following approach:

<action application="set" data="api_result=${sched_api(+5 ${uuid} uuid_broadcast ${uuid} event::Event-Subclass=myevent-notify,Event-Name=CUSTOM)}"/>

See Also