The Socket interface presented in this section abstracts JsSIP from the mechanism used to send and receive SIP traffic. JsSIP internal transport deals now with this interface and hence, it is not attached to the built-in WebSocket as a transport socket.
Implementations must follow the interface specificied here in order to get JsSIP working with the underlaying transport mechanism.
- Instance Attributes
- Instance Methods
- Event Handlers
String indicating the Via transport used in the Via Header field for outgoing Requests.
String identifying the socket URL. It is used for debugging purposes.
String indicating the connection endpoint SIP URI. Used in SIP Route header field.
Called by JsSIP when the socket availability for sending and receiving data is required.
The event handler
onconnect must be called as soon as the socket is ready or
ondisconnect if the socket fails to connect or is not usable.
Called by JsSIP when the socket is no longer needed for now.
Event handlers called after this call will be ignored.
Called by JsSIP when the given data needs to be sent.
true if the data was successfully sent.
Stringrepresentation of the data to be sent.
Must be called when the socket becomes usable for sending and receiving data after
connect was called or an unsolicited disconnection occured.
ondisconnect(error, code, reason)
Must be called when the socket becomes unusable for sending or receiving data.
Booleanindicating whether the socket disconnected due to an error
Numberindicating the socket disconnection code.
Stringindicating the socket disconnection reason.
Must be called when there is a full SIP message to be processed by JsSIP.
Binaryrepresentation of the data.