]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add hunt_caller_profile
authorMathieu Rene <mrene@avgs.ca>
Fri, 5 Jun 2009 01:16:02 +0000 (01:16 +0000)
committerMathieu Rene <mrene@avgs.ca>
Fri, 5 Jun 2009 01:16:02 +0000 (01:16 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13626 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_caller.c
src/switch_channel.c
src/switch_core_session.c

index f5857f6163fff6db6a84f89f77fcf6f91663a67c..4b19170dee9cd017c9dcc55ba4118b0c29161853 100644 (file)
@@ -50,6 +50,8 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_new(switch_memor
        switch_caller_profile_t *profile = NULL;
 
        profile = switch_core_alloc(pool, sizeof(*profile));
+       memset(profile, 0, sizeof(*profile));
+       
        switch_assert(profile != NULL);
 
        if (!context) {
index ff706c85116f36e7b633a18c6ba8e01c55e7546b..f6698a84f5bdcca6b6366969378618543b8dff01 100644 (file)
@@ -495,7 +495,7 @@ SWITCH_DECLARE(const char *) switch_channel_get_variable(switch_channel_t *chann
 
        switch_mutex_lock(channel->profile_mutex);
        if (!channel->variables || !(v = switch_event_get_header(channel->variables, varname))) {
-               switch_caller_profile_t *cp = channel->caller_profile;
+               switch_caller_profile_t *cp = switch_channel_get_caller_profile(channel);
 
                if (cp) {
                        if (!strncmp(varname, "aleg_", 5)) {
@@ -1460,7 +1460,7 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_caller_profile(swit
        switch_caller_profile_t *profile;
        switch_assert(channel != NULL);
        switch_mutex_lock(channel->profile_mutex);
-       profile = channel->caller_profile;
+       profile = channel->hunt_caller_profile ? channel->hunt_caller_profile : channel->caller_profile;
        switch_mutex_unlock(channel->profile_mutex);
        return profile;
 }
index c226164a276163eea8e23f32103056348a7a7b30..a92e48b1477474eaf31f6894efe35e474b40ecbc 100644 (file)
@@ -1525,6 +1525,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_se
        }
 
        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])));