FS-4711 --resolve this looks fine to me

This commit is contained in:
Anthony Minessale 2012-10-11 13:53:43 -05:00
parent b4c621530f
commit 188e0bd333
1 changed files with 43 additions and 30 deletions

View File

@ -8571,6 +8571,7 @@ static void kickall_matching_var(conference_obj_t *conference, const char *var,
static void call_setup_event_handler(switch_event_t *event)
{
switch_status_t status = SWITCH_STATUS_FALSE;
conference_obj_t *conference = NULL;
char *conf = switch_event_get_header(event, "Target-Component");
char *domain = switch_event_get_header(event, "Target-Domain");
@ -8592,7 +8593,10 @@ static void call_setup_event_handler(switch_event_t *event)
char *expanded = NULL, *ostr = dial_str;;
if (!strcasecmp(action, "call")) {
if((conference->max_members > 0) && (conference->count >= conference->max_members)) {
// Conference member limit has been reached; do not proceed with setup request
status = SWITCH_STATUS_FALSE;
} else {
if (switch_event_create_plain(&var_event, SWITCH_EVENT_CHANNEL_DATA) != SWITCH_STATUS_SUCCESS) {
abort();
}
@ -8619,23 +8623,32 @@ static void call_setup_event_handler(switch_event_t *event)
}
}
conference_outcall_bg(conference, NULL, NULL, ostr, 60, NULL, NULL, NULL, NULL, NULL, NULL, &var_event);
status = conference_outcall_bg(conference, NULL, NULL, ostr, 60, NULL, NULL, NULL, NULL, NULL, NULL, &var_event);
if (expanded && expanded != conference->outcall_templ) {
switch_safe_free(expanded);
}
}
} else if (!strcasecmp(action, "end")) {
//switch_core_session_hupall_matching_var("conference_call_key", key, SWITCH_CAUSE_NORMAL_CLEARING);
kickall_matching_var(conference, "conference_call_key", key);
status = SWITCH_STATUS_SUCCESS;
}
switch_safe_free(key);
} else { // Conference found but doesn't support referral.
status = SWITCH_STATUS_FALSE;
}
switch_thread_rwlock_unlock(conference->rwlock);
} else { // Couldn't find associated conference. Indicate failure on refer subscription
status = SWITCH_STATUS_FALSE;
}
if(status != SWITCH_STATUS_SUCCESS) {
// Unable to setup call, need to generate final NOTIFY
if (switch_event_create(&event, SWITCH_EVENT_CONFERENCE_DATA) == SWITCH_STATUS_SUCCESS) {
event->flags |= EF_UNIQ_HEADERS;