spring cleaning

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11730 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2009-02-10 19:09:06 +00:00
parent 98cb113cdd
commit be25cc9631
17 changed files with 275 additions and 199 deletions

View File

@@ -864,12 +864,22 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_get_running_state(switch_c
return state;
}
SWITCH_DECLARE(uint8_t) switch_channel_ready(switch_channel_t *channel)
SWITCH_DECLARE(int) switch_channel_test_ready(switch_channel_t *channel, switch_bool_t media)
{
uint8_t ret = 0;
int ret = 0;
switch_assert(channel != NULL);
if (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) &&
switch_core_session_get_read_codec(channel->session) && switch_core_session_get_write_codec(channel->session));
if (!ret) return ret;
}
ret = 0;
if (!channel->hangup_cause && channel->state > CS_ROUTING && channel->state < CS_HANGUP && channel->state != CS_RESET &&
!switch_channel_test_flag(channel, CF_TRANSFER)) {
ret++;