Skip to content
Chad Engler edited this page Jul 20, 2019 · 14 revisions

Overview

Below is a comprehensive list of the events that the library can emit, along with parameters, and description.

Both the esl.Connection and esl.Server objects use EventEmitter2 to send namespaced events. For example every event raises the esl::event::EVENT_NAME::EVENT_UUID event, where EVENT_NAME is the name of the event and EVENT_UUID is the uuid of the event. Listening to esl::event::** will give you every event with any name with any uuid; whereas esl::event::MESSAGE::* will give you only each MESSAGE event, reguardless of uuid.

Note that two asterisks ('**') with match anything accross multiple delimiters ('::'); while one asterisk does not match accross delimiters. That is esl::** will match esl::connect, esl::event::EVENT_NAME, etc.; while esl::* will only match esl::connect, esl::ready, and esl::end.

All the events are listed in the form:

event_name(param1 {type1}, ..., paramN {typeN})

esl.Connection Events

  • error(err {Error})
    • An error has occurred, this is not namespaced to esl:: as to match node's error event system
  • esl::connect()
    • The connection has connected to FSW, but has not authenticated.
  • esl::ready()
    • The connection is ready; it is both connected and authenticated.
  • esl::end()
    • The connection to FreeSWITCH has closed
  • esl::**([evt {esl.Event}])
    • Will pick up any esl event emitted from the Library, including connect and other events with no parameters
  • esl::event::**(evt {esl.Event})
    • Called each time an event is picked up from FSW by the Client
  • esl::event::EVENT_NAME::*(evt {esl.Event})
    • Each event is emitted on this channel where EVENT_NAME is the Event's Event-Name header value
  • esl::event::EVENT_NAME::EVENT_UUID(evt {esl.Event})
    • Each event is emitted with a UUID, the EVENT_UUID is determined by first checking for a Job-UUID (background job uuid), then Unique-ID (channel uuid), and finally the Core-UUID (message's uuid). This to track a particular job, channel, or message stream.
  • esl::event::auth::*([evt {esl.Event}])
    • Picks up any auth event, whether it is request, success, or fail
  • esl::event::auth::request(evt {esl.Event})
    • FSW has requested authentication from the Library; The Library with auth for you.
  • esl::event::auth::success()
    • Authentication with FSW has passed; the readyCallback, if specified, is also called.
  • esl::event::auth::fail()
    • Authentication with FSW has failed
  • esl::event::command::reply(evt {esl.Event})
    • A reply to an issued command has come back
  • esl::event::api::response(evt {esl.Event})
    • A response to an issued api command has come back
  • esl::event::log::data(evt {esl.Event})
    • A log event from FSW
  • esl::event::disconnect::notice(evt {esl.Event})
    • FSW has notified the library it will be disconnected
  • esl::event::raw::*(evt {esl.Event})
    • Captures any raw event that had a Content-Type the Library did not parse
  • esl::event::raw::CONTENT_TYPE(evt {esl.Event})
    • Any Content-Type not parsed by the library is emmited on this channel, where CONTENT_TYPE is the Event's Content-Type header value

esl.Server Events

Here is the event list in the form of event_name(param1 {type1}, ..., paramN {typeN}):

  • connection::open(connection {esl.Connection})
    • FreeSWITCH has opened a connection to the server, however the connection object is not ready to be used yet
  • connection::ready(connection {esl.Connection})
    • A newly opened connection is now ready to be used
  • connection::close(connection {esl.Connection})
    • A connection has been closed
Clone this wiki locally