Readonly
customEvent emitter for custom events
this.custom.on('conference::maintenance', (data) => {
})
Readonly
logsEventEmitter for log events
You must use client.log()
beforehand to specify the log level.
Readonly
refUniquely identify each instance, for tracing purposes.
Statistics about this connection
Number of api responses
Number of authentication requests
Number of body parse errors
Number of command replies
Number of disconnect event received
Number of FreeSwitch events received
Number of log data events received
Number of missing Content-Type headers
Number of missing Event-Name headers
Number of unexpected non-empty buffer at end of processing.
Number of rude rejections (generally due to ACL access to the Event Socket)
Number of unflushed writes, indicating the network or FreeSwitch are not keeping up with our traffic
Number of unhandled events
Send an API command in the background. Await the command's result.
bgapi
will return an error if the job submission fails.
It will not return an error if the bakcground job itself failed.
The response from the background job will be stored in the .body.response
field of the return value.
The timeout
parameter should encompass job submission and the command completion.
This method is not expected to throw / return a rejected Promise.
Execute an application synchronously on a channel. Await the result.
Check the result's response
field to know the outcome of a command.
The first character indicates success (+
) or failure (-
).
If you would like an async version, use execute_uuid
.
This method is not expected to throw / return a rejected Promise.
Protected
connectSend out an event: all registered callbacks are notified.
Execute an application for the given UUID (channel). Does not await the result.
event-uuid
and event-uuid-name
are set as app_uuid
and app_uuid_name
in the channel, respectively.
If you would like to await the result, use command_uuid
.
This method is not expected to throw / return a rejected Promise.
Hangup the call referenced by the given UUID with an optional (FreeSwitch) cause code.
This method is not expected to throw / return a rejected Promise.
Enable logging on the socket, setting the log level.
client.log(7)
client.logs.on('log', (data) => { … })
This method is not expected to throw / return a rejected Promise.
Disable logging on the socket.
This method is not expected to throw / return a rejected Promise.
Register a new callback for the named event. The callback is called every time the event is emitted.
Register a new callback for the named event. The callback is only called the first time the event is emitted.
Returns a Promise that is resolved the next time the named event is emitted.
Unregister the callback from the named event.
Protected
sendA generic way of sending commands to FreeSwitch; waits for FreeSwitch's notification that the command completed.
This is a low-level method; in most cases one should use bgapi
, command_uuid
, etc
which provide higher-level APIs.
This method is not exposed by default; create a subclass of FreeSwitchClient in order to access it.
This method is not expected to throw / return a rejected Promise.
Send an event into the FreeSwitch event queue.
This method is not expected to throw / return a rejected Promise.
Send an event into the FreeSwitch event queue with a body.
This method is not expected to throw / return a rejected Promise.
Protected
sendmsg_Send a message to a given UUID (channel).
This is a low-level operation; in most cases execute_uuid
, command_uuid
etc
will provide a better API.
This method is not exposed by default; create a subclass of FreeSwitchClient in order to access it.
This method is not expected to throw / return a rejected Promise.
Forwards the media to and from a given socket.
This method is not expected to throw / return a rejected Promise.
FreeSwitchClient is the class you use to create a new client. It will automatically reconnect.