diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index d606913085..3cc4a08fd4 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Tue Mar 3 11:19:17 CST 2009 +Tue Mar 3 11:20:05 CST 2009 diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/check_simple.c b/libs/sofia-sip/libsofia-sip-ua/nua/check_simple.c index 2e2bffc61d..d122a3bff1 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/check_simple.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/check_simple.c @@ -711,7 +711,7 @@ START_TEST(notify_6_3_4) struct event *response; sip_t *sip; - s2_case("6.3.3", "NOTIFY server - terminate with error response to NOTIFY", + s2_case("6.3.4", "NOTIFY server - terminate with error response to NOTIFY", "NUA receives SUBSCRIBE, sends 202 and NOTIFY. " "The subscription terminates when watcher " "returns 481 to second NOTIFY. The queued 3rd NOTIFY gets " @@ -719,9 +719,6 @@ START_TEST(notify_6_3_4) nh = subscribe_to_nua("presence", SIPTAG_EXPIRES_STR("300"), TAG_END()); - tport_set_params(s2->master, TPTAG_LOG(1), TAG_END()); - s2_setup_logs(7); - nua_notify(nh, NUTAG_SUBSTATE(nua_substate_active), SIPTAG_PAYLOAD_STR(presence_closed), diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c b/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c index 6257dbaa59..bec5b082e9 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c @@ -1767,11 +1767,23 @@ static int nua_prack_client_request(nua_client_request_t *cr, else if (nh->nh_soa == NULL) { offer_sent = session_get_description(sip, NULL, NULL); } - /* When 100rel response status was 183 do support for preconditions */ - else if (ss->ss_precondition && cri->cr_status == 183 && - cri->cr_offer_sent && cri->cr_answer_recv) { - if (soa_generate_offer(nh->nh_soa, 0, NULL) < 0 || - session_include_description(nh->nh_soa, 1, msg, sip) < 0) { + else { + /* When 100rel response status was 183 do support for preconditions */ + int send_offer = ss->ss_precondition && + cri->cr_status == 183 && cri->cr_offer_sent && cri->cr_answer_recv; + + if (!send_offer) { + tagi_t const *t = tl_find_last(tags, nutag_include_extra_sdp); + send_offer = t && t->t_value; + } + + if (!send_offer) { + } + else if (soa_generate_offer(nh->nh_soa, 0, NULL) >= 0 && + session_include_description(nh->nh_soa, 1, msg, sip) >= 0) { + offer_sent = 1; + } + else { status = soa_error_as_sip_response(nh->nh_soa, &phrase); SU_DEBUG_3(("nua(%p): PRACK offer: %d %s\n", (void *)nh, status, phrase)); @@ -1779,9 +1791,6 @@ static int nua_prack_client_request(nua_client_request_t *cr, nua_i_media_error, status, phrase, NULL); return nua_client_return(cr, status, phrase, msg); } - else { - offer_sent = 1; - } } retval = nua_base_client_request(cr, msg, sip, NULL);