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 "
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),
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));
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);