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

keep new conference locked the whole time during transfer

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12988 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 73fe7bfd
...@@ -3635,6 +3635,8 @@ static switch_status_t conf_api_sub_transfer(conference_obj_t *conference, switc ...@@ -3635,6 +3635,8 @@ static switch_status_t conf_api_sub_transfer(conference_obj_t *conference, switc
switch_status_t ret_status = SWITCH_STATUS_SUCCESS; switch_status_t ret_status = SWITCH_STATUS_SUCCESS;
char *conf_name = NULL, *profile_name; char *conf_name = NULL, *profile_name;
switch_event_t *params = NULL; switch_event_t *params = NULL;
conference_obj_t *new_conference = NULL;
switch_assert(conference != NULL); switch_assert(conference != NULL);
switch_assert(stream != NULL); switch_assert(stream != NULL);
...@@ -3652,7 +3654,6 @@ static switch_status_t conf_api_sub_transfer(conference_obj_t *conference, switc ...@@ -3652,7 +3654,6 @@ static switch_status_t conf_api_sub_transfer(conference_obj_t *conference, switc
for (x = 3; x < argc; x++) { for (x = 3; x < argc; x++) {
conference_member_t *member = NULL; conference_member_t *member = NULL;
uint32_t id = atoi(argv[x]); uint32_t id = atoi(argv[x]);
conference_obj_t *new_conference = NULL;
switch_channel_t *channel; switch_channel_t *channel;
switch_event_t *event; switch_event_t *event;
switch_xml_t cxml = NULL, cfg = NULL, profiles = NULL; switch_xml_t cxml = NULL, cfg = NULL, profiles = NULL;
...@@ -3664,8 +3665,9 @@ static switch_status_t conf_api_sub_transfer(conference_obj_t *conference, switc ...@@ -3664,8 +3665,9 @@ static switch_status_t conf_api_sub_transfer(conference_obj_t *conference, switc
channel = switch_core_session_get_channel(member->session); channel = switch_core_session_get_channel(member->session);
/* build a new conference if it doesn't exist */ if (!new_conference) {
if (!(new_conference = (conference_obj_t *) switch_core_hash_find(globals.conference_hash, conf_name))) { if (!(new_conference = (conference_obj_t *) switch_core_hash_find(globals.conference_hash, conf_name))) {
/* build a new conference if it doesn't exist */
switch_memory_pool_t *pool = NULL; switch_memory_pool_t *pool = NULL;
conf_xml_cfg_t xml_cfg = { 0 }; conf_xml_cfg_t xml_cfg = { 0 };
...@@ -3730,6 +3732,7 @@ static switch_status_t conf_api_sub_transfer(conference_obj_t *conference, switc ...@@ -3730,6 +3732,7 @@ static switch_status_t conf_api_sub_transfer(conference_obj_t *conference, switc
} else { } else {
switch_mutex_lock(new_conference->mutex); switch_mutex_lock(new_conference->mutex);
} }
}
/* move the member from the old conference to the new one */ /* move the member from the old conference to the new one */
switch_mutex_lock(member->control_mutex); switch_mutex_lock(member->control_mutex);
...@@ -3745,10 +3748,8 @@ static switch_status_t conf_api_sub_transfer(conference_obj_t *conference, switc ...@@ -3745,10 +3748,8 @@ static switch_status_t conf_api_sub_transfer(conference_obj_t *conference, switc
} }
} }
switch_mutex_unlock(new_conference->mutex);
switch_mutex_unlock(member->control_mutex); switch_mutex_unlock(member->control_mutex);
stream->write_function(stream, "OK Member '%d' sent to conference %s.\n", member->id, argv[2]); stream->write_function(stream, "OK Member '%d' sent to conference %s.\n", member->id, argv[2]);
/* tell them what happened */ /* tell them what happened */
...@@ -3761,6 +3762,11 @@ static switch_status_t conf_api_sub_transfer(conference_obj_t *conference, switc ...@@ -3761,6 +3762,11 @@ static switch_status_t conf_api_sub_transfer(conference_obj_t *conference, switc
switch_event_fire(&event); switch_event_fire(&event);
} }
} }
if (new_conference) {
switch_mutex_unlock(new_conference->mutex);
}
} else { } else {
ret_status = SWITCH_STATUS_GENERR; ret_status = SWITCH_STATUS_GENERR;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论