FS-4729 try this patch clean

This commit is contained in:
Anthony Minessale 2012-10-22 13:37:41 -04:00
parent 17d1ffe45c
commit 4b6db1329c
2 changed files with 20 additions and 1 deletions

View File

@ -1249,6 +1249,7 @@ typedef enum {
CF_TRACKABLE,
CF_NO_CDR,
CF_EARLY_OK,
CF_MEDIA_TRANS,
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
/* IF YOU ADD NEW ONES CHECK IF THEY SHOULD PERSIST OR ZERO THEM IN switch_core_session.c switch_core_session_request_xml() */
CF_FLAG_MAX

View File

@ -1476,6 +1476,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_media(const char *uuid, switch_media_
if ((session = switch_core_session_locate(uuid))) {
channel = switch_core_session_get_channel(session);
if (switch_channel_test_flag(channel, CF_MEDIA_TRANS)) {
switch_core_session_rwunlock(session);
return SWITCH_STATUS_INUSE;
}
switch_channel_set_flag(channel, CF_MEDIA_TRANS);
if ((flags & SMF_REBRIDGE) && !switch_channel_test_flag(channel, CF_BRIDGE_ORIGINATOR)) {
swap = 1;
@ -1527,6 +1534,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_media(const char *uuid, switch_media_
}
}
switch_channel_clear_flag(channel, CF_MEDIA_TRANS);
switch_core_session_rwunlock(session);
if (other_channel) {
@ -1559,6 +1567,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_nomedia(const char *uuid, switch_medi
status = SWITCH_STATUS_SUCCESS;
channel = switch_core_session_get_channel(session);
if (switch_channel_test_flag(channel, CF_MEDIA_TRANS)) {
switch_core_session_rwunlock(session);
return SWITCH_STATUS_INUSE;
}
switch_channel_set_flag(channel, CF_MEDIA_TRANS);
if ((flags & SMF_REBRIDGE) && !switch_channel_test_flag(channel, CF_BRIDGE_ORIGINATOR)) {
swap = 1;
}
@ -1617,9 +1632,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_nomedia(const char *uuid, switch_medi
switch_core_session_rwunlock(other_session);
}
}
switch_core_session_rwunlock(session);
switch_channel_clear_flag(channel, CF_MEDIA_TRANS);
}
return status;
}