]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix FSCORE-62
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 21 Nov 2007 17:07:41 +0000 (17:07 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 21 Nov 2007 17:07:41 +0000 (17:07 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6370 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia_glue.c

index 28df47893cff23a95a934e3a2ec6250ced184719..495b44ded50205ed6a35414db5a204d93855cf20 100644 (file)
@@ -327,7 +327,7 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
                        session_timeout = v_session_timeout;
                }
        }
-
+       printf("GRRXXXXXXXXXXXXX\n%s\n", tech_pvt->local_sdp_str);
        nua_respond(tech_pvt->nh, SIP_200_OK,
                                NUTAG_SESSION_TIMER(session_timeout),
                                SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
index f939468d2f8bddabe812b080be48883c9209a8fb..3fdc11350266649fa8f87d2c7a4ef4c4b9f28b7d 100644 (file)
@@ -299,6 +299,7 @@ struct private_object {
        char *rpid;
        char *gateway_from_str;
        char *rm_encoding;
+       char *iananame;
        char *rm_fmtp;
        char *fmtp_out;
        char *remote_sdp_str;
index 99c028733dc44b56b3597069074bff443a70fdc9..30ae7464d5c25844b926462f2e85fa74abeedfbc 100644 (file)
@@ -868,7 +868,7 @@ switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force)
                if (!force) {
                        return SWITCH_STATUS_SUCCESS;
                }
-               if (strcasecmp(tech_pvt->read_codec.implementation->iananame, tech_pvt->rm_encoding) ||
+               if (strcasecmp(tech_pvt->read_codec.implementation->iananame, tech_pvt->iananame) ||
                        tech_pvt->read_codec.implementation->samples_per_second != tech_pvt->rm_rate) {
 
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Changing Codec from %s to %s\n",
@@ -882,13 +882,13 @@ switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force)
                }
        }
 
-       if (!tech_pvt->rm_encoding) {
+       if (!tech_pvt->iananame) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec with no name?\n");
                return SWITCH_STATUS_FALSE;
        }
 
        if (switch_core_codec_init(&tech_pvt->read_codec,
-                                                          tech_pvt->rm_encoding,
+                                                          tech_pvt->iananame,
                                                           tech_pvt->rm_fmtp,
                                                           tech_pvt->rm_rate,
                                                           tech_pvt->codec_ms,
@@ -899,7 +899,7 @@ switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force)
                return SWITCH_STATUS_FALSE;
        } else {
                if (switch_core_codec_init(&tech_pvt->write_codec,
-                                                                  tech_pvt->rm_encoding,
+                                                                  tech_pvt->iananame,
                                                                   tech_pvt->rm_fmtp,
                                                                   tech_pvt->rm_rate,
                                                                   tech_pvt->codec_ms,
@@ -913,7 +913,7 @@ switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force)
                        tech_pvt->read_frame.rate = tech_pvt->rm_rate;
                        ms = tech_pvt->write_codec.implementation->microseconds_per_frame / 1000;
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Set Codec %s %s/%ld %d ms %d samples\n",
-                                                         switch_channel_get_name(tech_pvt->channel), tech_pvt->rm_encoding, tech_pvt->rm_rate, tech_pvt->codec_ms,
+                                                         switch_channel_get_name(tech_pvt->channel), tech_pvt->iananame, tech_pvt->rm_rate, tech_pvt->codec_ms,
                                                          tech_pvt->read_codec.implementation->samples_per_frame
                                                          );
                        tech_pvt->read_frame.codec = &tech_pvt->read_codec;
@@ -1371,21 +1371,20 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
                                }
 
                                if (mimp) {
-                                       if ((tech_pvt->rm_encoding = switch_core_session_strdup(session, (char *) rm_encoding))) {
-                                               char tmp[50];
-                                               tech_pvt->pt = (switch_payload_t) map->rm_pt;
-                                               tech_pvt->rm_rate = map->rm_rate;
-                                               tech_pvt->codec_ms = mimp->microseconds_per_frame / 1000;
-                                               tech_pvt->remote_sdp_audio_ip = switch_core_session_strdup(session, (char *) connection->c_address);
-                                               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;
-                                               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);
-                                               switch_channel_set_variable(tech_pvt->channel, SWITCH_REMOTE_MEDIA_PORT_VARIABLE, tmp);
-                                       } else {
-                                               match = 0;
-                                       }
+                                       char tmp[50];
+                                       tech_pvt->rm_encoding = switch_core_session_strdup(session, (char *) map->rm_encoding);
+                                       tech_pvt->iananame = switch_core_session_strdup(session, (char *) mimp->iananame);
+                                       tech_pvt->pt = (switch_payload_t) map->rm_pt;
+                                       tech_pvt->rm_rate = map->rm_rate;
+                                       tech_pvt->codec_ms = mimp->microseconds_per_frame / 1000;
+                                       tech_pvt->remote_sdp_audio_ip = switch_core_session_strdup(session, (char *) connection->c_address);
+                                       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;
+                                       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);
+                                       switch_channel_set_variable(tech_pvt->channel, SWITCH_REMOTE_MEDIA_PORT_VARIABLE, tmp);
+
                                }
 
                                if (match) {