[commit] r13625 - in freeswitch/trunk/src: . include
Author: anthm Date: Thu Jun 4 20:05:11 2009 New Revision: 13625 Log: add hunt_caller_profile Modified: freeswitch/trunk/src/include/switch_caller.h freeswitch/trunk/src/include/switch_channel.h freeswitch/trunk/src/switch_channel.c freeswitch/trunk/src/switch_core_session.c Modified: freeswitch/trunk/src/include/switch_caller.h ============================================================================== --- freeswitch/trunk/src/include/switch_caller.h (original) +++ freeswitch/trunk/src/include/switch_caller.h Thu Jun 4 20:05:11 2009 @@ -99,6 +99,7 @@ switch_caller_profile_flag_t flags; struct switch_caller_profile *originator_caller_profile; struct switch_caller_profile *originatee_caller_profile; + struct switch_caller_profile *hunt_caller_profile; struct switch_channel_timetable *times; struct switch_caller_extension *caller_extension; switch_memory_pool_t *pool; Modified: freeswitch/trunk/src/include/switch_channel.h ============================================================================== --- freeswitch/trunk/src/include/switch_channel.h (original) +++ freeswitch/trunk/src/include/switch_channel.h Thu Jun 4 20:05:11 2009 @@ -189,6 +189,8 @@ */ SWITCH_DECLARE(void) switch_channel_set_originator_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile); +SWITCH_DECLARE(void) switch_channel_set_hunt_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile); + /*! \brief Retrive the given channel's originator caller profile \param channel channel to retrive the profile from Modified: freeswitch/trunk/src/switch_channel.c ============================================================================== --- freeswitch/trunk/src/switch_channel.c (original) +++ freeswitch/trunk/src/switch_channel.c Thu Jun 4 20:05:11 2009 @@ -1483,6 +1483,19 @@ switch_mutex_unlock(channel->profile_mutex); } +SWITCH_DECLARE(void) switch_channel_set_hunt_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile) +{ + switch_assert(channel != NULL); + switch_assert(channel->caller_profile != NULL); + + switch_mutex_lock(channel->profile_mutex); + channel->caller_profile->hunt_caller_profile = NULL; + if (channel->caller_profile && caller_profile) { + channel->caller_profile->hunt_caller_profile = caller_profile; + } + switch_mutex_unlock(channel->profile_mutex); +} + SWITCH_DECLARE(void) switch_channel_set_originatee_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile) { switch_assert(channel != NULL); Modified: freeswitch/trunk/src/switch_core_session.c ============================================================================== --- freeswitch/trunk/src/switch_core_session.c (original) +++ freeswitch/trunk/src/switch_core_session.c Thu Jun 4 20:05:11 2009 @@ -1526,6 +1526,7 @@ dpstr = switch_core_session_strdup(session, new_profile->dialplan); + switch_channel_set_hunt_caller_profile(channel, new_profile); argc = switch_separate_string(dpstr, ',', dp, (sizeof(dp) / sizeof(dp[0]))); for (x = 0; x < argc; x++) { char *dpname = dp[x]; @@ -1581,6 +1582,8 @@ } done: + switch_channel_set_hunt_caller_profile(channel, NULL); + session->stack_count--; return status; }
participants (1)
-
FreeSWITCH SVN