import "zapISipUAStack.idl";
Implemented by component '@mozilla.org/zap/sipstack;1'.
The User Agent SIP stack is the primary entry-point into the ZAP SIP module module. In conjunction with a user application component implementing zapISipRequestHandler, it constitutes the UAC and UAS components described in RFC3261.
For most of the time the User Agent stack handles all interfacing to the lower SIP protocol layers. It manages dialogs, provides stateful request servers/clients with automatic ACK/response retransmission logic and automatically handles certain error conditions (e.g. malformed requests, misdirected messages, concurrent invites).
The user application handles calls through zapISipRequestHandler callback interfaces. These can be set on either the zapISipUAStack or on individual zapISipDialogs. Some requests (e.g. OPTIONS) can sensibly be handled by the UA stack itself. See zapISipUAStack::requestHandler for more information about the routing of requests.
The user application initiates new calls through stateful 'request clients' obtained by calling zapISipUAStack::createNonInviteRequestClient(), zapISipUAStack::createInviteRequestClient(), zapISipUAStack::createSubscribeRequestClient(), zapISipDialog::createNonInviteRequestClient() and zapISipDialog::createInviteRequestClient().
Public Member Functions | |
| void | init (in zapISipRequestHandler handler, in nsIPropertyBag2 stackConfiguration) |
| Initialize this SIP stack with the given request handler and configuration parameters. | |
| void | shutdown () |
| Shutdown the stack, releasing all network sockets. | |
| zapISipNonInviteRC | createNonInviteRequestClient (in zapISipAddress ToAddress, in zapISipAddress FromAddress, in ACString method,[array, size_is(count)] in zapISipAddress routeset, in unsigned long count, in unsigned long rcFlags) |
| Obtain a generic request client object for transactionally sending a NON-INVITE request to ToAddress outside of a dialog. | |
| zapISipNonInviteRC | createRegisterRequestClient (in zapISipURI domain, in zapISipURI addressOfRecord, in zapISipAddress contactAddress,[array, size_is(count)] in zapISipAddress routeset, in unsigned long count, in unsigned long rcFlags) |
| Obtain a request client object for transactionally sending a REGISTER request. | |
| zapISipInviteRC | createInviteRequestClient (in zapISipAddress ToAddress, in zapISipAddress FromAddress, in zapISipAddress contactAddress,[array, size_is(count)] in zapISipAddress routeset, in unsigned long count, in unsigned long rcFlags) |
| Obtain a request client object for transactionally sending an INVITE request to ToAddress outside of a dialog. | |
| zapISipSubscribeRC | createSubscribeRequestClient (in zapISipAddress ToAddress, in zapISipAddress FromAddress, in zapISipAddress contactAddress, in ACString eventType,[array, size_is(count)] in zapISipAddress routeset, in unsigned long count, in unsigned long rcFlags) |
| Obtain a request client object for transactionally sending a SUBSCRIBE request (RFC3265) to ToAddress outside of a dialog. | |
| zapISipResponse | formulateResponse (in ACString statusCode, in zapISipRequest request, in ACString toTag) |
| Formulate a method-agnostic response with the given status code for the given request. | |
| void | appendAllowHeaders (in zapISipMessage message) |
| Append Allow headers to the given message, using the method list passed in the configuration parameters to this stack (see init()). | |
Public Attributes | |
| attribute zapISipRequestHandler | requestHandler |
| Remote requests received by the stack will be routed as follows:. | |
| readonly attribute zapISipTransactionManager | transactionManager |
| readonly attribute zapISipTransport | transport |
| readonly attribute zapISipSyntaxFactory | syntaxFactory |
| readonly attribute zapISipResolver | resolver |
| readonly attribute zapISipAuthentication | authentication |
| readonly attribute ACString | hostName |
| readonly attribute ACString | hostAddress |
| readonly attribute unsigned short | listeningPort |
| readonly attribute ACString | instanceID |
| The instance id of this UA as defined in draft-ietf-sip-gruu-05.txt. | |
| readonly attribute AUTF8String | userAgent |
| The value that will be put into User-Agent headers of outgoing requests If this is equal to the empty string no User-Agent header will be added. | |
| attribute boolean | shortBranchParameters |
| By default, zap uses UUIDs (RFC4122) in transaction branch parameters to guarantee uniqueness across space and time as required by RFC3261. | |
Request client flag constants for createNonInviteRequestClient(), | |
createInviteRequestClient() and createRegisterRequestClient() | |
| const unsigned long | ELIDE_DESTINATION_ROUTE_HEADER = 0x0001 |
|
|
Append Allow headers to the given message, using the method list passed in the configuration parameters to this stack (see init()).
|
|
||||||||||||||||||||||||||||
|
Obtain a request client object for transactionally sending an INVITE request to ToAddress outside of a dialog. The zapISipInviteRC::request attribute will be initialized as for createNonInviteRequestClient(), and, in addition, a Contact header set to the given Contact address will be added. |
|
||||||||||||||||||||||||||||
|
Obtain a generic request client object for transactionally sending a NON-INVITE request to ToAddress outside of a dialog. The zapISipNonInviteRC::request attribute will be initialized as follows (RFC3261 8.1.1):
|
|
||||||||||||||||||||||||||||
|
Obtain a request client object for transactionally sending a REGISTER request. The zapISipNonInviteRC::request attribute will be initialized as for createNonInviteRequestClient(), with the following exceptions:
|
|
||||||||||||||||||||||||||||||||
|
Obtain a request client object for transactionally sending a SUBSCRIBE request (RFC3265) to ToAddress outside of a dialog. The zapISipSubscribeRC::request attribute will be initialized as for createInviteRequestClient(), and, in addition, an Event header set to the given eventType will be added. |
|
||||||||||||||||
|
Formulate a method-agnostic response with the given status code for the given request. For transactional requests, clients should generally not call this method, but instead call formulateResponse() on the request server (zapISipNonInviteRS or zapISipInviteRS), as this will formulate the response in a way appropriate to the given request. Responses are constructed as follows (following RFC3261):
If the request does not contain a To tag, SC!=100 and 'toTag'==null, a new tag will be created and set on the To header. If 'toTag'!=null it will be set on the To header. The request must not already contain a tag or an error will be thrown. For SC==405: Allow headers will be added with appendAllowHeaders() For SC==2XX: Supported headers will be added for all option tags specified in the 'extensions' parameter passed to init(). |
|
||||||||||||
|
Initialize this SIP stack with the given request handler and configuration parameters. Valid configuration parameters:
|
|
|
Shutdown the stack, releasing all network sockets. It is the user application's responsibility to terminate any dialogs or ongoing transactions before shutting down the stack. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The instance id of this UA as defined in draft-ietf-sip-gruu-05.txt. This will be set to the value of the 'instance_id' parameter handed to the UAStack in init(). |
|
|
|
|
|
Remote requests received by the stack will be routed as follows:.
For in-dialog requests matching an active dialog, the default BYE handler will generate 200 (OK) and terminate the dialog. For BYE requests without a To tag, a 481 response will be generated. (RFC3261 15.1.2). The default OPTIONS handler returns 200 (OK) with Allowed headers constructed by appendAllowHeaders(). The default CANCEL handler returns 481 (Transaction Does Not Exist) if there is no matching transaction, or 200 (OK) otherwise. In addition, if a matching INVITE server transaction is found for which no final response has been sent yet, and this transaction is owned by a zapISipInviteRS, the transaction will be cancelled by sending a 487 (Request Terminated), and the associated zapISipInviteRSListener will be informed of the cancellation with a call to zapISipInviteRSListener::notifyCancelled(). |
|
|
|
|
|
By default, zap uses UUIDs (RFC4122) in transaction branch parameters to guarantee uniqueness across space and time as required by RFC3261. The resulting branch parameters are 39 characters long, which some endpoints have trouble processing. If this is set to 'true', zap will use 32bit branch parameters instead. Can also be set from init() in the 'short_branch_parameters' parameter. |
|
|
|
|
|
|
|
|
|
|
|
The value that will be put into User-Agent headers of outgoing requests If this is equal to the empty string no User-Agent header will be added. Will be set to the value of the 'user_agent' parameter handed to the UAStack in init(). |
1.4.4