]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 4 May 2006 01:15:38 +0000 (01:15 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 4 May 2006 01:15:38 +0000 (01:15 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1342 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_types.h
src/mod/endpoints/mod_dingaling/mod_dingaling.c
src/switch_rtp.c

index 86f84e5a8a89f9dbed5fe64e66a17ad7fefd2914..4bbae27ec652a0517fc27180cbd7da473f53d26d 100644 (file)
@@ -119,6 +119,7 @@ typedef enum {
        SWITCH_RTP_FLAG_RAW_WRITE     - Try to forward packets unscathed
        SWITCH_RTP_FLAG_GOOGLEHACK    - Convert payload from 102 to 97
        SWITCH_RTP_FLAG_VAD           - Enable VAD
+       SWITCH_RTP_FLAG_BREAK             - Stop what you are doing and return SWITCH_STATUS_BREAK
 </pre>
  */
 typedef enum {
@@ -130,7 +131,8 @@ typedef enum {
        SWITCH_RTP_FLAG_AUTOADJ = (1 << 5),
        SWITCH_RTP_FLAG_RAW_WRITE = (1 << 6),
        SWITCH_RTP_FLAG_GOOGLEHACK = (1 << 7),
-       SWITCH_RTP_FLAG_VAD = (1 << 8)
+       SWITCH_RTP_FLAG_VAD = (1 << 8),
+       SWITCH_RTP_FLAG_BREAK = ( 1 << 9)
 } switch_rtp_flag_t;
 
 /*!
index 05894a4cb5c9dac94ef463bcec53617e6451f1a0..7bae9a7c79057c86684529bdc0a5e6495de28bb5 100644 (file)
@@ -1568,6 +1568,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
                        if (*msg == '+') {
                                switch_channel_queue_dtmf(channel, msg + 1);
                                switch_set_flag(tech_pvt, TFLAG_DTMF);
+                               switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_BREAK);
                        }
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "SESSION MSG [%s]\n", msg);
                }
index 1ac243727171a97150f7aa8baa769c4d8c4d3b0f..255296b7be18ac18ffb704ea2e9f9da26df2d036 100644 (file)
@@ -523,7 +523,11 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
                bytes = sizeof(rtp_msg_t);      
                status = switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock, 0, (void *)&rtp_session->recv_msg, &bytes);
                
-               
+               if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_BREAK)) {
+                       switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_BREAK);
+                       return 0;
+               }
+
                if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO)) {
                        return -1;
                }
@@ -621,6 +625,9 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_read(switch_rtp_t *rtp_session, void
        if (bytes < 0) {
                *datalen = 0;
                return SWITCH_STATUS_GENERR;
+       } else if (bytes == 0) {
+               *datalen = 0;
+               return SWITCH_STATUS_BREAK;
        } else {
                bytes -= rtp_header_len;
        }