PFLAG_PRESENCE_ON_FIRST_REGISTER,
PFLAG_NO_CONNECTION_REUSE,
PFLAG_RENEG_ON_HOLD,
+ PFLAG_RENEG_ON_REINVITE,
PFLAG_RTP_NOTIMER_DURING_BRIDGE,
/* No new flags below this line */
PFLAG_MAX
} else {
sofia_clear_pflag(profile, PFLAG_RENEG_ON_HOLD);
}
+ } else if (!strcasecmp(var, "renegotiate-codec-on-reinvite")) {
+ if (switch_true(val)) {
+ sofia_set_pflag(profile, PFLAG_RENEG_ON_REINVITE);
+ } else {
+ sofia_clear_pflag(profile, PFLAG_RENEG_ON_REINVITE);
+ }
} else if (!strcasecmp(var, "presence-probe-on-register")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_PRESENCE_PROBE_ON_REGISTER);
} else {
sofia_clear_pflag(profile, PFLAG_RENEG_ON_HOLD);
}
+ } else if (!strcasecmp(var, "renegotiate-codec-on-reinvite")) {
+ if (switch_true(val)) {
+ sofia_set_pflag(profile, PFLAG_RENEG_ON_REINVITE);
+ } else {
+ sofia_clear_pflag(profile, PFLAG_RENEG_ON_REINVITE);
+ }
} else if (!strcasecmp(var, "presence-probe-on-register")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_PRESENCE_PROBE_ON_REGISTER);
}
}
- if (!reneg) {
+ if (reneg) {
+ reneg = sofia_test_pflag(tech_pvt->profile, PFLAG_RENEG_ON_REINVITE);
+
+ if ((val = switch_channel_get_variable(tech_pvt->channel, "sip_renegotiate_codec_on_reinvite"))) {
+ reneg = switch_true(val);
+ }
+ }
+
+ if (!reneg && tech_pvt->num_negotiated_codecs) {
codec_array = tech_pvt->negotiated_codecs;
total_codecs = tech_pvt->num_negotiated_codecs;
}
tech_pvt->rm_fmtp = switch_core_session_strdup(session, (char *) map->rm_fmtp);
tech_pvt->remote_sdp_audio_port = (switch_port_t) m->m_port;
tech_pvt->agreed_pt = (switch_payload_t) map->rm_pt;
+ tech_pvt->num_negotiated_codecs = 0;
tech_pvt->negotiated_codecs[tech_pvt->num_negotiated_codecs++] = mimp;
switch_snprintf(tmp, sizeof(tmp), "%d", tech_pvt->remote_sdp_audio_port);
switch_channel_set_variable(tech_pvt->channel, SWITCH_REMOTE_MEDIA_IP_VARIABLE, tech_pvt->remote_sdp_audio_ip);