]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
ilbc tweak
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 15 Oct 2010 22:53:38 +0000 (17:53 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 15 Oct 2010 22:53:38 +0000 (17:53 -0500)
src/mod/endpoints/mod_sofia/sofia_glue.c
src/switch_core_io.c

index 8358d1fd095cacabb78bc7afb21366f5ff5d5c26..ddeb0e48f10dd00e1ebdd0e9a0879b7be686deeb 100644 (file)
@@ -2667,6 +2667,7 @@ switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force)
                                                           NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "Can't load codec?\n");
                switch_goto_status(SWITCH_STATUS_FALSE, end);
+               switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION);
        }
 
        if (switch_core_codec_init_with_bitrate(&tech_pvt->write_codec,
@@ -2679,6 +2680,7 @@ switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force)
                                                           SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE | tech_pvt->profile->codec_flags,
                                                           NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "Can't load codec?\n");
+               switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION);
                switch_goto_status(SWITCH_STATUS_FALSE, end);
        }
 
@@ -4320,12 +4322,12 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s
                                map_bit_rate = switch_known_bitrate(map->rm_pt);
                                
                                if (!ptime && !strcasecmp(map->rm_encoding, "g723")) {
-                                       codec_ms = 30;
+                                       ptime = codec_ms = 30;
                                }
                                
                                if (zstr(map->rm_fmtp)) {
                                        if (!strcasecmp(map->rm_encoding, "ilbc")) {
-                                               codec_ms = 30;
+                                               ptime = codec_ms = 30;
                                        }
                                } else {
                                        if ((switch_core_codec_parse_fmtp(map->rm_encoding, map->rm_fmtp, map->rm_rate, &codec_fmtp)) == SWITCH_STATUS_SUCCESS) {
index 7e63e88db70c2a0e23a7c10bb23709c05d74f058..766bec7a81bc17359efc0876e91288831eb40709 100644 (file)
@@ -119,6 +119,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
                        return SWITCH_STATUS_SUCCESS;
                }
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "%s has no read codec.\n", switch_channel_get_name(session->channel));
+               switch_channel_hangup(session->channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION);
                return SWITCH_STATUS_FALSE;
        }
 
@@ -630,6 +631,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
 
        if (!(session->write_codec && switch_core_codec_ready(session->write_codec)) && !pass_cng) {
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "%s has no write codec.\n", switch_channel_get_name(session->channel));
+               switch_channel_hangup(session->channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION);
                return SWITCH_STATUS_FALSE;
        }