Commit 4481b33c authored by Pekka Pessi's avatar Pekka Pessi

nua_session.c: made INFO a general-purpose method

Ignore-this: 641eaed9fc4d23eb0a1a15e3021cdf43

darcs-hash:20090708000000-db55f-6b2b9fd1c6f5e4b057b855c4454d658702e0ef0e.gz
parent 44915f6f
......@@ -696,7 +696,6 @@ nua_client_methods_t const nua_invite_client_methods = {
extern nua_client_methods_t const nua_bye_client_methods;
extern nua_client_methods_t const nua_cancel_client_methods;
extern nua_client_methods_t const nua_info_client_methods;
extern nua_client_methods_t const nua_update_client_methods;
extern nua_client_methods_t const nua_prack_client_methods;
......@@ -3080,14 +3079,6 @@ nh_referral_respond(nua_handle_t *nh, int status, char const *phrase)
* @sa #nua_i_info
*/
static int nua_info_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags);
static int nua_info_client_request(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags);
nua_client_methods_t const nua_info_client_methods = {
SIP_METHOD_INFO, /* crm_method, crm_method_name */
0, /* crm_extra */
......@@ -3097,8 +3088,8 @@ nua_client_methods_t const nua_info_client_methods = {
/* target refresh */ 0
},
NULL, /* crm_template */
nua_info_client_init, /* crm_init */
nua_info_client_request, /* crm_send */
NULL, /* crm_init */
NULL, /* crm_send */
NULL, /* crm_check_restart */
NULL, /* crm_recv */
NULL, /* crm_preliminary */
......@@ -3112,32 +3103,6 @@ nua_stack_info(nua_t *nua, nua_handle_t *nh, nua_event_t e, tagi_t const *tags)
return nua_client_create(nh, e, &nua_info_client_methods, tags);
}
static int nua_info_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags)
{
nua_handle_t *nh = cr->cr_owner;
nua_dialog_usage_t *du = nua_dialog_usage_for_session(nh->nh_ds);
nua_session_usage_t *ss = nua_dialog_usage_private(du);
if (!ss || ss->ss_state >= nua_callstate_terminating)
return nua_client_return(cr, 900, "Invalid handle for INFO", msg);
cr->cr_usage = du;
return 0;
}
static int nua_info_client_request(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags)
{
if (cr->cr_usage == NULL)
return nua_client_return(cr, SIP_481_NO_TRANSACTION, msg);
else
return nua_base_client_request(cr, msg, sip, tags);
}
/** @NUA_EVENT nua_r_info
*
* Response to an outgoing @b INFO request.
......@@ -3181,7 +3146,7 @@ nua_server_methods_t const nua_info_server_methods =
nua_i_info, /* Event */
{
0, /* Do not create dialog */
1, /* In-dialog request */
0, /* Allow outside dialog, too */
0, /* Not a target refresh request */
0, /* Do not add Contact */
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment