From 305bc19458f5894d350fa5d1e47f7b8bcd6e42e8 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 25 Oct 2006 17:00:23 +0000 Subject: [PATCH] update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3199 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/libdingaling/src/config.h.in | 2 +- libs/mozilla.build.sh | 2 +- src/include/switch_am_config.h.in | 2 +- src/mod/asr_tts/mod_cepstral/mod_cepstral.c | 2 +- .../endpoints/mod_dingaling/mod_dingaling.c | 23 +++++++++++-------- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/libs/libdingaling/src/config.h.in b/libs/libdingaling/src/config.h.in index 550ded4757..697698a10d 100644 --- a/libs/libdingaling/src/config.h.in +++ b/libs/libdingaling/src/config.h.in @@ -106,5 +106,5 @@ /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc -/* Define to `unsigned' if does not define. */ +/* Define to `unsigned int' if does not define. */ #undef size_t diff --git a/libs/mozilla.build.sh b/libs/mozilla.build.sh index 4126f84297..c47c6b2b4d 100755 --- a/libs/mozilla.build.sh +++ b/libs/mozilla.build.sh @@ -49,5 +49,5 @@ fi cd nsprpub && CFLAGS=$cflags LDFLAGS=$ldflags ./configure $opts && $MAKE -cd ../js/src && CFLAGS=$cflags LDFLAGS=$ldflags JS_THREADSAFE=1 JS_HAS_FILE_OBJECT=1 OTHER_LIBS="-L../../../mozilla/nsprpub/dist/lib" INCLUDES="-I../../../mozilla/nsprpub/dist/include/nspr" $MAKE -f Makefile.ref `find . -name libjs.a` +cd ../js/src && CFLAGS=$cflags BUILD_OPT=1 LDFLAGS=$ldflags JS_THREADSAFE=1 JS_HAS_FILE_OBJECT=1 OTHER_LIBS="-L../../../mozilla/nsprpub/dist/lib" INCLUDES="-I../../../mozilla/nsprpub/dist/include/nspr" $MAKE -f Makefile.ref `find . -name libjs.a` diff --git a/src/include/switch_am_config.h.in b/src/include/switch_am_config.h.in index c2a949cebe..3e1a92ccaf 100644 --- a/src/include/switch_am_config.h.in +++ b/src/include/switch_am_config.h.in @@ -124,5 +124,5 @@ /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc -/* Define to `unsigned' if does not define. */ +/* Define to `unsigned int' if does not define. */ #undef size_t diff --git a/src/mod/asr_tts/mod_cepstral/mod_cepstral.c b/src/mod/asr_tts/mod_cepstral/mod_cepstral.c index f88acab594..2814da34d9 100644 --- a/src/mod/asr_tts/mod_cepstral/mod_cepstral.c +++ b/src/mod/asr_tts/mod_cepstral/mod_cepstral.c @@ -227,7 +227,7 @@ static switch_status_t cepstral_speech_feed_tts(switch_speech_handle_t *sh, char return SWITCH_STATUS_FALSE; } - swift_port_speak_text(cepstral->port, "", 0, NULL, &cepstral->tts_stream, NULL); + swift_port_speak_text(cepstral->port, "", 0, NULL, &cepstral->tts_stream, NULL); swift_port_speak_text(cepstral->port, text, 0, NULL, &cepstral->tts_stream, NULL); } diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c index 43378b0368..be421b7ab9 100644 --- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c +++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c @@ -577,6 +577,12 @@ static void terminate_session(switch_core_session_t **session, int line, switch_ switch_channel_hangup(channel, cause); } + switch_mutex_lock(tech_pvt->flag_mutex); + switch_set_flag(tech_pvt, TFLAG_TERM); + switch_set_flag(tech_pvt, TFLAG_BYE); + switch_clear_flag(tech_pvt, TFLAG_IO); + switch_mutex_unlock(tech_pvt->flag_mutex); + *session = NULL; } @@ -1186,6 +1192,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_BYE)) { + //terminate_session(&session, __LINE__, SWITCH_CAUSE_NORMAL_CLEARING); + return SWITCH_STATUS_FALSE; + } + + tech_pvt->read_frame.datalen = 0; switch_set_flag_locked(tech_pvt, TFLAG_READING); @@ -1241,10 +1253,6 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch switch_clear_flag_locked(tech_pvt, TFLAG_READING); - if (switch_test_flag(tech_pvt, TFLAG_BYE)) { - terminate_session(&session, __LINE__, SWITCH_CAUSE_NORMAL_CLEARING); - return SWITCH_STATUS_FALSE; - } *frame = &tech_pvt->read_frame; return SWITCH_STATUS_SUCCESS; @@ -1275,7 +1283,7 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc if (switch_test_flag(tech_pvt, TFLAG_BYE)) { - terminate_session(&session, __LINE__, SWITCH_CAUSE_NORMAL_CLEARING); + //terminate_session(&session, __LINE__, SWITCH_CAUSE_NORMAL_CLEARING); return SWITCH_STATUS_FALSE; } @@ -2560,11 +2568,6 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi if (channel) { switch_channel_state_t state = switch_channel_get_state(channel); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "hungup %s %u %d\n", switch_channel_get_name(channel), state, CS_INIT); - switch_mutex_lock(tech_pvt->flag_mutex); - switch_set_flag(tech_pvt, TFLAG_TERM); - switch_set_flag(tech_pvt, TFLAG_BYE); - switch_clear_flag(tech_pvt, TFLAG_IO); - switch_mutex_unlock(tech_pvt->flag_mutex); terminate_session(&session, __LINE__, SWITCH_CAUSE_NORMAL_CLEARING); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "End Call\n"); goto done;