Compare commits
3 Commits
f403802ee5
...
98c0f1e4a0
Author | SHA1 | Date |
---|---|---|
Aron Podrigal | 98c0f1e4a0 | |
Aron Podrigal | 5cb74797fe | |
Aron Podrigal | 905200d682 |
|
@ -714,7 +714,14 @@ switch_status_t conference_member_del_relationship(conference_member_t *member,
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch_status_t conference_member_play_alone_sound(conference_member_t *member)
|
||||||
|
{
|
||||||
|
char *sound = member->conference->alone_sound ? member->conference->alone_sound : "say:You are currently the only person in this conference.";
|
||||||
|
if (!strcasecmp(sound, "none")) {
|
||||||
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
return conference_member_play_file(member, sound, 0, SWITCH_TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
/* Gain exclusive access and add the member to the list */
|
/* Gain exclusive access and add the member to the list */
|
||||||
switch_status_t conference_member_add(conference_obj_t *conference, conference_member_t *member)
|
switch_status_t conference_member_add(conference_obj_t *conference, conference_member_t *member)
|
||||||
|
@ -940,15 +947,8 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m
|
||||||
conference_member_say(member, msg, CONF_DEFAULT_LEADIN);
|
conference_member_say(member, msg, CONF_DEFAULT_LEADIN);
|
||||||
} else if (conference->count == 1 && !conference->perpetual_sound && !conference_utils_test_flag(conference, CFLAG_WAIT_MOD)) {
|
} else if (conference->count == 1 && !conference->perpetual_sound && !conference_utils_test_flag(conference, CFLAG_WAIT_MOD)) {
|
||||||
/* as long as its not a bridge_to conference, announce if person is alone */
|
/* as long as its not a bridge_to conference, announce if person is alone */
|
||||||
if (!conference_utils_test_flag(conference, CFLAG_BRIDGE_TO)) {
|
if (!conference_utils_test_flag(conference, CFLAG_BRIDGE_TO) && !conference_utils_member_test_flag(member, MFLAG_GHOST)) {
|
||||||
if (conference->alone_sound && !conference_utils_member_test_flag(member, MFLAG_GHOST)) {
|
conference_member_play_alone_sound(member);
|
||||||
conference_file_stop(conference, FILE_STOP_ASYNC);
|
|
||||||
conference_file_play(conference, conference->alone_sound, CONF_DEFAULT_LEADIN,
|
|
||||||
switch_core_session_get_channel(member->session), 0);
|
|
||||||
} else {
|
|
||||||
switch_snprintf(msg, sizeof(msg), "You are currently the only person in this conference.");
|
|
||||||
conference_member_say(member, msg, CONF_DEFAULT_LEADIN);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1346,8 +1346,13 @@ switch_status_t conference_member_del(conference_obj_t *conference, conference_m
|
||||||
conference_file_play(conference, conference->exit_sound, 0, channel, 0);
|
conference_file_play(conference, conference->exit_sound, 0, channel, 0);
|
||||||
}
|
}
|
||||||
if (conference->count == 1 && conference->alone_sound && !conference_utils_test_flag(conference, CFLAG_WAIT_MOD) && !conference_utils_member_test_flag(member, MFLAG_GHOST)) {
|
if (conference->count == 1 && conference->alone_sound && !conference_utils_test_flag(conference, CFLAG_WAIT_MOD) && !conference_utils_member_test_flag(member, MFLAG_GHOST)) {
|
||||||
conference_file_stop(conference, FILE_STOP_ASYNC);
|
/* play file to single member that was left in the conference */
|
||||||
conference_file_play(conference, conference->alone_sound, 0, channel, 0);
|
for (imember = conference->members; imember; imember = imember->next) {
|
||||||
|
if (!conference_utils_member_test_flag(imember, MFLAG_GHOST)) {
|
||||||
|
conference_member_play_alone_sound(imember);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1152,6 +1152,7 @@ void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *ob
|
||||||
switch_status_t conference_file_local_play(conference_obj_t *conference, switch_core_session_t *session, char *path, uint32_t leadin, void *buf,
|
switch_status_t conference_file_local_play(conference_obj_t *conference, switch_core_session_t *session, char *path, uint32_t leadin, void *buf,
|
||||||
uint32_t buflen);
|
uint32_t buflen);
|
||||||
switch_status_t conference_member_play_file(conference_member_t *member, char *file, uint32_t leadin, switch_bool_t mux);
|
switch_status_t conference_member_play_file(conference_member_t *member, char *file, uint32_t leadin, switch_bool_t mux);
|
||||||
|
switch_status_t conference_member_play_alone_sound(conference_member_t *member);
|
||||||
switch_status_t conference_member_say(conference_member_t *member, char *text, uint32_t leadin);
|
switch_status_t conference_member_say(conference_member_t *member, char *text, uint32_t leadin);
|
||||||
uint32_t conference_member_stop_file(conference_member_t *member, file_stop_t stop);
|
uint32_t conference_member_stop_file(conference_member_t *member, file_stop_t stop);
|
||||||
conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_core_session_t *session, switch_memory_pool_t *pool);
|
conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_core_session_t *session, switch_memory_pool_t *pool);
|
||||||
|
|
|
@ -106,6 +106,22 @@ char * pgsql_handle_get_error(switch_pgsql_handle_t *handle)
|
||||||
return err_str;
|
return err_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pgsql_handle_set_error_if_not_set(switch_pgsql_handle_t *handle, char **err)
|
||||||
|
{
|
||||||
|
char *err_str;
|
||||||
|
|
||||||
|
if (err && !(*err)) {
|
||||||
|
err_str = pgsql_handle_get_error(handle);
|
||||||
|
|
||||||
|
if (zstr(err_str)) {
|
||||||
|
switch_safe_free(err_str);
|
||||||
|
err_str = strdup((char *)"SQL ERROR!");
|
||||||
|
}
|
||||||
|
|
||||||
|
*err = err_str;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int db_is_up(switch_pgsql_handle_t *handle)
|
static int db_is_up(switch_pgsql_handle_t *handle)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
@ -553,8 +569,15 @@ switch_status_t pgsql_handle_exec_detailed(const char *file, const char *func, i
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
return pgsql_finish_results(handle);
|
if (pgsql_finish_results(handle) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
pgsql_handle_set_error_if_not_set(handle, err);
|
||||||
|
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -630,6 +653,7 @@ done:
|
||||||
|
|
||||||
pgsql_free_result(&result);
|
pgsql_free_result(&result);
|
||||||
if (pgsql_finish_results(handle) != SWITCH_STATUS_SUCCESS) {
|
if (pgsql_finish_results(handle) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
pgsql_handle_set_error_if_not_set(handle, err);
|
||||||
sstatus = SWITCH_STATUS_FALSE;
|
sstatus = SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -638,6 +662,7 @@ done:
|
||||||
error:
|
error:
|
||||||
|
|
||||||
pgsql_free_result(&result);
|
pgsql_free_result(&result);
|
||||||
|
pgsql_handle_set_error_if_not_set(handle, err);
|
||||||
|
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1050,6 +1075,8 @@ switch_status_t pgsql_handle_callback_exec_detailed(const char *file, const char
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
error:
|
error:
|
||||||
|
|
||||||
|
pgsql_handle_set_error_if_not_set(handle, err);
|
||||||
|
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue