提交 e61acfba authored 作者: Anthony Minessale's avatar Anthony Minessale

update

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1342 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 a92ae5b6
...@@ -119,6 +119,7 @@ typedef enum { ...@@ -119,6 +119,7 @@ typedef enum {
SWITCH_RTP_FLAG_RAW_WRITE - Try to forward packets unscathed SWITCH_RTP_FLAG_RAW_WRITE - Try to forward packets unscathed
SWITCH_RTP_FLAG_GOOGLEHACK - Convert payload from 102 to 97 SWITCH_RTP_FLAG_GOOGLEHACK - Convert payload from 102 to 97
SWITCH_RTP_FLAG_VAD - Enable VAD SWITCH_RTP_FLAG_VAD - Enable VAD
SWITCH_RTP_FLAG_BREAK - Stop what you are doing and return SWITCH_STATUS_BREAK
</pre> </pre>
*/ */
typedef enum { typedef enum {
...@@ -130,7 +131,8 @@ typedef enum { ...@@ -130,7 +131,8 @@ typedef enum {
SWITCH_RTP_FLAG_AUTOADJ = (1 << 5), SWITCH_RTP_FLAG_AUTOADJ = (1 << 5),
SWITCH_RTP_FLAG_RAW_WRITE = (1 << 6), SWITCH_RTP_FLAG_RAW_WRITE = (1 << 6),
SWITCH_RTP_FLAG_GOOGLEHACK = (1 << 7), 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; } switch_rtp_flag_t;
/*! /*!
......
...@@ -1568,6 +1568,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi ...@@ -1568,6 +1568,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
if (*msg == '+') { if (*msg == '+') {
switch_channel_queue_dtmf(channel, msg + 1); switch_channel_queue_dtmf(channel, msg + 1);
switch_set_flag(tech_pvt, TFLAG_DTMF); 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); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "SESSION MSG [%s]\n", msg);
} }
......
...@@ -523,7 +523,11 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ ...@@ -523,7 +523,11 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
bytes = sizeof(rtp_msg_t); bytes = sizeof(rtp_msg_t);
status = switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock, 0, (void *)&rtp_session->recv_msg, &bytes); 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)) { if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO)) {
return -1; return -1;
} }
...@@ -621,6 +625,9 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_read(switch_rtp_t *rtp_session, void ...@@ -621,6 +625,9 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_read(switch_rtp_t *rtp_session, void
if (bytes < 0) { if (bytes < 0) {
*datalen = 0; *datalen = 0;
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} else if (bytes == 0) {
*datalen = 0;
return SWITCH_STATUS_BREAK;
} else { } else {
bytes -= rtp_header_len; bytes -= rtp_header_len;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论