Commit c49a0395 authored by Pekka Pessi's avatar Pekka Pessi

nua_session.c: Using NUTAG_ONLY183_100REL() when establishing call.

Note: now not generating nua_i_state when a response to PRACK is received,
if the response to PRACK did not change the call state.

Also, only including offer to PRACK when PRACKing 183 and we have
preconditions.

darcs-hash:20060519115834-65a35-462600f06e2ee7036f7c6cd567ffc13b0bef9648.gz
parent ba89da4e
...@@ -552,6 +552,7 @@ process_100rel(nua_handle_t *nh, ...@@ -552,6 +552,7 @@ process_100rel(nua_handle_t *nh,
nta_outgoing_t *prack; nta_outgoing_t *prack;
char const *recv = NULL, *sent = NULL; char const *recv = NULL, *sent = NULL;
int status = 408;
int offer_sent_in_prack = 0, answer_sent_in_prack = 0; int offer_sent_in_prack = 0, answer_sent_in_prack = 0;
su_home_t home[1] = { SU_HOME_INIT(home) }; su_home_t home[1] = { SU_HOME_INIT(home) };
...@@ -562,6 +563,9 @@ process_100rel(nua_handle_t *nh, ...@@ -562,6 +563,9 @@ process_100rel(nua_handle_t *nh,
return 0; /* We have to wait! */ return 0; /* We have to wait! */
} }
if (sip && sip->sip_status)
status = sip->sip_status->st_status;
if (!nua_dialog_is_established(nh->nh_ds)) { if (!nua_dialog_is_established(nh->nh_ds)) {
/* Tag the INVITE request */ /* Tag the INVITE request */
nua_dialog_uac_route(nh, nh->nh_ds, sip, 1); nua_dialog_uac_route(nh, nh->nh_ds, sip, 1);
...@@ -586,7 +590,7 @@ process_100rel(nua_handle_t *nh, ...@@ -586,7 +590,7 @@ process_100rel(nua_handle_t *nh,
soa_activate(nh->nh_soa, NULL); soa_activate(nh->nh_soa, NULL);
} }
} }
else if (ss->ss_precondition) { else if (ss->ss_precondition && status == 183) { /* XXX */
if (soa_generate_offer(nh->nh_soa, 0, NULL) < 0 || if (soa_generate_offer(nh->nh_soa, 0, NULL) < 0 ||
session_make_description(home, nh->nh_soa, &cd, &ct, &pl) < 0) session_make_description(home, nh->nh_soa, &cd, &ct, &pl) < 0)
/* XXX */; /* XXX */;
...@@ -660,8 +664,9 @@ process_response_to_prack(nua_handle_t *nh, ...@@ -660,8 +664,9 @@ process_response_to_prack(nua_handle_t *nh,
else else
nua_stack_process_response(nh, cr, orq, sip, TAG_END()); nua_stack_process_response(nh, cr, orq, sip, TAG_END());
signal_call_state_change(nh, status, phrase, if (recv)
nua_callstate_proceeding, recv, NULL); signal_call_state_change(nh, status, phrase,
nua_callstate_proceeding, recv, NULL);
if (status < 300 && nh->nh_ss->ss_update_needed) if (status < 300 && nh->nh_ss->ss_update_needed)
nua_stack_update(nh->nh_nua, nh, nua_r_update, NULL); nua_stack_update(nh->nh_nua, nh, nua_r_update, NULL);
...@@ -766,6 +771,9 @@ static int process_response_to_cancel(nua_handle_t *nh, ...@@ -766,6 +771,9 @@ static int process_response_to_cancel(nua_handle_t *nh,
return nua_stack_process_response(nh, nh->nh_cr, orq, sip, TAG_END()); return nua_stack_process_response(nh, nh->nh_cr, orq, sip, TAG_END());
} }
/* ---------------------------------------------------------------------- */
/* UAS side of INVITE */
static void respond_to_invite(nua_t *nua, nua_handle_t *nh, static void respond_to_invite(nua_t *nua, nua_handle_t *nh,
int status, char const *phrase, int status, char const *phrase,
tagi_t const *tags); tagi_t const *tags);
...@@ -1033,12 +1041,16 @@ void respond_to_invite(nua_t *nua, nua_handle_t *nh, ...@@ -1033,12 +1041,16 @@ void respond_to_invite(nua_t *nua, nua_handle_t *nh,
reliable = reliable =
(status >= 200) (status >= 200)
|| (status == 183 &&
ds->ds_remote_ua->nr_supported &&
sip_has_feature(ds->ds_remote_ua->nr_supported, "100rel"))
|| (status > 100 && || (status > 100 &&
ds->ds_remote_ua->nr_require && ds->ds_remote_ua->nr_require &&
sip_has_feature(ds->ds_remote_ua->nr_require, "100rel")) sip_has_feature(ds->ds_remote_ua->nr_require, "100rel"))
|| (status > 100 && !NH_PGET(nh, only183_100rel) &&
NH_PGET(nh, early_media) &&
ds->ds_remote_ua->nr_supported &&
sip_has_feature(ds->ds_remote_ua->nr_supported, "100rel"))
|| (status == 183 &&
ds->ds_remote_ua->nr_supported &&
sip_has_feature(ds->ds_remote_ua->nr_supported, "100rel"))
|| (status == 183 && || (status == 183 &&
ds->ds_remote_ua->nr_require && ds->ds_remote_ua->nr_require &&
sip_has_feature(ds->ds_remote_ua->nr_require, "precondition")) sip_has_feature(ds->ds_remote_ua->nr_require, "precondition"))
......
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