Commit c4800123 authored by Pekka Pessi's avatar Pekka Pessi

nua: moved active_call and hold_remote flags to nua handle structure.

Removed outdated nua_handle_has_streaming().

darcs-hash:20061004104437-65a35-5e70e3647da94ff42e3df490f312336959254e23.gz
parent 2af6ed36
......@@ -432,18 +432,12 @@ int nua_handle_has_subscribe(nua_handle_t const *nh)
*
* @par Events:
* none
*/
int nua_handle_has_register(nua_handle_t const *nh)
{
return nh ? nh->nh_has_register : 0;
}
int nua_handle_has_streaming(nua_handle_t const *nh)
{
return nh ? nh->nh_has_streaming : 0;
}
/** Check if operation handle has an active call
*
* @param nh Pointer to operation handle
......@@ -459,7 +453,7 @@ int nua_handle_has_streaming(nua_handle_t const *nh)
*/
int nua_handle_has_active_call(nua_handle_t const *nh)
{
return nh ? nh->nh_ss->ss_active : 0;
return nh ? nh->nh_active_call : 0;
}
/** Check if operation handle has a call on hold
......@@ -484,7 +478,7 @@ int nua_handle_has_active_call(nua_handle_t const *nh)
*/
int nua_handle_has_call_on_hold(nua_handle_t const *nh)
{
return nh ? nh->nh_ss->ss_hold_remote : 0;
return nh ? nh->nh_hold_remote : 0;
}
/** Get the remote address (From/To header) of operation handle
......
......@@ -2249,7 +2249,6 @@ void nsession_destroy(nua_handle_t *nh)
struct nua_session_state *ss = nh->nh_ss;
nta_incoming_t *irq = ss->ss_srequest->sr_irq;
ss->ss_active = 0;
ss->ss_state = nua_callstate_init;
/* Remove usage */
......@@ -2258,6 +2257,8 @@ void nsession_destroy(nua_handle_t *nh)
ss->ss_usage = 0;
nh->nh_has_invite = 0;
nh->nh_active_call = 0;
nh->nh_hold_remote = 0;
if (nh->nh_soa)
soa_destroy(nh->nh_soa), nh->nh_soa = NULL;
......@@ -2953,13 +2954,13 @@ static void signal_call_state_change(nua_handle_t *nh,
}
if (answer_recv || answer_sent) {
/* Update ss->ss_hold_remote */
/* Update nh_hold_remote */
char const *held;
soa_get_params(nh->nh_soa, SOATAG_HOLD_REF(held), TAG_END());
ss->ss_hold_remote = held && strlen(held) > 0;
nh->nh_hold_remote = held && strlen(held) > 0;
}
(void)sr;
......@@ -2971,9 +2972,9 @@ static void signal_call_state_change(nua_handle_t *nh,
ss->ss_state = nua_callstate_init, next_state = nua_callstate_terminated;
if (next_state == nua_callstate_ready)
ss->ss_active = 1;
nh->nh_active_call = 1;
else if (next_state == nua_callstate_terminated)
ss->ss_active = 0;
nh->nh_active_call = 0;
/* Send events */
if (phrase == NULL)
......
......@@ -819,7 +819,6 @@ int nua_stack_set_handle_special(nua_handle_t *nh,
case nh_has_subscribe: nh->nh_has_subscribe = 1; break;
case nh_has_notify: nh->nh_has_notify = 1; break;
case nh_has_register: nh->nh_has_register = 1; break;
case nh_has_streaming: nh->nh_has_streaming = 1; break;
case nh_has_nothing:
default:
break;
......
......@@ -121,10 +121,9 @@ struct nua_client_request
unsigned cr_answer_sent:1; /**< Sent answer in (PR)ACK */
};
/** Session-related state */
typedef struct nua_session_state
{
/** Session-related state */
unsigned ss_active:1; /**< Session is currently active. */
/* enum nua_callstate */
unsigned ss_state:4; /**< Session status (enum nua_callstate) */
......@@ -136,8 +135,6 @@ typedef struct nua_session_state
unsigned ss_precondition:1; /**< Precondition required */
unsigned ss_hold_remote:1; /**< We are holding remote */
unsigned ss_timer_set:1; /**< We have active session timer. */
unsigned : 0;
......@@ -224,12 +221,16 @@ struct nua_handle_s
unsigned nh_has_subscribe:1; /**< Has watcher */
unsigned nh_has_notify:1; /**< Has notifier */
unsigned nh_has_register:1; /**< Has registration */
unsigned nh_has_streaming:1; /**< Has RTSP-related session */
/* Call status */
unsigned nh_active_call:1;
unsigned nh_hold_remote:1;
unsigned nh_ref_by_stack:1; /**< Has stack used the handle? */
unsigned nh_ref_by_user:1; /**< Has user used the handle? */
unsigned nh_init:1; /**< Handle has been initialized */
unsigned nh_used_ptags:1; /**< Ptags has been used */
unsigned :0;
struct nua_client_request nh_cr[1];
......
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