]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
prevent t38_passthru and fax_detect from both happening at once
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 3 May 2013 03:22:59 +0000 (22:22 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 3 May 2013 03:22:59 +0000 (22:22 -0500)
src/mod/endpoints/mod_sofia/sofia_glue.c

index 80683c90eefeb1e7bc33311a567911c6072c9251..3904488f046bfdda25898870afe202269fec0a41 100644 (file)
@@ -4843,7 +4843,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s
                                match = 1;
                                goto done;
                        }
-
+                       
                        if (switch_true(switch_channel_get_variable(channel, "refuse_t38"))) {
                                switch_channel_clear_app_flag_key("T38", tech_pvt->channel, CF_APP_T38);
                                match = 0;
@@ -4881,6 +4881,18 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s
                                        switch_port_t remote_port = switch_rtp_get_remote_port(tech_pvt->rtp_session);
                                        char tmp[32] = "";
 
+                                       if (!switch_channel_test_flag(other_channel, CF_ANSWERED)) {
+                                               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), 
+                                                                                 SWITCH_LOG_WARNING, "%s Error Passing T.38 to unanswered channel %s\n", 
+                                                                                 switch_channel_get_name(tech_pvt->channel), switch_channel_get_name(other_channel));
+                                               switch_core_session_rwunlock(other_session);                                            
+                                               sofia_set_flag(tech_pvt, TFLAG_NOREPLY);
+                                               pass = 0;
+                                               match = 0;
+                                               goto done;
+                                       }
+
+
                                        if (switch_true(switch_channel_get_variable(tech_pvt->channel, "t38_broken_boolean")) && 
                                                switch_true(switch_channel_get_variable(tech_pvt->channel, "t38_pass_broken_boolean"))) {
                                                switch_channel_set_variable(other_channel, "t38_broken_boolean", "true");