Sending events
You can send events into the FreeSWITCH core via mod_event_socket
over the same TCP connection you receive events over (the connection is bi-directional). All commands are formatted with a command name and arguments. Some commands require additional fields after the command itself. The formatting for additional fields when you send events is similar to the format you use when you receive events. You send FreeSWITCH a list of key/value pairs specifying the event name and specific flags related to the event, and FreeSWITCH injects the message into the event subsystem for modules or the FreeSWITCH core to handle.
An example of a basic command is as follows:
api sleep 5000
This would run the API command sleep
and pass it the argument 5000
, causing the system to sleep for five seconds.
A more complicated example might be injecting messages directly into the FreeSWITCH event queue system. You can inject events into the FreeSWITCH system with the
sendevent
command, followed by associated...