mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-14 05:18:31 +00:00
tweak fifo and add app_flags
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11356 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
c19f9fca71
commit
f776a727b0
4 files changed
+41
-5
No files matched your search
@@ -118,6 +118,7 @@ struct switch_channel {
|
||||
uint8_t flags[CF_FLAG_MAX];
|
||||
uint8_t state_flags[CF_FLAG_MAX];
|
||||
uint32_t private_flags;
|
||||
uint32_t app_flags;
|
||||
switch_caller_profile_t *caller_profile;
|
||||
const switch_state_handler_table_t *state_handlers[SWITCH_MAX_STATE_HANDLERS];
|
||||
int state_handler_index;
|
||||
@@ -789,6 +790,32 @@ SWITCH_DECLARE(int) switch_channel_test_private_flag(switch_channel_t *channel,
|
||||
return (channel->private_flags & flags);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_channel_set_app_flag(switch_channel_t *channel, uint32_t flags)
|
||||
{
|
||||
switch_assert(channel != NULL);
|
||||
switch_mutex_lock(channel->flag_mutex);
|
||||
channel->app_flags |= flags;
|
||||
switch_mutex_unlock(channel->flag_mutex);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_channel_clear_app_flag(switch_channel_t *channel, uint32_t flags)
|
||||
{
|
||||
switch_assert(channel != NULL);
|
||||
switch_mutex_lock(channel->flag_mutex);
|
||||
if (!flags) {
|
||||
channel->app_flags = 0;
|
||||
} else {
|
||||
channel->app_flags &= ~flags;
|
||||
}
|
||||
switch_mutex_unlock(channel->flag_mutex);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(int) switch_channel_test_app_flag(switch_channel_t *channel, uint32_t flags)
|
||||
{
|
||||
switch_assert(channel != NULL);
|
||||
return (channel->app_flags & flags);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_channel_set_state_flag(switch_channel_t *channel, switch_channel_flag_t flag)
|
||||
{
|
||||
switch_assert(channel != NULL);
|
||||
|
||||
Reference in new issue
Block a user