Commit 90b227df authored by Pekka Pessi's avatar Pekka Pessi
Browse files

Added NH_PISSET() macro to <nua_stack.h>.

darcs-hash:20051129105531-65a35-9aabcd723c298329cd818198fe1306d45bde8371.gz
parent fdb2090b
......@@ -3667,7 +3667,10 @@ static int process_response_to_invite(nua_handle_t *nh,
if (session_process_response(nh, cr, orq, sip, &received) >= 0) {
ss->ss_ack_needed = received ? received : "";
if (NH_PGET(nh, auto_ack))
if (NH_PGET(nh, auto_ack) ||
/* Auto-ACK response to re-INVITE unless auto_ack is set to 0 */
(ss->ss_state == nua_callstate_ready &&
!NH_PISSET(nh, auto_ack)))
ua_ack(nua, nh, NULL);
else
signal_call_state_change(nh, status, phrase,
......@@ -4220,7 +4223,10 @@ int process_invite2(nua_t *nua,
#define AUTOANSWER ((void*)-1)
if (ss->ss_state == nua_callstate_ready || NH_PGET(nh, auto_answer)) {
if (NH_PGET(nh, auto_answer) ||
/* Auto-answert to re-INVITE unless auto_answer is set to 0 */
(ss->ss_state == nua_callstate_ready &&
!NH_PISSET(nh, auto_answer))) {
respond_to_invite(nua, nh, SIP_200_OK, AUTOANSWER);
return 0;
}
......
......@@ -369,18 +369,25 @@ typedef struct nua_handle_preferences
} nhp_set;
} nua_handle_preferences_t;
/* Get preference from default handle */
#define DNH_PGET(dnh, pref) \
DNHP_GET((dnh)->nh_prefs, pref)
#define DNHP_GET(dnhp, pref) ((dnhp)->nhp_##pref)
#define DNHP_SET(dnhp, pref, value) \
((dnhp)->nhp_##pref = (value), (dnhp)->nhp_set.set_bits.nhp_##pref = 1)
/* Get preference from handle, if set, otherwise from default handle */
#define NH_PGET(nh, pref) \
NHP_GET((nh)->nh_prefs, (nh)->nh_nua->nua_dhandle->nh_prefs, pref)
#define NHP_GET(nhp, dnhp, pref) \
((nhp)->nhp_set.set_bits.nhp_##pref \
? (nhp)->nhp_##pref : (dnhp)->nhp_##pref)
/* Check if preference is set in the handle */
#define NH_PISSET(nh, pref) \
((nh)->nh_prefs->nhp_set.set_bits.nhp_##pref && \
(nh)->nh_nua->nua_dhandle->nh_prefs != (nh)->nh_prefs)
#define NHP_UNSET_ALL(nhp) ((nhp)->nhp_set.set_any = 0)
#define NHP_SET_ALL(nhp) ((nhp)->nhp_set.set_any = 0xffffffffU)
#define NHP_IS_ANY_SET(nhp) ((nhp)->nhp_set.set_any != 0)
......
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