#include <sofia-sip/su_wait.h>
#include <sofia-sip/url.h>
#include <sofia-sip/sip.h>
#include <sofia-sip/nua_tag.h>
Include dependency graph for nua.h:

Defines | |
| #define | NUA_MAGIC_T |
| Defined when <sofia-sip/nua.h> has been included. | |
| #define | NUA_VERSION |
| NUA API version. | |
| #define | nua_handle_home(nh) |
| Cast a nua_handle_t pointer to a su_home_t. | |
Typedefs | |
| typedef NUA_MAGIC_T | nua_magic_t |
| Application context for NUA agent. | |
| typedef NUA_HMAGIC_T | nua_hmagic_t |
| Application context for NUA handle. | |
| typedef enum nua_nw_detector_e | nua_nw_detector_t |
| Network change event levels given to NUTAG_DETECT_NETWORK_UPDATES(). | |
| typedef enum nua_event_e | nua_event_t |
| Events. | |
| typedef void(* | nua_callback_f )(nua_event_t event, int status, char const *phrase, nua_t *nua, nua_magic_t *magic, nua_handle_t *nh, nua_hmagic_t *hmagic, sip_t const *sip, tagi_t tags[]) |
| Typedef of NUA event callback. | |
| typedef NUA_SAVED_EVENT_T | nua_saved_event_t |
| Abstract type for saved nua events. | |
Enumerations | |
| enum | nua_nw_detector_e |
| Network change event levels given to NUTAG_DETECT_NETWORK_UPDATES(). More... | |
| enum | nua_event_e { , nua_i_error, nua_i_invite, nua_i_cancel, nua_i_ack, nua_i_fork, nua_i_active, nua_i_terminated, nua_i_state, nua_i_outbound, nua_i_bye, nua_i_options, nua_i_refer, nua_i_publish, nua_i_prack, nua_i_info, nua_i_update, nua_i_message, nua_i_chat, nua_i_subscribe, nua_i_subscription, nua_i_notify, nua_i_method, nua_i_media_error, nua_r_set_params, nua_r_get_params, nua_r_shutdown, nua_r_notifier, nua_r_terminate, nua_r_authorize, nua_r_register, nua_r_unregister, nua_r_invite, nua_r_cancel, nua_r_bye, nua_r_options, nua_r_refer, nua_r_publish, nua_r_unpublish, nua_r_info, nua_r_prack, nua_r_update, nua_r_message, nua_r_chat, nua_r_subscribe, nua_r_unsubscribe, nua_r_notify, nua_r_method, nua_r_authenticate , nua_i_network_changed, nua_i_register } |
| Events. More... | |
Functions | |
| nua_t * | nua_create (su_root_t *root, nua_callback_f callback, nua_magic_t *magic, tag_type_t tag, tag_value_t value,...) |
| Create a NUA agent. | |
| void | nua_shutdown (nua_t *nua) |
| Shutdown NUA stack. | |
| void | nua_destroy (nua_t *nua) |
| Destroy the NUA stack. | |
| nua_magic_t * | nua_magic (nua_t *nua) |
| Fetch callback context from nua. | |
| void | nua_set_params (nua_t *, tag_type_t, tag_value_t,...) |
| Set NUA parameters. | |
| void | nua_get_params (nua_t *nua, tag_type_t, tag_value_t,...) |
| Get NUA parameters. | |
| nua_handle_t * | nua_default (nua_t *nua) |
| Obtain default operation handle of the NUA stack object. | |
| nua_handle_t * | nua_handle (nua_t *nua, nua_hmagic_t *hmagic, tag_type_t, tag_value_t,...) |
| Create an operation handle. | |
| void | nua_handle_destroy (nua_handle_t *h) |
| Destroy a handle. | |
| nua_handle_t * | nua_handle_ref (nua_handle_t *) |
| Make a new reference to handle. | |
| int | nua_handle_unref (nua_handle_t *) |
| Destroy reference to handle. | |
| void | nua_handle_bind (nua_handle_t *nh, nua_hmagic_t *magic) |
| Bind a callback context to an operation handle. | |
| nua_hmagic_t * | nua_handle_magic (nua_handle_t *nh) |
| Fetch a callback context from an operation handle. | |
| void | nua_set_hparams (nua_handle_t *, tag_type_t, tag_value_t,...) |
| Set handle parameters. | |
| void | nua_get_hparams (nua_handle_t *, tag_type_t, tag_value_t,...) |
| Get handle parameters. | |
| int | nua_handle_has_invite (nua_handle_t const *nh) |
| Check if operation handle is used for INVITE. | |
| int | nua_handle_has_subscribe (nua_handle_t const *nh) |
| Check if operation handle has been used with outgoing SUBSCRIBE of REFER request. | |
| int | nua_handle_has_register (nua_handle_t const *nh) |
| Check if operation handle has been used with nua_register() or nua_unregister(). | |
| int | nua_handle_has_active_call (nua_handle_t const *nh) |
| Check if operation handle has an active call. | |
| int | nua_handle_has_call_on_hold (nua_handle_t const *nh) |
| Check if operation handle has a call on hold. | |
| int | nua_handle_has_events (nua_handle_t const *nh) |
| Check if handle has active event subscriptions (refers sent). | |
| int | nua_handle_has_registrations (nua_handle_t const *nh) |
| Check if operation handle has active registrations. | |
| sip_to_t const * | nua_handle_remote (nua_handle_t const *nh) |
| Get the remote address (From/To header) of operation handle. | |
| sip_to_t const * | nua_handle_local (nua_handle_t const *nh) |
| Get the local address (From/To header) of operation handle. | |
| char const * | nua_event_name (nua_event_t event) |
| Get name for NUA event. | |
| char const * | nua_callstate_name (enum nua_callstate state) |
| Get name for NUA callstate. | |
| char const * | nua_substate_name (enum nua_substate substate) |
| Return name of subscription state. | |
| enum nua_substate | nua_substate_make (char const *sip_substate) |
| Convert string to enum nua_substate. | |
| void | nua_register (nua_handle_t *nh, tag_type_t, tag_value_t,...) |
| Send SIP REGISTER request to the registrar. | |
| void | nua_unregister (nua_handle_t *nh, tag_type_t, tag_value_t,...) |
| Unregister. | |
| void | nua_invite (nua_handle_t *nh, tag_type_t, tag_value_t,...) |
| Place a call using SIP INVITE method. | |
| void | nua_ack (nua_handle_t *nh, tag_type_t, tag_value_t,...) |
| Acknowledge a succesfull response to INVITE request. | |
| void | nua_prack (nua_handle_t *nh, tag_type_t, tag_value_t,...) |
| Acknowledge a reliable preliminary response to INVITE request. | |
| void | nua_options (nua_handle_t *nh, tag_type_t, tag_value_t,...) |
| Query capabilities from server. | |
| void | nua_publish (nua_handle_t *nh, tag_type_t, tag_value_t,...) |
| Send PUBLISH request to publication server. | |
| void | nua_unpublish (nua_handle_t *nh, tag_type_t, tag_value_t,...) |
| Send un-PUBLISH request to publication server. | |
| void | nua_message (nua_handle_t *nh, tag_type_t, tag_value_t,...) |
| Send an instant message. | |
| void | nua_chat (nua_handle_t *nh, tag_type_t, tag_value_t,...) |
| Send a chat message. | |
| void | nua_info (nua_handle_t *nh, tag_type_t, tag_value_t,...) |
| Send an INFO request. | |
| void | nua_subscribe (nua_handle_t *nh, tag_type_t, tag_value_t,...) |
| Subscribe a SIP event. | |
| void | nua_unsubscribe (nua_handle_t *, tag_type_t, tag_value_t,...) |
| Unsubscribe an event. | |
| void | nua_notify (nua_handle_t *, tag_type_t, tag_value_t,...) |
| Send a NOTIFY message. | |
| void | nua_notifier (nua_handle_t *, tag_type_t, tag_value_t,...) |
| Create an event server. | |
| void | nua_terminate (nua_handle_t *, tag_type_t, tag_value_t,...) |
| Terminate an event server. | |
| void | nua_refer (nua_handle_t *, tag_type_t, tag_value_t,...) |
| Transfer a call. | |
| void | nua_update (nua_handle_t *, tag_type_t, tag_value_t,...) |
| Update a call. | |
| void | nua_bye (nua_handle_t *, tag_type_t, tag_value_t,...) |
| Hangdown a call. | |
| void | nua_cancel (nua_handle_t *, tag_type_t, tag_value_t,...) |
| Cancel an INVITE operation. | |
| void | nua_authenticate (nua_handle_t *, tag_type_t, tag_value_t,...) |
| Authenticate an operation. | |
| void | nua_authorize (nua_handle_t *, tag_type_t, tag_value_t,...) |
| Authorize a subscriber. | |
| void | nua_method (nua_handle_t *, tag_type_t, tag_value_t,...) |
| Send a request message with an extension method. | |
| void | nua_respond (nua_handle_t *nh, int status, char const *phrase, tag_type_t, tag_value_t,...) |
| Respond to a request with given status code and phrase. | |
| int | nua_event_is_incoming_request (nua_event_t e) |
| Check if event can be responded with nua_respond(). | |
| char const * | nua_generate_instance_identifier (su_home_t *) |
| Generate an instance identifier. | |
| int | nua_save_event (nua_t *nua, nua_saved_event_t return_saved[1]) |
| Save last nua event. | |
| nua_event_data_t const * | nua_event_data (nua_saved_event_t const saved[1]) |
| Get information from saved event. | |
| void | nua_destroy_event (nua_saved_event_t *saved) |
| Destroy a save nua event. | |
| msg_t * | nua_saved_event_request (nua_saved_event_t const *saved) |
| Get request message from saved nua event. | |
| msg_t * | nua_current_request (nua_t const *nua) |
| Get current request message. | |
| sip_replaces_t * | nua_handle_make_replaces (nua_handle_t *nh, su_home_t *home, int early_only) |
| Generate a Replaces header for handle. | |
| nua_handle_t * | nua_handle_by_replaces (nua_t *nua, sip_replaces_t const *rp) |
| Obtain a new reference to an existing handle based on Replaces header. | |
| nua_handle_t * | nua_handle_by_call_id (nua_t *nua, const char *call_id) |
| Obtain a new reference to an existing handle based on Call-ID. | |
Variables | |
| char const | nua_version [] |
| NUA module version. | |
|
|
Network change event levels given to NUTAG_DETECT_NETWORK_UPDATES().
|
|
|
Events. The NUA event loop calls an event callback function when an application needs to act on something that happened in the Sofia stack. The callback function is registered when nua_create() function call is used to create the NUA stack object. The prototype of the event callback function is: void nua_callback_f(nua_event_t event, int status, char const *phrase, nua_t *nua, nua_magic_t *magic, nua_handle_t *nh, nua_hmagic_t *hmagic, sip_t const *sip, tagi_t tags[]);
The events can be divided into the following categories:
|
|
|
Network change event levels given to NUTAG_DETECT_NETWORK_UPDATES().
|
|
||||||||||||||||||||
|
Acknowledge a succesfull response to INVITE request. Acknowledge a successful response (200..299) to INVITE request with the SIP ACK request message. This function is needed only if NUTAG_AUTOACK() parameter has been cleared.
|
|
||||||||||||||||||||
|
Authenticate an operation.
|
|
||||||||||||||||||||
|
Authorize a subscriber. After creating a local presence server by nua_notifier(), an incoming SUBSCRIBE request causes nua_i_subscription event. Each subscriber is identified with NEATAG_SUB() tag in the nua_i_subscription event. Application can either authorize the subscriber with NUTAG_SUBSTATE(nua_substate_active) or terminate the subscription with NUTAG_SUBSTATE(nua_substate_terminated).
|
|
||||||||||||||||||||
|
Hangdown a call. Hangdown a call using SIP BYE method. Also the media session associated with the call is terminated.
|
|
|
Get name for NUA callstate.
|
|
||||||||||||||||||||
|
Cancel an INVITE operation.
|
|
||||||||||||||||||||
|
Send a chat message. A chat channel can be established during call setup using "message" media. An active chat channel is indicated using nua_i_state event containing SOATAG_ACTIVE_CHAT() tag. Chat messages can be sent using this channel with nua_chat() function. Currently this is implemented using SIP MESSAGE requests but in future MSRP (message session protocol) will replace it.
|
|
||||||||||||||||||||||||||||
|
Create a NUA agent. This function creates a Sofia-SIP User Agent stack object (nua) and initializes its parameters by given tagged values.
|
|
|
Get current request message.
|
|
|
Obtain default operation handle of the NUA stack object. A default operation can be used for operations where the ultimate result is not important or can be discarded.
|
|
|
Destroy the NUA stack. Before calling nua_destroy() the application should call nua_shutdown and wait for successful nua_r_shutdown event. Shuts down and destroys the nua stack. Ongoing calls, registrations, and subscriptions are left as they are.
|
|
|
Get information from saved event.
|
|
|
Check if event can be responded with nua_respond(). Note that if event status is 200 or greater, it already has been responded. This function is provided for compatibility with future versions of nua. An unknown event can always be handled in the event callback like this: switch (event) { ... default: if (status < 200 && nua_event_is_incoming_request(event)) nua_respond(nh, SIP_501_NOT_IMPLEMENTED, NUTAG_WITH_THIS(nua), TAG_END()); if (hmagic == NULL) nua_handle_destroy(nh); return; ...
|
|
|
Get name for NUA event.
|
|
||||||||||||||||||||
|
Get handle parameters. Application will specify either expilicit list of tags it is interested in, or a filter (at the moment, TAG_ANY()). The values are returned as a list of tags in the nua_r_get_params event.
nua_get_hparams(nua_default(nua), TAG_ANY())
|
|
||||||||||||||||||||
|
Get NUA parameters. The values of NUA parameters is returned in nua_r_get_params event.
|
|
||||||||||||||||||||||||
|
Create an operation handle. Allocates a new operation handle and associated storage.
|
|
||||||||||||
|
Bind a callback context to an operation handle.
|
|
||||||||||||
|
Obtain a new reference to an existing handle based on Call-ID.
|
|
||||||||||||
|
Obtain a new reference to an existing handle based on Replaces header.
|
|
|
Destroy a handle. Terminate the protocol state associated with an operation handle. The stack discards resources and terminates the ongoing dialog usage, sessions and transactions associated with this handle. For example, calls are terminated with BYE request. Also, the reference count for the handle is also decremented. The handles use reference counting for memory management. In order to make it more convenient for programmer, nua_handle_destroy() decreases the reference count, too.
|
|
|
Check if operation handle has an active call.
|
|
|
Check if operation handle has a call on hold. Please note that this status is not affected by remote end putting this end on hold. Remote end can put each media separately on hold and status is reflected on SOATAG_ACTIVE_AUDIO(), SOATAG_ACTIVE_VIDEO() and SOATAG_ACTIVE_CHAT() tag values in nua_i_state event.
|
|
|
Check if handle has active event subscriptions (refers sent). Active subscription can be established either by nua_subscribe() or nua_refer() calls.
|
|
|
Check if operation handle is used for INVITE. Check if operation handle has been used with either outgoing or incoming INVITE request.
|
|
|
Check if operation handle has been used with nua_register() or nua_unregister().
|
|
|
Check if operation handle has active registrations. A registration is active when either when a REGISTER operation is going on or when it has successfully completed so that nua stack is expected to refresh the registration in the future. Normally, a handle has active registration after nua_register() until nua_unregister() completes, unless the initial nua_register() had either expiration time of 0 or it had SIPTAG_CONTACT(NULL) as an argument.
|
|
|
Check if operation handle has been used with outgoing SUBSCRIBE of REFER request.
|
|
|
Get the local address (From/To header) of operation handle. Local address is used as From header in outgoing operations and derived from To: header in incoming operations.
|
|
|
Fetch a callback context from an operation handle.
|
|
||||||||||||||||
|
Generate a Replaces header for handle. A Replaces header contains the Call-ID value, From and To tags corresponding to SIP dialog associated with handle nh. Note that the Replaces matches with dialog of the remote peer, nua_handle_by_replaces() does not return same handle (unless you swap rp_from_tag and rp_to_tag in Replaces header). A Replaces header is used in attended transfer, among other things.
|
|
|
Make a new reference to handle. The handles use reference counting for memory management. In addition to the memory management, there is protocol state associated with the handles. The protocol state is terminated with nua_handle_destroy(). In order to make it more convenient for programmer, nua_handle_destroy() decreases the reference count, too.
|
|
|
Get the remote address (From/To header) of operation handle. Remote address is used as To header in outgoing operations and derived from From: header in incoming operations.
|
|
|
Destroy reference to handle. The handles use reference counting for memory management. In addition to the memory management, there is protocol state associated with the handles. The protocol state is terminated with nua_handle_destroy(). In order to make it more convenient for programmer, nua_handle_destroy() decreases the reference count, too.
|
|
||||||||||||||||||||
|
Send an INFO request. INFO is used to send call related information like DTMF digit input events. See RFC 2976.
|
|
||||||||||||||||||||
|
Place a call using SIP INVITE method. The INVITE method is used to initiate a call between two parties. The call is also known as SIP session. At SIP level the session is represented as Dialog, which is a peer-to-peer association between two SIP User-Agents. The dialog is established by a successful 2XX response to the INVITE. The dialog is terminated by BYE transaction, which application can initiate with nua_bye() call. An early dialog is established by an preliminary response (101..199), such as 180 Ringing. An early dialog is terminated with an error response with response code in range 300...699. The media session belonging to the SIP session is usually represented by SDP, Session Description Protocol. The media session it is usually established during the call set-up with procedure known as SDP Offer/Answer exchange, defined by RFC 3264. See Media Session Handling below for details.
Optionally
|
|
|
Fetch callback context from nua.
|
|
||||||||||||||||||||
|
Send an instant message. Send an instant message using SIP MESSAGE method.
|
|
||||||||||||||||||||
|
Create an event server. This function create an event server taking care of sending NOTIFY requests and responding to further SUBSCRIBE requests. The event server can accept multiple subscriptions from several sources and takes care for distributing the notifications. Unlike other functions this call only accepts the SIP tags listed below.
|
|
||||||||||||||||||||
|
Send a NOTIFY message. This function is used when the application implements itself the notifier. The application must provide valid Subscription-State and Event headers using SIP tags. The subscription state can be modified with NUTAG_SUBSTATE(), however, its effect is overriden by Subscription-State header included in the nua_notify() tags.
Please note that including NUTAG_NEWSUB(1) in nua_notify() tags if there is a valid subscription may lead to an extra NOTIFY sent to subscriber if the subscription had been terminated by the subscriber or by a timeout before the nua_notify() is processed.
|
|
||||||||||||||||||||
|
Query capabilities from server.
|
|
||||||||||||||||||||
|
Acknowledge a reliable preliminary response to INVITE request. PRACK is used to acknowledge receipt of 100rel responses. See RFC 3262.
|
|
||||||||||||||||||||
|
Send PUBLISH request to publication server. Request status will be delivered to the application using nua_r_publish event. When successful the publication will be updated periodically until nua_unpublish() is called or handle is destroyed. Note that the periodic updates and unpublish do not include the original message body nor the Content-Type header. Instead, the periodic update will include the SIP-If-Match header, which was generated from the latest SIP-ETag header received in response to PUBLISH request. The handle used for publication cannot be used for any other purposes.
|
|
||||||||||||||||||||
|
Transfer a call. Send a REFER request asking the recipient to transfer the call. The REFER request also establishes an implied subscription to the "refer" event. The "refer" event can have an "id" parameter, which has the value of CSeq number in the REFER request. After initiating the REFER request, the nua engine sends application a nua_r_refer event with status 100 and tag NUTAG_REFER_EVENT() containing a matching event header with id parameter. Note that the Event header in the locally generated nua_r_refer event contains the id parameter. The id parameter contains the CSeq number of the REFER request, and it may get incremented if the request is retried because it got challenged or redirected. In that case, the application gets a new nua_r_refer event with status 100 and tag NUTAG_REFER_EVENT(). Also the recipient of the REFER request may or may not include the id parameter with the Event header in the NOTIFY requests messages which it sends to the sender of the REFER request. Therefore the application is not able to modify the state of the implied subscription before receiving the first NOTIFY request.
|
|
||||||||||||||||||||
|
Send SIP REGISTER request to the registrar. Request status will be delivered to the application using nua_r_register event. When successful the registration will be updated periodically. The handle used for registration cannot be used for any other purposes.
Note that nua may append a identifier of its own to the Contact URI username. Such nua-generated identifier trailer always starts with "=" (equal sign), rest of the nua-generated identifier may contain any url-unreserved characters except "=". Likewise, nua may add transport parameters (such as "transport=tcp" or "maddr") to the Contact URI. It can add addtional header parameters, like "+sip.instance" or "reg-id", too. For instance, if application uses tags like nua_register(nh, NUTAG_M_DISPLAY("1"), NUTAG_M_USERNAME("line-1"), NUTAG_M_PARAMS("user=phone"), NUTAG_M_FEATURES("audio"), NUTAG_CALLEE_CAPS(0), TAG_END()) Contact: 1 <sip:line-1=SSQAIbjv@192.168.1.200;transport=tcp;user=phone>
;audio;reg-id=1
;+sip.instance=urn:uuid:97701ad9-39df-1229-1083-dbc0a85f029c
The incoming request from the proxy should contain the registered contact URI as the request URI. The application can use the username prefix set by NUTAG_M_USERNAME() and the non-transport parameters of the request URI set by NUTAG_M_PARAMS() when determining to which registration the incoming request belongs. For example, a request line correspoding to the Contact in above example may look like: INVITE sip:line-1=SSQAIbjv@192.168.1.200;user=phone SIP/2.0
Please note that an ALG (application-level gateway) modifying the Via headers in outbound requests and again in incoming responses will make the above-described NAT check to fail. The response to the initial REGISTER should also include option tags indicating whether registrar supports various SIP extension options: outbound, pref, path, gruu. Basically, outbound means that instead of registering its contact URI with a particular address-of-record URI, the user-agent registers a transport-level connection. Such a connection is identified on the Contact header field with an instance identifier, application-provided unique string identifying the user-agent instance and a stack-generated numeric index identifying the transport-level connection. If the outbound extension is supported, NUTAG_OUTBOUND() contains option string "outbound" and the application has provided an instance identifer to the stack with NUTAG_INSTANCE(), the nua_register() will try to use outbound. If outbound is not supported, nua_register() has to generate a URI that can be used to reach it from outside. It will check for public transport addresses detected by underlying stack with, e.g., STUN, UPnP or SOCKS. If there are public addresses, nua_register() will use them. If there is no public address, it will try to generate a Contact URI from the "received" and "rport" parameters found in the Via header of the response message.
The nua_r_register message will include the contact header and route used in with the registration.
You can disable validation by inserting "no-validate" into NUTAG_OUTBOUND() string. The keepalive mechanism depends on the network features detected earlier. If outbound extension is used, the STUN keepalives will be used. Otherwise, NUA stack will repeatedly send OPTIONS requests to itself. In order to save bandwidth, it will include Max-Forwards: 0 in the keep-alive requests, however. The keepalive interval is determined by NUTAG_KEEPALIVE() parameter. If the interval is 0, no keepalive messages is sent. You can disable keepalive OPTIONS by inserting "no-options-keepalive" into NUTAG_OUTBOUND() string. Currently there are no other keepalive mechanisms available. The value of NUTAG_KEEPALIVE_STREAM(), if specified, is used to indicate the desired transport-layer keepalive interval for stream-based transports like TLS and TCP. As alternative to OPTIONS/STUN keepalives, the client can propose a more frequent registration refresh interval with NUTAG_M_FEATURES() (e.g. NUTAG_M_FEATURES("expires=120") given as parameter to nua_register()).
|
|
||||||||||||||||||||||||||||
|
Respond to a request with given status code and phrase. The stack returns a SIP response message with given status code and phrase to the client. The tagged parameter list can specify extra headers to include with the response message and other stack parameters. The SIP session or other protocol state associated with the handle is updated accordingly (for instance, if an initial INVITE is responded with 200, a SIP session is established.) When responding to an incoming INVITE request, the nua_respond() can be called without NUTAG_WITH() (or NUTAG_WITH_CURRENT() or NUTAG_WITH_SAVED()). Otherwise, NUTAG_WITH() will contain an indication of the request being responded.
When the request event is delivered to the application, the application should examine the status parameter. The status parameter is 200 or greater if the request has been already responded automatically by the stack. The application can add methods that it likes to handle by itself with NUTAG_APPL_METHOD(). The default set of NUTAG_APPL_METHOD() includes INVITE, PUBLISH, REGISTER and SUBSCRIBE. Note that unless the method is also included in the set of allowed methods with NUTAG_ALLOW(), the stack will respond to the incoming methods with 405 Not Allowed. In order to simplify the simple applications, most requests are responded automatically. The BYE and CANCEL requests are always responded by the stack. Likewise, the NOTIFY requests associated with an event subscription are responded by the stack. Note that certain methods are rejected outside a SIP session (created with INVITE transaction). They include BYE, UPDATE, PRACK and INFO. Also the auxiliary methods ACK and CANCEL are rejected by the stack if there is no ongoing INVITE transaction corresponding to them.
|
|
||||||||||||
|
Save last nua event.
|
|
|
Get request message from saved nua event.
|
|
||||||||||||||||||||
|
||||||||||||||||||||
|
Set NUA parameters.
nua_set_params(nua, SIPTAG_USER_AGENT_STR("tester/1.0"), SIPTAG_ALLOW_STR("INVITE,CANCEL,BYE,ACK"), SIPTAG_ORGANIZATION(NULL), SIPTAG_USER_AGENT(NULL), SIPTAG_ALLOW(SIP_NONE), TAG_END()); nua_set_params(nua, SIPTAG_ORGANIZATION_STR("Malevolent Microwavers"), SIPTAG_ALLOW_STR("OPTIONS"), SIPTAG_ALLOW(SIP_NONE), SIPTAG_ORGANIZATION_STR("The Phone Company"), SIPTAG_ALLOW_STR("SUBSCRIBE"), SIPTAG_ALLOW(NULL), SIPTAG_ORGANIZATION_STR(NULL), TAG_END()); SUBSCRIBE and the header Organization will have value The Phone Company. |
|
||||||||||||||||||||
|
Subscribe a SIP event. Subscribe a SIP event using the SIP SUBSCRIBE request. If the SUBSCRBE is successful a subscription state is established and the subscription is refreshed regularly. The refresh requests will generate nua_r_subscribe events.
|
|
|
Convert string to enum nua_substate.
|
|
|
Return name of subscription state.
|
|
||||||||||||||||||||
|
Terminate an event server. Terminate an event server with matching event and content type. The event server was created earlier with nua_notifier() function.
|
|
||||||||||||||||||||
|
Send un-PUBLISH request to publication server. Un-PUBLISH request is just a PUBLISH request with Expires set to 0. It is possible to un-publish a publication not associated with the handle by providing correct ETag in SIPTAG_IF_MATCH() or SIPTAG_IF_MATCH_STR() tags. Response to the un-PUBLISH request will be delivered to the application using nua_r_unpublish event. The handle used for publication cannot be used for any other purposes.
|
|
||||||||||||||||||||
|
Unregister. Send a REGISTER request with expiration time 0. This removes the registration from the registrar. If the handle was earlier used with nua_register() the periodic updates will be terminated. If a SIPTAG_CONTACT_STR() with argument "*" is used, all the registrations will be removed from the registrar otherwise only the contact address belonging to the NUA stack is removed.
|
|
||||||||||||||||||||
|
Unsubscribe an event. Unsubscribe an active or pending subscription with SUBSCRIBE request containing Expires: header with value 0. The dialog associated with subscription will be destroyed if there is no other subscriptions or call using this dialog.
|
|
||||||||||||||||||||
|
Update a call. Update a session using SIP UPDATE method. See RFC 3311. Update method can be used when the session has been established with INVITE. It's mainly used during the session establishment when preconditions are used (RFC 3312). It can be also used during the call if no user input is needed for offer/answer negotiation.
|