deal with MODENDP-99

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7934 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-03-19 17:56:27 +00:00
parent 7ab6dd8999
commit aa0bea3d5c
6 changed files with 28 additions and 10 deletions

View File

@ -621,16 +621,16 @@
/* Define to the function return type for send. */
#undef SEND_TYPE_RETV
/* The size of `curl_off_t', as computed by sizeof. */
/* The size of a `curl_off_t', as computed by sizeof. */
#undef SIZEOF_CURL_OFF_T
/* The size of `long', as computed by sizeof. */
/* The size of a `long', as computed by sizeof. */
#undef SIZEOF_LONG
/* The size of `size_t', as computed by sizeof. */
/* The size of a `size_t', as computed by sizeof. */
#undef SIZEOF_SIZE_T
/* The size of `time_t', as computed by sizeof. */
/* The size of a `time_t', as computed by sizeof. */
#undef SIZEOF_TIME_T
/* Define to 1 if you have the ANSI C header files. */
@ -685,7 +685,7 @@
/* type to use in place of in_addr_t if not defined */
#undef in_addr_t
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
/* type to use in place of socklen_t if not defined */

View File

@ -45,6 +45,8 @@ fi
AM_CONDITIONAL([WANT_DEBUG],[test "${enable_debug}" = "yes"])
echo host $host
echo ax_cv_c_compiler_vendor ${ax_cv_c_compiler_vendor}
case "$host" in
*-solaris2*)
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then

View File

@ -81,5 +81,5 @@
/* Version number of package */
#undef VERSION
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t

View File

@ -87,6 +87,8 @@ struct private_object {
switch_codec_t write_codec;
switch_frame_t read_frame;
unsigned char databuf[SWITCH_RECOMMENDED_BUFFER_SIZE];
switch_frame_t cng_frame;
unsigned char cng_databuf[10];
switch_core_session_t *session;
struct iax_session *iax_session;
switch_caller_profile_t *caller_profile;
@ -441,6 +443,10 @@ static void tech_init(private_t * tech_pvt, switch_core_session_t *session)
{
tech_pvt->read_frame.data = tech_pvt->databuf;
tech_pvt->read_frame.buflen = sizeof(tech_pvt->databuf);
tech_pvt->cng_frame.data = tech_pvt->cng_databuf;
tech_pvt->cng_frame.buflen = sizeof(tech_pvt->cng_databuf);
switch_set_flag((&tech_pvt->cng_frame), SFF_CNG);
tech_pvt->cng_frame.datalen = 2;
switch_mutex_init(&tech_pvt->mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session));
switch_mutex_init(&tech_pvt->flag_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session));
switch_core_session_set_private(session, tech_pvt);
@ -604,6 +610,12 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
return SWITCH_STATUS_FALSE;
}
if (switch_test_flag(tech_pvt, TFLAG_IO) && switch_test_flag(tech_pvt, TFLAG_DTMF)) {
switch_clear_flag_locked(tech_pvt, TFLAG_DTMF);
*frame = &tech_pvt->cng_frame;
return SWITCH_STATUS_SUCCESS;
}
if (switch_test_flag(tech_pvt, TFLAG_IO) && switch_test_flag(tech_pvt, TFLAG_VOICE)) {
switch_clear_flag_locked(tech_pvt, TFLAG_VOICE);
if (!tech_pvt->read_frame.datalen) {
@ -1107,7 +1119,10 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_iax_runtime)
if (globals.debug) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%c DTMF %s\n", dtmf.digit, switch_channel_get_name(channel));
}
switch_mutex_lock(tech_pvt->flag_mutex);
switch_channel_queue_dtmf(channel, &dtmf);
switch_set_flag(tech_pvt, TFLAG_DTMF);
switch_mutex_unlock(tech_pvt->flag_mutex);
}
break;

View File

@ -178,7 +178,7 @@ static void *audio_bridge_thread(switch_thread_t * thread, void *obj)
switch_dtmf_t dtmf = { 0, 0 };
if (switch_channel_dequeue_dtmf(chan_a, &dtmf) == SWITCH_STATUS_SUCCESS) {
int send_dtmf = 1;
if (input_callback) {
switch_status_t cb_status = input_callback(session_a, (void *)&dtmf, SWITCH_INPUT_TYPE_DTMF, user_data, 0);

View File

@ -1098,7 +1098,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
{
switch_size_t bytes = 0;
switch_status_t status;
uint8_t check = 1;
uint8_t check = 0;
stfu_frame_t *jb_frame;
int ret = -1;
@ -1125,6 +1125,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_BREAK)) {
switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_BREAK);
do_2833(rtp_session);
bytes = 0;
do_cng = 1;
goto cng;
@ -1154,8 +1155,8 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
} else if (bytes) {
check++;
}
if (check) {
if (check || bytes) {
do_2833(rtp_session);
}