if (!tech_pvt || !tech_pvt->nh) {
goto done;
}
-
- if ((status > 100 || switch_channel_test_flag(channel, CF_ANSWERED)) && status < 300 && !r_sdp && tech_pvt->mparams.last_sdp_str) {
- r_sdp = tech_pvt->mparams.last_sdp_str;
+
+ if (!r_sdp && (status > 100 || switch_channel_test_flag(channel, CF_ANSWERED)) && status < 300) {
+ if (ss_state == nua_callstate_ready) {
+ if (tech_pvt->mparams.last_sdp_response) {
+ r_sdp = tech_pvt->mparams.last_sdp_response;
+ }
+ } else {
+ if (tech_pvt->mparams.last_sdp_str) {
+ r_sdp = tech_pvt->mparams.last_sdp_str;
+ }
+ }
}
tech_pvt->mparams.last_sdp_str = NULL;
tech_pvt->sent_invites++;
+ if (switch_channel_get_private(tech_pvt->channel, "t38_options")) {
+ sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA);
+ }
+
if (sofia_use_soa(tech_pvt)) {
nua_invite(tech_pvt->nh,
NUTAG_AUTOANSWER(0),