Permalink
Browse files

Merge branch 'master' of ssh://git.freeswitch.org:222/freeswitch

  • Loading branch information...
2 parents eb9404d + 3cbae3f commit d93c4edd508df45866e594e98d95a60ac05468fb @gmaruzz gmaruzz committed Jul 12, 2011
Showing with 18 additions and 6 deletions.
  1. +3 −2 src/include/switch_channel.h
  2. +3 −1 src/mod/applications/mod_soundtouch/Makefile
  3. +12 −3 src/switch_channel.c
@@ -72,6 +72,7 @@ typedef struct switch_channel_timetable switch_channel_timetable_t;
*/
SWITCH_DECLARE(switch_channel_state_t) switch_channel_get_state(switch_channel_t *channel);
SWITCH_DECLARE(switch_channel_state_t) switch_channel_get_running_state(switch_channel_t *channel);
+SWITCH_DECLARE(int) switch_channel_check_signal(switch_channel_t *channel, switch_bool_t in_thread_only);
/*!
\brief Determine if a channel is ready for io
@@ -84,8 +85,8 @@ SWITCH_DECLARE(int) switch_channel_test_ready(switch_channel_t *channel, switch_
#define switch_channel_media_ready(_channel) switch_channel_test_ready(_channel, SWITCH_TRUE, SWITCH_TRUE)
#define switch_channel_media_up(_channel) (switch_channel_test_flag(_channel, CF_ANSWERED) || switch_channel_test_flag(_channel, CF_EARLY_MEDIA))
-#define switch_channel_up(_channel) (switch_channel_get_state(_channel) < CS_HANGUP)
-#define switch_channel_down(_channel) (switch_channel_get_state(_channel) >= CS_HANGUP)
+#define switch_channel_up(_channel) (switch_channel_check_signal(_channel, SWITCH_TRUE) || switch_channel_get_state(_channel) < CS_HANGUP)
+#define switch_channel_down(_channel) (switch_channel_check_signal(_channel, SWITCH_TRUE) || switch_channel_get_state(_channel) >= CS_HANGUP)
#define switch_channel_media_ack(_channel) (!switch_channel_test_cap(_channel, CC_MEDIA_ACK) || switch_channel_test_flag(_channel, CF_MEDIA_ACK))
SWITCH_DECLARE(void) switch_channel_wait_for_state(switch_channel_t *channel, switch_channel_t *other_channel, switch_channel_state_t want_state);
@@ -14,8 +14,10 @@ $(SNDT_SRC):
$(SNDT_BUILD)/Makefile: $(SNDT_SRC)
mkdir -p $(SNDT_BUILD)
+ rm -rf $(SNDT_BUILD)/config/m4/*
+ rm -rf $(SNDT_SRC)/config/m4/*
cd $(SNDT_SRC) %% libtoolize -fisv
- cd $(SNDT_SRC) && AUTOMAKE="automake --add-missing --foreign --copy" autoreconf -fisv && rm -f `find . -name "*~"` && rm -f ChangeLog
+ cd $(SNDT_SRC) && AUTOMAKE="automake --add-missing --foreign --copy" autoreconf -fisv
cd ${SNDT_BUILD} && $(DEFAULT_VARS) $(SNDT_SRC)/configure $(DEFAULT_ARGS) --enable-integer-samples --srcdir=$(SNDT_SRC)
${TOUCH_TARGET}
View
@@ -1701,12 +1701,23 @@ SWITCH_DECLARE(int) switch_channel_state_change_pending(switch_channel_t *channe
return channel->running_state != channel->state;
}
+SWITCH_DECLARE(int) switch_channel_check_signal(switch_channel_t *channel, switch_bool_t in_thread_only)
+{
+ if (!in_thread_only || switch_core_session_in_thread(channel->session)) {
+ switch_ivr_parse_all_signal_data(channel->session);
+ }
+
+ return 0;
+}
+
SWITCH_DECLARE(int) switch_channel_test_ready(switch_channel_t *channel, switch_bool_t check_ready, switch_bool_t check_media)
{
int ret = 0;
switch_assert(channel != NULL);
+ switch_channel_check_signal(channel, SWITCH_TRUE);
+
if (check_media) {
ret = ((switch_channel_test_flag(channel, CF_ANSWERED) ||
switch_channel_test_flag(channel, CF_EARLY_MEDIA)) && !switch_channel_test_flag(channel, CF_PROXY_MODE) &&
@@ -1728,9 +1739,7 @@ SWITCH_DECLARE(int) switch_channel_test_ready(switch_channel_t *channel, switch_
ret++;
}
- if (ret && switch_core_session_in_thread(channel->session)) {
- switch_ivr_parse_all_signal_data(channel->session);
- }
+
return ret;
}

0 comments on commit d93c4ed

Please sign in to comment.