nua_client_methods_t Struct Reference

#include <nua_dialog.h>


Detailed Description

Methods for client request.


Data Fields

size_t crm_extra
 Size of private data.
int(* crm_template )(nua_client_request_t *cr, msg_t **return_msg, tagi_t const *tags)
 Generate a request message.
int(* crm_init )(nua_client_request_t *, msg_t *msg, sip_t *sip, tagi_t const *tags)
 crm_init is called when a client request is sent first time.
int(* crm_send )(nua_client_request_t *, msg_t *msg, sip_t *sip, tagi_t const *tags)
 crm_send is called each time when a client request is sent.
int(* crm_check_restart )(nua_client_request_t *, int status, char const *phrase, sip_t const *sip)
 crm_check_restart is called each time when a response is received.
int(* crm_recv )(nua_client_request_t *, int status, char const *phrase, sip_t const *sip)
 crm_recv is called each time a final response is received.
int(* crm_preliminary )(nua_client_request_t *, int status, char const *phrase, sip_t const *sip)
 crm_preliminary is called each time a preliminary response is received.
int(* crm_report )(nua_client_request_t *, int status, char const *phrase, sip_t const *sip, nta_outgoing_t *orq, tagi_t const *tags)
 crm_report is called each time a response is received and it is reported to the application.
int(* crm_deinit )(nua_client_request_t *)
 crm_deinit is called when a client-side request is destroyed.


Field Documentation

int(* crm_template)(nua_client_request_t *cr, msg_t **return_msg, tagi_t const *tags)

Generate a request message.

Return values:
1 when request message has been created
0 when request message should be created in normal fashion
-1 upon an error

int(* crm_init)(nua_client_request_t *, msg_t *msg, sip_t *sip, tagi_t const *tags)

crm_init is called when a client request is sent first time.

Return values:
1 when request has been responded
0 when request should be sent in normal fashion
-1 upon an error

int(* crm_send)(nua_client_request_t *, msg_t *msg, sip_t *sip, tagi_t const *tags)

crm_send is called each time when a client request is sent.

Return values:
1 when request has been responded
0 when request has been sent
-1 upon an error (request message has not been destroyed)
-2 upon an error (request message has been destroyed)

int(* crm_check_restart)(nua_client_request_t *, int status, char const *phrase, sip_t const *sip)

crm_check_restart is called each time when a response is received.

It is used to restart reqquest after responses with method-specific status code or method-specific way of restarting the request.

Return values:
1 when request has been restarted
0 when response should be processed normally

int(* crm_recv)(nua_client_request_t *, int status, char const *phrase, sip_t const *sip)

crm_recv is called each time a final response is received.

A final response is in range 200 .. 699 (or internal response) and it cannot be restarted.

crm_recv() should call nua_base_client_response() or nua_base_client_tresponse(). The return values below are documented with nua_base_client_response(), too.

Return values:
0 if response was preliminary
1 if response was final
2 if response destroyed the handle, too.

int(* crm_preliminary)(nua_client_request_t *, int status, char const *phrase, sip_t const *sip)

crm_preliminary is called each time a preliminary response is received.

A preliminary response is in range 101 .. 199.

crm_preliminary() should call nua_base_client_response() or nua_base_client_tresponse().

Return values:
0 if response was preliminary
1 if response was final
2 if response destroyed the handle, too.

int(* crm_report)(nua_client_request_t *, int status, char const *phrase, sip_t const *sip, nta_outgoing_t *orq, tagi_t const *tags)

crm_report is called each time a response is received and it is reported to the application.

The status and phrase may be different from the status and phrase received from the network, e.g., when the request is restarted.

Returns:
The return value should be 0. It is currently ignored.

int(* crm_deinit)(nua_client_request_t *)

crm_deinit is called when a client-side request is destroyed.

Returns:
The return value should be 0. It is currently ignored.


Sofia-SIP 1.12.6work - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.