]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
debug audio on h323 channel
authorSeven Du <dujinfang@gmail.com>
Tue, 9 Jul 2013 06:03:06 +0000 (14:03 +0800)
committerSeven Du <dujinfang@gmail.com>
Tue, 9 Jul 2013 06:03:06 +0000 (14:03 +0800)
src/mod/endpoints/mod_h323/mod_h323.cpp

index 2e7050e8502b6de77fedfb71810c05364c737a65..4368116a2270aed1c8242d0af8eefcad8ea31a52 100644 (file)
@@ -1591,7 +1591,35 @@ switch_status_t FSH323Connection::receive_message(switch_core_session_message_t
                        }
                        break;
                }
+               case SWITCH_MESSAGE_INDICATE_DEBUG_MEDIA:{
+                       if (switch_rtp_ready(tech_pvt->rtp_session) && !zstr(msg->string_array_arg[0]) && !zstr(msg->string_array_arg[1])) {
+                               switch_rtp_flag_t flags = 0;
+                               int x = 0;
+
+                               if (!strcasecmp(msg->string_array_arg[0], "read")) {
+                                       x++; flags |= SWITCH_RTP_FLAG_DEBUG_RTP_READ;
+                               } else if (!strcasecmp(msg->string_array_arg[0], "write")) {
+                                       x++; flags |= SWITCH_RTP_FLAG_DEBUG_RTP_WRITE;
+                               } else if (!strcasecmp(msg->string_array_arg[0], "both")) {
+                                       x++;
+                                       x++; flags |= SWITCH_RTP_FLAG_DEBUG_RTP_READ | SWITCH_RTP_FLAG_DEBUG_RTP_WRITE;
+                               } else if (*msg->string_array_arg[0] == 'v') {
+                                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(m_fsSession), SWITCH_LOG_ERROR, "Video is not supported yet\n");
+                                       break;
+                               }
 
+                               if (x) {
+                                       if (switch_true(msg->string_array_arg[1])) {
+                                               switch_rtp_set_flag(tech_pvt->rtp_session, flags);
+                                       } else {
+                                               switch_rtp_clear_flag(tech_pvt->rtp_session, flags);
+                                       }
+                               } else {
+                                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(m_fsSession), SWITCH_LOG_ERROR, "Invalid Options\n");
+                               }
+                       }
+                       break;
+               }
                default:{
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"Received message id = %d [%p]\n", msg->message_id,this);
                }