fix backlash from profile clone change
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5705 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
46e44f9afb
commit
2e741ff1c9
|
@ -836,21 +836,24 @@ SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel_t *channel, sw
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile)
|
SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile)
|
||||||
{
|
{
|
||||||
|
char *uuid = NULL;
|
||||||
assert(channel != NULL);
|
assert(channel != NULL);
|
||||||
assert(channel->session != NULL);
|
assert(channel->session != NULL);
|
||||||
switch_mutex_lock(channel->profile_mutex);
|
switch_mutex_lock(channel->profile_mutex);
|
||||||
assert(caller_profile != NULL);
|
assert(caller_profile != NULL);
|
||||||
|
|
||||||
if (!caller_profile->uuid) {
|
uuid = switch_core_session_get_uuid(channel->session);
|
||||||
caller_profile->uuid = switch_core_session_strdup(channel->session, switch_core_session_get_uuid(channel->session));
|
|
||||||
|
if (!caller_profile->uuid || strcasecmp(caller_profile->uuid, uuid)) {
|
||||||
|
caller_profile->uuid = switch_core_session_strdup(channel->session, uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!caller_profile->chan_name) {
|
if (!caller_profile->chan_name || strcasecmp(caller_profile->chan_name, channel->name)) {
|
||||||
caller_profile->chan_name = switch_core_session_strdup(channel->session, channel->name);
|
caller_profile->chan_name = switch_core_session_strdup(channel->session, channel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!caller_profile->context) {
|
if (!caller_profile->context) {
|
||||||
caller_profile->chan_name = switch_core_session_strdup(channel->session, "default");
|
caller_profile->context = switch_core_session_strdup(channel->session, "default");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!channel->caller_profile) {
|
if (!channel->caller_profile) {
|
||||||
|
|
|
@ -305,6 +305,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
|
||||||
if (session && (cloned_profile = switch_caller_profile_clone(session, peer_profile)) != 0) {
|
if (session && (cloned_profile = switch_caller_profile_clone(session, peer_profile)) != 0) {
|
||||||
switch_channel_set_originatee_caller_profile(channel, cloned_profile);
|
switch_channel_set_originatee_caller_profile(channel, cloned_profile);
|
||||||
}
|
}
|
||||||
|
printf("XXXXXXXXXXWTF [%s] [%s] [%s]\n", profile->uuid, peer_profile->uuid, cloned_profile->uuid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue