]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3140 --comment-only please try this patch
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 10 Mar 2011 06:18:06 +0000 (00:18 -0600)
committerBrian West <brian@freeswitch.org>
Thu, 10 Mar 2011 06:18:06 +0000 (00:18 -0600)
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_glue.c

index c3b60da3173d5b3b0f4b8dc9e4caebc663a10a24..156a69d5a7d3a908d335a9c457901afb71b4315d 100644 (file)
@@ -231,6 +231,7 @@ typedef enum {
        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
index 8e38393efb821a606d221faa7122a84caa794a8e..761a03ce62ec725ec94bc91143dfc380e5ff05b6 100644 (file)
@@ -2442,6 +2442,12 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
                                                } 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);
@@ -3137,6 +3143,12 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                                } 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);
index 91cf5b6fba2fcb72b4b8a32a10d06321c7a98e03..1e42afc269890871902c342793f1b1be9c0bc02a 100644 (file)
@@ -4290,7 +4290,15 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s
                }
        }
 
-       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;
        }
@@ -4688,6 +4696,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s
                                        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);