For internal use only.
Each handle has a queue of client-side requests; if a request is pending, a new request from API is added to the queue. After the request is complete, it is removed from the queue and destroyed by the default. The exception is the client requests bound to a dialog usage: they are saved and re-used when the dialog usage is refreshed (and sometimes when the usage is terminated).
The client request is subclassed and its behaviour modified using virtual function table in nua_client_methods_t.
The first three methods (crm_template(), crm_init(), crm_send()) are called when the request is sent first time.
The crm_template() is called if a template request message is needed (for example, in case of unregister, unsubscribe and unpublish, the template message is taken from the request establishing the usage).
The crm_init() is called when the template message and dialog leg has been created and populated by the tags procided by the application. Its parameters msg and sip are pointer to the template request message that is saved in the nua_client_request::cr_msg field.
The crm_send() is called with a copy of the template message that has been populated with all the fields included in the request, including and . The crm_send() function, such as nua_publish_client_request(), usually calls nua_base_client_trequest() that then creates the nta-level transaction.
The response to the request is processed by crm_check_restart(), which modifies and restarts the request when needed (e.g., when negotiating expiration time). After the request has been suitably modified, e.g., the expiration time has been increased, the restart function calls nua_client_restart(), which restarts the request and relays the intermediate response to the application with nua_client_restart() and crm_report().
The final responses are processed by crm_recv() and and preliminary ones by crm_preliminary(). All virtual functions should call nua_base_client_response() beside method-specific processing.
The nua_base_client_response() relays the response to the application with nua_client_restart() and crm_report().
|char const *||cr_method_name|
|nua_client_methods_t const *||cr_methods|
|char const *||cr_phrase|
|tagi_t const *||cr_tags|