Events from the Dialplan
mod_event_socket
provides a Dialplan application named socket
that allows for outbound TCP connections to be made to an IP and port, where the other end can stream commands for execution back to FreeSWITCH. This is similar to the network-based fast-AGI (FAGI) of Asterisk, but it can operate in full asynchronous mode, allowing commands to be issued and control to be returned immediately in anticipation of additional events or responses.
When you call outbound socket
, FreeSWITCH automatically puts the call in park. You can watch calls go into the parked state by watching the event stack for the CHANNEL_PARK
event.
The syntax for calling socket
from the Dialplan is:
<ip>:<port> [<keywords>]
The following are examples of how to use it in the Dialplan:
<action application="socket" data="127.0.0.1:8084"/> <action application="socket" data="127.0.0.1:8084 async"/> <action application="socket" data="127.0.0.1:8084 full"/> <action application...