]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Core] Fix MSRP relaying.
authorAndrey Volk <andywolk@gmail.com>
Tue, 15 Jun 2021 15:56:19 +0000 (18:56 +0300)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:00:47 +0000 (22:00 +0300)
src/switch_core_media.c

index 0db5a7c95d8d2686e53389a04704b2c0cd8d815c..d276bc4f1e84d7e4847864a3a0e376754e50749d 100644 (file)
@@ -15754,13 +15754,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_text_frame(switch_core
 
        t_engine = &smh->engines[SWITCH_MEDIA_TYPE_TEXT];
 
-       if (!t_engine || !t_engine->tf) {
-               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "text engine not available for processing\n");
-               switch_goto_status(SWITCH_STATUS_BREAK, done);
-       }
-
        if (!is_msrp && switch_channel_test_cap(session->channel, CC_RTP_RTT)) {
 
+               if (!t_engine || !t_engine->tf) {
+                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "text engine not available for processing\n");
+                       switch_goto_status(SWITCH_STATUS_BREAK, done);
+               }
+
                if (frame) {
                        char *str = (char *) frame->data;
                        switch_buffer_write(t_engine->tf->write_buffer, str, frame->datalen);
@@ -15824,6 +15824,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_text_frame(switch_core
 
 
        if (!is_msrp && switch_channel_test_cap(session->channel, CC_RTP_RTT)) {
+               if (!t_engine || (t_engine->red_pt && !t_engine->tf)) {
+                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "text engine not available for processing\n");
+                       switch_goto_status(SWITCH_STATUS_BREAK, done);
+               }
+
                if (t_engine->red_pt) {
                        t_engine->tf->red_pos++;
                        if (t_engine->tf->red_pos == t_engine->tf->red_max) {