SipProvider implements the SIP transport layer, that is the layer responsable for sending and receiving SIP messages. Messages are received by the callback function defined in the interface SipProviderListener.
SipProvider implements also multiplexing/demultiplexing service through the use of SIP interface identifiers and onReceivedMessage() callback function of specific SipProviderListener.
A SipProviderListener can be added to a SipProvider through the addSipProviderListener(id,listener) method, where: - id is the SIP interface identifier the listener has to be bound to, - listener is the SipProviderListener that received messages are passed to.
The SIP interface identifier specifies the type of messages the listener is going to receive for. Together with the specific SipProvider, it represents the complete SIP Service Access Point (SAP) address/identifier used for demultiplexing SIP messages at receiving side.
The identifier can be of one of the three following types: transaction_id, dialog_id, or method_id. These types of identifiers characterize respectively:
- messages within a specific transaction,
- messages within a specific dialog,
- messages related to a specific SIP method. It is also possible to use the the identifier ANY to specify
- all messages that are out of any transactions, dialogs, or already specified method types.
When receiving a message, the SipProvider first tries to look for a matching transaction, then looks for a matching dialog, then for a matching method type, and finally for a default listener (i.e. that with identifier ANY). For the matched SipProviderListener, the method onReceivedMessage() is fired.
Note: no 482 (Loop Detected) responses are generated for requests that does not properly match any ongoing transactions, dialogs, nor method types.