提交 ef5b6d76 authored 作者: Anthony Minessale's avatar Anthony Minessale

add hunt_caller_profile

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13625 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 c464a35d
...@@ -99,6 +99,7 @@ SWITCH_BEGIN_EXTERN_C ...@@ -99,6 +99,7 @@ SWITCH_BEGIN_EXTERN_C
switch_caller_profile_flag_t flags; switch_caller_profile_flag_t flags;
struct switch_caller_profile *originator_caller_profile; struct switch_caller_profile *originator_caller_profile;
struct switch_caller_profile *originatee_caller_profile; struct switch_caller_profile *originatee_caller_profile;
struct switch_caller_profile *hunt_caller_profile;
struct switch_channel_timetable *times; struct switch_channel_timetable *times;
struct switch_caller_extension *caller_extension; struct switch_caller_extension *caller_extension;
switch_memory_pool_t *pool; switch_memory_pool_t *pool;
......
...@@ -189,6 +189,8 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_caller_profile(swit ...@@ -189,6 +189,8 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_caller_profile(swit
*/ */
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_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 \brief Retrive the given channel's originator caller profile
\param channel channel to retrive the profile from \param channel channel to retrive the profile from
......
...@@ -1483,6 +1483,19 @@ SWITCH_DECLARE(void) switch_channel_set_originator_caller_profile(switch_channel ...@@ -1483,6 +1483,19 @@ SWITCH_DECLARE(void) switch_channel_set_originator_caller_profile(switch_channel
switch_mutex_unlock(channel->profile_mutex); 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_DECLARE(void) switch_channel_set_originatee_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile)
{ {
switch_assert(channel != NULL); switch_assert(channel != NULL);
......
...@@ -1526,6 +1526,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_se ...@@ -1526,6 +1526,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_se
dpstr = switch_core_session_strdup(session, new_profile->dialplan); 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]))); argc = switch_separate_string(dpstr, ',', dp, (sizeof(dp) / sizeof(dp[0])));
for (x = 0; x < argc; x++) { for (x = 0; x < argc; x++) {
char *dpname = dp[x]; char *dpname = dp[x];
...@@ -1581,6 +1582,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_se ...@@ -1581,6 +1582,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_se
} }
done: done:
switch_channel_set_hunt_caller_profile(channel, NULL);
session->stack_count--; session->stack_count--;
return status; return status;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论