1
0
mirror of https://github.com/signalwire/freeswitch.git synced 2025-03-06 18:30:01 +00:00
This commit is contained in:
Anthony Minessale 2011-03-03 14:21:02 -06:00
parent 4dfbea1837
commit 0ba25358b9

@ -501,8 +501,14 @@ SWITCH_DECLARE_CONSTRUCTOR CoreSession::CoreSession()
SWITCH_DECLARE_CONSTRUCTOR CoreSession::CoreSession(char *nuuid, CoreSession *a_leg) SWITCH_DECLARE_CONSTRUCTOR CoreSession::CoreSession(char *nuuid, CoreSession *a_leg)
{ {
switch_channel_t *other_channel = NULL;
init_vars(); init_vars();
if (a_leg && a_leg->session) {
other_channel = switch_core_session_get_channel(a_leg->session);
}
if (!strchr(nuuid, '/') && (session = switch_core_session_locate(nuuid))) { if (!strchr(nuuid, '/') && (session = switch_core_session_locate(nuuid))) {
uuid = strdup(nuuid); uuid = strdup(nuuid);
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);
@ -516,7 +522,7 @@ SWITCH_DECLARE_CONSTRUCTOR CoreSession::CoreSession(char *nuuid, CoreSession *a_
switch_set_flag(this, S_HUP); switch_set_flag(this, S_HUP);
uuid = strdup(switch_core_session_get_uuid(session)); uuid = strdup(switch_core_session_get_uuid(session));
switch_channel_set_state(switch_core_session_get_channel(session), CS_SOFT_EXECUTE); switch_channel_set_state(switch_core_session_get_channel(session), CS_SOFT_EXECUTE);
switch_channel_wait_for_state(switch_core_session_get_channel(session), switch_core_session_get_channel(a_leg->session), CS_SOFT_EXECUTE); switch_channel_wait_for_state(channel, other_channel, CS_SOFT_EXECUTE);
} }
} }
} }