diff --git a/src/mod/applications/mod_conference/Makefile.am b/src/mod/applications/mod_conference/Makefile.am index ff9c86f345..1a7b06d20b 100644 --- a/src/mod/applications/mod_conference/Makefile.am +++ b/src/mod/applications/mod_conference/Makefile.am @@ -2,8 +2,8 @@ include $(top_srcdir)/build/modmake.rulesam MODNAME=mod_conference mod_LTLIBRARIES = mod_conference.la -mod_conference_la_SOURCES = mod_conference.c mod_conference_api.c mod_conference_loop.c mod_conference_al.c mod_conference_cdr.c mod_conference_video.c -mod_conference_la_SOURCES += mod_conference_event.c mod_conference_member.c mod_conference_utils.c mod_conference_file.c mod_conference_record.c +mod_conference_la_SOURCES = mod_conference.c conference_api.c conference_loop.c conference_al.c conference_cdr.c conference_video.c +mod_conference_la_SOURCES += conference_event.c conference_member.c conference_utils.c conference_file.c conference_record.c mod_conference_la_CFLAGS = $(AM_CFLAGS) -I. mod_conference_la_LIBADD = $(switch_builddir)/libfreeswitch.la mod_conference_la_LDFLAGS = -avoid-version -module -no-undefined -shared diff --git a/src/mod/applications/mod_conference/mod_conference_al.c b/src/mod/applications/mod_conference/conference_al.c similarity index 82% rename from src/mod/applications/mod_conference/mod_conference_al.c rename to src/mod/applications/mod_conference/conference_al.c index 929acb5828..d923a0e9d6 100644 --- a/src/mod/applications/mod_conference/mod_conference_al.c +++ b/src/mod/applications/mod_conference/conference_al.c @@ -43,7 +43,7 @@ -al_handle_t *conf_al_create(switch_memory_pool_t *pool) +al_handle_t *conference_al_create(switch_memory_pool_t *pool) { al_handle_t *al; @@ -54,22 +54,22 @@ al_handle_t *conf_al_create(switch_memory_pool_t *pool) } #ifndef OPENAL_POSITIONING -void conf_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t *stream) +void conference_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t *stream) { } -void conf_al_process(al_handle_t *al, void *data, switch_size_t datalen, int rate) +void conference_al_process(al_handle_t *al, void *data, switch_size_t datalen, int rate) { } #else -void conf_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t *stream) +void conference_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t *stream) { float offset; float pos; float radius; float x, z; float div = 3.14159f / 180; - conf_member_t *member; + conference_member_t *member; uint32_t count = 0; if (!conference->count) { @@ -78,14 +78,14 @@ void conf_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t *strea switch_mutex_lock(conference->member_mutex); for (member = conference->members; member; member = member->next) { - if (member->channel && conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK) && !conf_utils_member_test_flag(member, MFLAG_NO_POSITIONAL)) { + if (member->channel && conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) && !conference_utils_member_test_flag(member, MFLAG_NO_POSITIONAL)) { count++; } } if (count < 3) { for (member = conference->members; member; member = member->next) { - if (member->channel && !conf_utils_member_test_flag(member, MFLAG_NO_POSITIONAL) && member->al) { + if (member->channel && !conference_utils_member_test_flag(member, MFLAG_NO_POSITIONAL) && member->al) { member->al->pos_x = 0; member->al->pos_y = 0; @@ -112,14 +112,14 @@ void conf_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t *strea for (member = conference->members; member; member = member->next) { - if (!member->channel || conf_utils_member_test_flag(member, MFLAG_NO_POSITIONAL) || !conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { + if (!member->channel || conference_utils_member_test_flag(member, MFLAG_NO_POSITIONAL) || !conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { continue; } if (!member->al) { - member->al = conf_al_create(member->pool); + member->al = conference_al_create(member->pool); } - conf_utils_member_set_flag(member, MFLAG_POSITIONAL); + conference_utils_member_set_flag(member, MFLAG_POSITIONAL); if (pos == 0) { x = 0; @@ -163,7 +163,7 @@ void conf_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t *strea -void conf_al_process(al_handle_t *al, void *data, switch_size_t datalen, int rate) +void conference_al_process(al_handle_t *al, void *data, switch_size_t datalen, int rate) { if (rate != 48000) { @@ -180,7 +180,7 @@ void conf_al_process(al_handle_t *al, void *data, switch_size_t datalen, int rat 0 }; - switch_mutex_lock(conf_globals.setup_mutex); + switch_mutex_lock(conference_globals.setup_mutex); if ((al->device = alcLoopbackOpenDeviceSOFT(NULL))) { const ALshort silence[16] = { 0 }; float orient[6] = { /*fwd:*/ 0., 0., -1., /*up:*/ 0., 1., 0. }; @@ -205,7 +205,7 @@ void conf_al_process(al_handle_t *al, void *data, switch_size_t datalen, int rat alSourceQueueBuffers(al->source, 2, al->buffer_in); alSourcePlay(al->source); } - switch_mutex_unlock(conf_globals.setup_mutex); + switch_mutex_unlock(conference_globals.setup_mutex); } if (al->device) { @@ -238,13 +238,13 @@ void conf_al_process(al_handle_t *al, void *data, switch_size_t datalen, int rat #endif #ifndef OPENAL_POSITIONING -switch_status_t conf_al_parse_position(al_handle_t *al, const char *data) +switch_status_t conference_al_parse_position(al_handle_t *al, const char *data) { return SWITCH_STATUS_FALSE; } #else -switch_status_t conf_al_parse_position(al_handle_t *al, const char *data) +switch_status_t conference_al_parse_position(al_handle_t *al, const char *data) { char *args[3]; int num; @@ -270,11 +270,11 @@ switch_status_t conf_al_parse_position(al_handle_t *al, const char *data) #endif #ifdef OPENAL_POSITIONING -void conf_al_close(al_handle_t *al) +void conference_al_close(al_handle_t *al) { if (!al) return; - switch_mutex_lock(conf_globals.setup_mutex); + switch_mutex_lock(conference_globals.setup_mutex); if (al->source) { alDeleteSources(1, &al->source); al->source = 0; @@ -295,7 +295,7 @@ void conf_al_close(al_handle_t *al) alcCloseDevice(al->device); al->device = NULL; } - switch_mutex_unlock(conf_globals.setup_mutex); + switch_mutex_unlock(conference_globals.setup_mutex); } #endif diff --git a/src/mod/applications/mod_conference/mod_conference_api.c b/src/mod/applications/mod_conference/conference_api.c similarity index 68% rename from src/mod/applications/mod_conference/mod_conference_api.c rename to src/mod/applications/mod_conference/conference_api.c index 20710bce4c..3c2153f740 100644 --- a/src/mod/applications/mod_conference/mod_conference_api.c +++ b/src/mod/applications/mod_conference/conference_api.c @@ -42,73 +42,73 @@ #include -api_command_t conf_api_sub_commands[] = { - {"list", (void_fn_t) & conf_api_sub_list, CONF_API_SUB_ARGS_SPLIT, "list", "[delim ]|[count]"}, - {"xml_list", (void_fn_t) & conf_api_sub_xml_list, CONF_API_SUB_ARGS_SPLIT, "xml_list", ""}, - {"energy", (void_fn_t) & conf_api_sub_energy, CONF_API_SUB_MEMBER_TARGET, "energy", " []"}, - {"vid-canvas", (void_fn_t) & conf_api_sub_canvas, CONF_API_SUB_MEMBER_TARGET, "vid-canvas", " []"}, - {"vid-watching-canvas", (void_fn_t) & conf_api_sub_watching_canvas, CONF_API_SUB_MEMBER_TARGET, "vid-watching-canvas", " []"}, - {"vid-layer", (void_fn_t) & conf_api_sub_layer, CONF_API_SUB_MEMBER_TARGET, "vid-layer", " []"}, - {"volume_in", (void_fn_t) & conf_api_sub_volume_in, CONF_API_SUB_MEMBER_TARGET, "volume_in", " []"}, - {"volume_out", (void_fn_t) & conf_api_sub_volume_out, CONF_API_SUB_MEMBER_TARGET, "volume_out", " []"}, - {"position", (void_fn_t) & conf_api_sub_position, CONF_API_SUB_MEMBER_TARGET, "position", " ::"}, - {"auto-3d-position", (void_fn_t) & conf_api_sub_auto_position, CONF_API_SUB_ARGS_SPLIT, "auto-3d-position", "[on|off]"}, - {"play", (void_fn_t) & conf_api_sub_play, CONF_API_SUB_ARGS_SPLIT, "play", " [async| [nomux]]"}, - {"pause_play", (void_fn_t) & conf_api_sub_pause_play, CONF_API_SUB_ARGS_SPLIT, "pause", "[]"}, - {"file_seek", (void_fn_t) & conf_api_sub_file_seek, CONF_API_SUB_ARGS_SPLIT, "file_seek", "[+-] []"}, - {"say", (void_fn_t) & conf_api_sub_say, CONF_API_SUB_ARGS_AS_ONE, "say", ""}, - {"saymember", (void_fn_t) & conf_api_sub_saymember, CONF_API_SUB_ARGS_AS_ONE, "saymember", " "}, - {"stop", (void_fn_t) & conf_api_sub_stop, CONF_API_SUB_ARGS_SPLIT, "stop", "<[current|all|async|last]> []"}, - {"dtmf", (void_fn_t) & conf_api_sub_dtmf, CONF_API_SUB_MEMBER_TARGET, "dtmf", "<[member_id|all|last|non_moderator]> "}, - {"kick", (void_fn_t) & conf_api_sub_kick, CONF_API_SUB_MEMBER_TARGET, "kick", "<[member_id|all|last|non_moderator]> []"}, - {"hup", (void_fn_t) & conf_api_sub_hup, CONF_API_SUB_MEMBER_TARGET, "hup", "<[member_id|all|last|non_moderator]>"}, - {"mute", (void_fn_t) & conf_api_sub_mute, CONF_API_SUB_MEMBER_TARGET, "mute", "<[member_id|all]|last|non_moderator> []"}, - {"tmute", (void_fn_t) & conf_api_sub_tmute, CONF_API_SUB_MEMBER_TARGET, "tmute", "<[member_id|all]|last|non_moderator> []"}, - {"unmute", (void_fn_t) & conf_api_sub_unmute, CONF_API_SUB_MEMBER_TARGET, "unmute", "<[member_id|all]|last|non_moderator> []"}, - {"vmute", (void_fn_t) & conf_api_sub_vmute, CONF_API_SUB_MEMBER_TARGET, "vmute", "<[member_id|all]|last|non_moderator> []"}, - {"tvmute", (void_fn_t) & conf_api_sub_tvmute, CONF_API_SUB_MEMBER_TARGET, "tvmute", "<[member_id|all]|last|non_moderator> []"}, - {"vmute-snap", (void_fn_t) & conf_api_sub_conf_video_vmute_snap, CONF_API_SUB_MEMBER_TARGET, "vmute-snap", "<[member_id|all]|last|non_moderator>"}, - {"unvmute", (void_fn_t) & conf_api_sub_unvmute, CONF_API_SUB_MEMBER_TARGET, "unvmute", "<[member_id|all]|last|non_moderator> []"}, - {"deaf", (void_fn_t) & conf_api_sub_deaf, CONF_API_SUB_MEMBER_TARGET, "deaf", "<[member_id|all]|last|non_moderator>"}, - {"undeaf", (void_fn_t) & conf_api_sub_undeaf, CONF_API_SUB_MEMBER_TARGET, "undeaf", "<[member_id|all]|last|non_moderator>"}, - {"relate", (void_fn_t) & conf_api_sub_relate, CONF_API_SUB_ARGS_SPLIT, "relate", " [nospeak|nohear|clear]"}, - {"lock", (void_fn_t) & conf_api_sub_lock, CONF_API_SUB_ARGS_SPLIT, "lock", ""}, - {"unlock", (void_fn_t) & conf_api_sub_unlock, CONF_API_SUB_ARGS_SPLIT, "unlock", ""}, - {"agc", (void_fn_t) & conf_api_sub_agc, CONF_API_SUB_ARGS_SPLIT, "agc", ""}, - {"dial", (void_fn_t) & conf_api_sub_dial, CONF_API_SUB_ARGS_SPLIT, "dial", "/ "}, - {"bgdial", (void_fn_t) & conf_api_sub_bgdial, CONF_API_SUB_ARGS_SPLIT, "bgdial", "/ "}, - {"transfer", (void_fn_t) & conf_api_sub_transfer, CONF_API_SUB_ARGS_SPLIT, "transfer", " [...]"}, - {"record", (void_fn_t) & conf_api_sub_record, CONF_API_SUB_ARGS_SPLIT, "record", ""}, - {"chkrecord", (void_fn_t) & conf_api_sub_check_record, CONF_API_SUB_ARGS_SPLIT, "chkrecord", ""}, - {"norecord", (void_fn_t) & conf_api_sub_norecord, CONF_API_SUB_ARGS_SPLIT, "norecord", "<[filename|all]>"}, - {"pause", (void_fn_t) & conf_api_sub_pauserec, CONF_API_SUB_ARGS_SPLIT, "pause", ""}, - {"resume", (void_fn_t) & conf_api_sub_pauserec, CONF_API_SUB_ARGS_SPLIT, "resume", ""}, - {"recording", (void_fn_t) & conf_api_sub_recording, CONF_API_SUB_ARGS_SPLIT, "recording", "[start|stop|check|pause|resume] [|all]"}, - {"exit_sound", (void_fn_t) & conf_api_sub_exit_sound, CONF_API_SUB_ARGS_SPLIT, "exit_sound", "on|off|none|file "}, - {"enter_sound", (void_fn_t) & conf_api_sub_enter_sound, CONF_API_SUB_ARGS_SPLIT, "enter_sound", "on|off|none|file "}, - {"pin", (void_fn_t) & conf_api_sub_pin, CONF_API_SUB_ARGS_SPLIT, "pin", ""}, - {"nopin", (void_fn_t) & conf_api_sub_pin, CONF_API_SUB_ARGS_SPLIT, "nopin", ""}, - {"get", (void_fn_t) & conf_api_sub_get, CONF_API_SUB_ARGS_SPLIT, "get", ""}, - {"set", (void_fn_t) & conf_api_sub_set, CONF_API_SUB_ARGS_SPLIT, "set", " "}, - {"file-vol", (void_fn_t) & conf_api_sub_file_vol, CONF_API_SUB_ARGS_SPLIT, "file-vol", ""}, - {"floor", (void_fn_t) & conf_api_sub_floor, CONF_API_SUB_MEMBER_TARGET, "floor", ""}, - {"vid-floor", (void_fn_t) & conf_api_sub_vid_floor, CONF_API_SUB_MEMBER_TARGET, "vid-floor", " [force]"}, - {"vid-banner", (void_fn_t) & conf_api_sub_vid_banner, CONF_API_SUB_MEMBER_TARGET, "vid-banner", " "}, - {"vid-mute-img", (void_fn_t) & conf_api_sub_vid_mute_img, CONF_API_SUB_MEMBER_TARGET, "vid-mute-img", " [|clear]"}, - {"vid-logo-img", (void_fn_t) & conf_api_sub_vid_logo_img, CONF_API_SUB_MEMBER_TARGET, "vid-logo-img", " [|clear]"}, - {"vid-res-id", (void_fn_t) & conf_api_sub_vid_res_id, CONF_API_SUB_MEMBER_TARGET, "vid-res-id", " |clear"}, - {"clear-vid-floor", (void_fn_t) & conf_api_sub_clear_vid_floor, CONF_API_SUB_ARGS_AS_ONE, "clear-vid-floor", ""}, - {"vid-layout", (void_fn_t) & conf_api_sub_vid_layout, CONF_API_SUB_ARGS_SPLIT, "vid-layout", "|group []"}, - {"vid-write-png", (void_fn_t) & conf_api_sub_write_png, CONF_API_SUB_ARGS_SPLIT, "vid-write-png", ""}, - {"vid-fps", (void_fn_t) & conf_api_sub_vid_fps, CONF_API_SUB_ARGS_SPLIT, "vid-fps", ""}, - {"vid-bandwidth", (void_fn_t) & conf_api_sub_vid_bandwidth, CONF_API_SUB_ARGS_SPLIT, "vid-bandwidth", ""} +api_command_t conference_api_sub_commands[] = { + {"list", (void_fn_t) & conference_api_sub_list, CONF_API_SUB_ARGS_SPLIT, "list", "[delim ]|[count]"}, + {"xml_list", (void_fn_t) & conference_api_sub_xml_list, CONF_API_SUB_ARGS_SPLIT, "xml_list", ""}, + {"energy", (void_fn_t) & conference_api_sub_energy, CONF_API_SUB_MEMBER_TARGET, "energy", " []"}, + {"vid-canvas", (void_fn_t) & conference_api_sub_canvas, CONF_API_SUB_MEMBER_TARGET, "vid-canvas", " []"}, + {"vid-watching-canvas", (void_fn_t) & conference_api_sub_watching_canvas, CONF_API_SUB_MEMBER_TARGET, "vid-watching-canvas", " []"}, + {"vid-layer", (void_fn_t) & conference_api_sub_layer, CONF_API_SUB_MEMBER_TARGET, "vid-layer", " []"}, + {"volume_in", (void_fn_t) & conference_api_sub_volume_in, CONF_API_SUB_MEMBER_TARGET, "volume_in", " []"}, + {"volume_out", (void_fn_t) & conference_api_sub_volume_out, CONF_API_SUB_MEMBER_TARGET, "volume_out", " []"}, + {"position", (void_fn_t) & conference_api_sub_position, CONF_API_SUB_MEMBER_TARGET, "position", " ::"}, + {"auto-3d-position", (void_fn_t) & conference_api_sub_auto_position, CONF_API_SUB_ARGS_SPLIT, "auto-3d-position", "[on|off]"}, + {"play", (void_fn_t) & conference_api_sub_play, CONF_API_SUB_ARGS_SPLIT, "play", " [async| [nomux]]"}, + {"pause_play", (void_fn_t) & conference_api_sub_pause_play, CONF_API_SUB_ARGS_SPLIT, "pause", "[]"}, + {"file_seek", (void_fn_t) & conference_api_sub_file_seek, CONF_API_SUB_ARGS_SPLIT, "file_seek", "[+-] []"}, + {"say", (void_fn_t) & conference_api_sub_say, CONF_API_SUB_ARGS_AS_ONE, "say", ""}, + {"saymember", (void_fn_t) & conference_api_sub_saymember, CONF_API_SUB_ARGS_AS_ONE, "saymember", " "}, + {"stop", (void_fn_t) & conference_api_sub_stop, CONF_API_SUB_ARGS_SPLIT, "stop", "<[current|all|async|last]> []"}, + {"dtmf", (void_fn_t) & conference_api_sub_dtmf, CONF_API_SUB_MEMBER_TARGET, "dtmf", "<[member_id|all|last|non_moderator]> "}, + {"kick", (void_fn_t) & conference_api_sub_kick, CONF_API_SUB_MEMBER_TARGET, "kick", "<[member_id|all|last|non_moderator]> []"}, + {"hup", (void_fn_t) & conference_api_sub_hup, CONF_API_SUB_MEMBER_TARGET, "hup", "<[member_id|all|last|non_moderator]>"}, + {"mute", (void_fn_t) & conference_api_sub_mute, CONF_API_SUB_MEMBER_TARGET, "mute", "<[member_id|all]|last|non_moderator> []"}, + {"tmute", (void_fn_t) & conference_api_sub_tmute, CONF_API_SUB_MEMBER_TARGET, "tmute", "<[member_id|all]|last|non_moderator> []"}, + {"unmute", (void_fn_t) & conference_api_sub_unmute, CONF_API_SUB_MEMBER_TARGET, "unmute", "<[member_id|all]|last|non_moderator> []"}, + {"vmute", (void_fn_t) & conference_api_sub_vmute, CONF_API_SUB_MEMBER_TARGET, "vmute", "<[member_id|all]|last|non_moderator> []"}, + {"tvmute", (void_fn_t) & conference_api_sub_tvmute, CONF_API_SUB_MEMBER_TARGET, "tvmute", "<[member_id|all]|last|non_moderator> []"}, + {"vmute-snap", (void_fn_t) & conference_api_sub_conference_video_vmute_snap, CONF_API_SUB_MEMBER_TARGET, "vmute-snap", "<[member_id|all]|last|non_moderator>"}, + {"unvmute", (void_fn_t) & conference_api_sub_unvmute, CONF_API_SUB_MEMBER_TARGET, "unvmute", "<[member_id|all]|last|non_moderator> []"}, + {"deaf", (void_fn_t) & conference_api_sub_deaf, CONF_API_SUB_MEMBER_TARGET, "deaf", "<[member_id|all]|last|non_moderator>"}, + {"undeaf", (void_fn_t) & conference_api_sub_undeaf, CONF_API_SUB_MEMBER_TARGET, "undeaf", "<[member_id|all]|last|non_moderator>"}, + {"relate", (void_fn_t) & conference_api_sub_relate, CONF_API_SUB_ARGS_SPLIT, "relate", " [nospeak|nohear|clear]"}, + {"lock", (void_fn_t) & conference_api_sub_lock, CONF_API_SUB_ARGS_SPLIT, "lock", ""}, + {"unlock", (void_fn_t) & conference_api_sub_unlock, CONF_API_SUB_ARGS_SPLIT, "unlock", ""}, + {"agc", (void_fn_t) & conference_api_sub_agc, CONF_API_SUB_ARGS_SPLIT, "agc", ""}, + {"dial", (void_fn_t) & conference_api_sub_dial, CONF_API_SUB_ARGS_SPLIT, "dial", "/ "}, + {"bgdial", (void_fn_t) & conference_api_sub_bgdial, CONF_API_SUB_ARGS_SPLIT, "bgdial", "/ "}, + {"transfer", (void_fn_t) & conference_api_sub_transfer, CONF_API_SUB_ARGS_SPLIT, "transfer", " [...]"}, + {"record", (void_fn_t) & conference_api_sub_record, CONF_API_SUB_ARGS_SPLIT, "record", ""}, + {"chkrecord", (void_fn_t) & conference_api_sub_check_record, CONF_API_SUB_ARGS_SPLIT, "chkrecord", ""}, + {"norecord", (void_fn_t) & conference_api_sub_norecord, CONF_API_SUB_ARGS_SPLIT, "norecord", "<[filename|all]>"}, + {"pause", (void_fn_t) & conference_api_sub_pauserec, CONF_API_SUB_ARGS_SPLIT, "pause", ""}, + {"resume", (void_fn_t) & conference_api_sub_pauserec, CONF_API_SUB_ARGS_SPLIT, "resume", ""}, + {"recording", (void_fn_t) & conference_api_sub_recording, CONF_API_SUB_ARGS_SPLIT, "recording", "[start|stop|check|pause|resume] [|all]"}, + {"exit_sound", (void_fn_t) & conference_api_sub_exit_sound, CONF_API_SUB_ARGS_SPLIT, "exit_sound", "on|off|none|file "}, + {"enter_sound", (void_fn_t) & conference_api_sub_enter_sound, CONF_API_SUB_ARGS_SPLIT, "enter_sound", "on|off|none|file "}, + {"pin", (void_fn_t) & conference_api_sub_pin, CONF_API_SUB_ARGS_SPLIT, "pin", ""}, + {"nopin", (void_fn_t) & conference_api_sub_pin, CONF_API_SUB_ARGS_SPLIT, "nopin", ""}, + {"get", (void_fn_t) & conference_api_sub_get, CONF_API_SUB_ARGS_SPLIT, "get", ""}, + {"set", (void_fn_t) & conference_api_sub_set, CONF_API_SUB_ARGS_SPLIT, "set", " "}, + {"file-vol", (void_fn_t) & conference_api_sub_file_vol, CONF_API_SUB_ARGS_SPLIT, "file-vol", ""}, + {"floor", (void_fn_t) & conference_api_sub_floor, CONF_API_SUB_MEMBER_TARGET, "floor", ""}, + {"vid-floor", (void_fn_t) & conference_api_sub_vid_floor, CONF_API_SUB_MEMBER_TARGET, "vid-floor", " [force]"}, + {"vid-banner", (void_fn_t) & conference_api_sub_vid_banner, CONF_API_SUB_MEMBER_TARGET, "vid-banner", " "}, + {"vid-mute-img", (void_fn_t) & conference_api_sub_vid_mute_img, CONF_API_SUB_MEMBER_TARGET, "vid-mute-img", " [|clear]"}, + {"vid-logo-img", (void_fn_t) & conference_api_sub_vid_logo_img, CONF_API_SUB_MEMBER_TARGET, "vid-logo-img", " [|clear]"}, + {"vid-res-id", (void_fn_t) & conference_api_sub_vid_res_id, CONF_API_SUB_MEMBER_TARGET, "vid-res-id", " |clear"}, + {"clear-vid-floor", (void_fn_t) & conference_api_sub_clear_vid_floor, CONF_API_SUB_ARGS_AS_ONE, "clear-vid-floor", ""}, + {"vid-layout", (void_fn_t) & conference_api_sub_vid_layout, CONF_API_SUB_ARGS_SPLIT, "vid-layout", "|group []"}, + {"vid-write-png", (void_fn_t) & conference_api_sub_write_png, CONF_API_SUB_ARGS_SPLIT, "vid-write-png", ""}, + {"vid-fps", (void_fn_t) & conference_api_sub_vid_fps, CONF_API_SUB_ARGS_SPLIT, "vid-fps", ""}, + {"vid-bandwidth", (void_fn_t) & conference_api_sub_vid_bandwidth, CONF_API_SUB_ARGS_SPLIT, "vid-bandwidth", ""} }; -switch_status_t conf_api_sub_pause_play(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_pause_play(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { if (argc == 2) { switch_mutex_lock(conference->mutex); - conf_fnode_toggle_pause(conference->fnode, stream); + conference_fnode_toggle_pause(conference->fnode, stream); switch_mutex_unlock(conference->mutex); return SWITCH_STATUS_SUCCESS; @@ -116,11 +116,11 @@ switch_status_t conf_api_sub_pause_play(conference_obj_t *conference, switch_str if (argc == 3) { uint32_t id = atoi(argv[2]); - conf_member_t *member; + conference_member_t *member; - if ((member = conf_member_get(conference, id))) { + if ((member = conference_member_get(conference, id))) { switch_mutex_lock(member->fnode_mutex); - conf_fnode_toggle_pause(member->fnode, stream); + conference_fnode_toggle_pause(member->fnode, stream); switch_mutex_unlock(member->fnode_mutex); switch_thread_rwlock_unlock(member->rwlock); return SWITCH_STATUS_SUCCESS; @@ -133,7 +133,7 @@ switch_status_t conf_api_sub_pause_play(conference_obj_t *conference, switch_str } /* _In_opt_z_ const char *cmd, _In_opt_ switch_core_session_t *session, _In_ switch_stream_handle_t *stream */ -switch_status_t conf_api_main_real(const char *cmd, switch_core_session_t *session, switch_stream_handle_t *stream) +switch_status_t conference_api_main_real(const char *cmd, switch_core_session_t *session, switch_stream_handle_t *stream) { char *lbuf = NULL; switch_status_t status = SWITCH_STATUS_SUCCESS; @@ -167,9 +167,9 @@ switch_status_t conf_api_main_real(const char *cmd, switch_core_session_t *sessi if (argc && argv[0]) { conference_obj_t *conference = NULL; - if ((conference = conf_find(argv[0], NULL))) { + if ((conference = conference_find(argv[0], NULL))) { if (argc >= 2) { - conf_api_dispatch(conference, stream, argc, argv, cmd, 1); + conference_api_dispatch(conference, stream, argc, argv, cmd, 1); } else { stream->write_function(stream, "Conference command, not specified.\nTry 'help'\n"); } @@ -178,22 +178,22 @@ switch_status_t conf_api_main_real(const char *cmd, switch_core_session_t *sessi } else if (argv[0]) { /* special case the list command, because it doesn't require a conference argument */ if (strcasecmp(argv[0], "list") == 0) { - conf_api_sub_list(NULL, stream, argc, argv); + conference_api_sub_list(NULL, stream, argc, argv); } else if (strcasecmp(argv[0], "xml_list") == 0) { - conf_api_sub_xml_list(NULL, stream, argc, argv); + conference_api_sub_xml_list(NULL, stream, argc, argv); } else if (strcasecmp(argv[0], "help") == 0 || strcasecmp(argv[0], "commands") == 0) { stream->write_function(stream, "%s\n", api_syntax); } else if (argv[1] && strcasecmp(argv[1], "dial") == 0) { - if (conf_api_sub_dial(NULL, stream, argc, argv) != SWITCH_STATUS_SUCCESS) { + if (conference_api_sub_dial(NULL, stream, argc, argv) != SWITCH_STATUS_SUCCESS) { /* command returned error, so show syntax usage */ - stream->write_function(stream, "%s %s", conf_api_sub_commands[CONF_API_COMMAND_DIAL].pcommand, - conf_api_sub_commands[CONF_API_COMMAND_DIAL].psyntax); + stream->write_function(stream, "%s %s", conference_api_sub_commands[CONF_API_COMMAND_DIAL].pcommand, + conference_api_sub_commands[CONF_API_COMMAND_DIAL].psyntax); } } else if (argv[1] && strcasecmp(argv[1], "bgdial") == 0) { - if (conf_api_sub_bgdial(NULL, stream, argc, argv) != SWITCH_STATUS_SUCCESS) { + if (conference_api_sub_bgdial(NULL, stream, argc, argv) != SWITCH_STATUS_SUCCESS) { /* command returned error, so show syntax usage */ - stream->write_function(stream, "%s %s", conf_api_sub_commands[CONF_API_COMMAND_BGDIAL].pcommand, - conf_api_sub_commands[CONF_API_COMMAND_BGDIAL].psyntax); + stream->write_function(stream, "%s %s", conference_api_sub_commands[CONF_API_COMMAND_BGDIAL].pcommand, + conference_api_sub_commands[CONF_API_COMMAND_BGDIAL].psyntax); } } else { stream->write_function(stream, "Conference %s not found\n", argv[0]); @@ -204,7 +204,7 @@ switch_status_t conf_api_main_real(const char *cmd, switch_core_session_t *sessi int i; for (i = 0; i < CONFFUNCAPISIZE; i++) { - stream->write_function(stream, " %s %s\n", conf_api_sub_commands[i].pcommand, conf_api_sub_commands[i].psyntax); + stream->write_function(stream, " %s %s\n", conference_api_sub_commands[i].pcommand, conference_api_sub_commands[i].psyntax); } } @@ -214,7 +214,7 @@ switch_status_t conf_api_main_real(const char *cmd, switch_core_session_t *sessi return status; } -switch_status_t conf_api_sub_syntax(char **syntax) +switch_status_t conference_api_sub_syntax(char **syntax) { /* build api interface help ".syntax" field string */ uint32_t i; @@ -223,9 +223,9 @@ switch_status_t conf_api_sub_syntax(char **syntax) char *tmp = NULL, *p = strdup(""); for (i = 0; i < CONFFUNCAPISIZE; i++) { - nl = strlen(conf_api_sub_commands[i].pcommand) + strlen(conf_api_sub_commands[i].psyntax) + 5; + nl = strlen(conference_api_sub_commands[i].pcommand) + strlen(conference_api_sub_commands[i].psyntax) + 5; - switch_snprintf(cmd_str, sizeof(cmd_str), "add conference ::conference::conf_list_conferences %s", conf_api_sub_commands[i].pcommand); + switch_snprintf(cmd_str, sizeof(cmd_str), "add conference ::conference::conference_list_conferences %s", conference_api_sub_commands[i].pcommand); switch_console_set_complete(cmd_str); if (p != NULL) { @@ -235,10 +235,10 @@ switch_status_t conf_api_sub_syntax(char **syntax) if (tmp != NULL) { p = tmp; strcat(p, "\t\t"); - strcat(p, conf_api_sub_commands[i].pcommand); - if (!zstr(conf_api_sub_commands[i].psyntax)) { + strcat(p, conference_api_sub_commands[i].pcommand); + if (!zstr(conference_api_sub_commands[i].psyntax)) { strcat(p, " "); - strcat(p, conf_api_sub_commands[i].psyntax); + strcat(p, conference_api_sub_commands[i].psyntax); } if (i < CONFFUNCAPISIZE - 1) { strcat(p, "\n"); @@ -255,7 +255,7 @@ switch_status_t conf_api_sub_syntax(char **syntax) } -switch_status_t conf_api_sub_agc(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_agc(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { int level; int on = 0; @@ -301,22 +301,22 @@ switch_status_t conf_api_sub_agc(conference_obj_t *conference, switch_stream_han } -switch_status_t conf_api_sub_mute(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_mute(conference_member_t *member, switch_stream_handle_t *stream, void *data) { switch_event_t *event; if (member == NULL) return SWITCH_STATUS_GENERR; - conf_utils_member_clear_flag_locked(member, MFLAG_CAN_SPEAK); - conf_utils_member_clear_flag_locked(member, MFLAG_TALKING); + conference_utils_member_clear_flag_locked(member, MFLAG_CAN_SPEAK); + conference_utils_member_clear_flag_locked(member, MFLAG_TALKING); - if (member->session && !conf_utils_member_test_flag(member, MFLAG_MUTE_DETECT)) { + if (member->session && !conference_utils_member_test_flag(member, MFLAG_MUTE_DETECT)) { switch_core_media_hard_mute(member->session, SWITCH_TRUE); } if (!(data) || !strstr((char *) data, "quiet")) { - conf_utils_member_set_flag(member, MFLAG_INDICATE_MUTE); + conference_utils_member_set_flag(member, MFLAG_INDICATE_MUTE); } member->score_iir = 0; @@ -326,50 +326,50 @@ switch_status_t conf_api_sub_mute(conf_member_t *member, switch_stream_handle_t if (test_eflag(member->conference, EFLAG_MUTE_MEMBER) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "mute-member"); switch_event_fire(&event); } - if (conf_utils_test_flag(member->conference, CFLAG_POSITIONAL)) { - conf_al_gen_arc(member->conference, NULL); + if (conference_utils_test_flag(member->conference, CFLAG_POSITIONAL)) { + conference_al_gen_arc(member->conference, NULL); } - conf_member_update_status_field(member); + conference_member_update_status_field(member); return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_tmute(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_tmute(conference_member_t *member, switch_stream_handle_t *stream, void *data) { if (member == NULL) return SWITCH_STATUS_GENERR; - if (conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { - return conf_api_sub_mute(member, stream, data); + if (conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { + return conference_api_sub_mute(member, stream, data); } - return conf_api_sub_unmute(member, stream, data); + return conference_api_sub_unmute(member, stream, data); } -switch_status_t conf_api_sub_unmute(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_unmute(conference_member_t *member, switch_stream_handle_t *stream, void *data) { switch_event_t *event; if (member == NULL) return SWITCH_STATUS_GENERR; - conf_utils_member_set_flag_locked(member, MFLAG_CAN_SPEAK); + conference_utils_member_set_flag_locked(member, MFLAG_CAN_SPEAK); - if (member->session && !conf_utils_member_test_flag(member, MFLAG_MUTE_DETECT)) { + if (member->session && !conference_utils_member_test_flag(member, MFLAG_MUTE_DETECT)) { switch_core_media_hard_mute(member->session, SWITCH_FALSE); } if (!(data) || !strstr((char *) data, "quiet")) { - conf_utils_member_set_flag(member, MFLAG_INDICATE_UNMUTE); + conference_utils_member_set_flag(member, MFLAG_INDICATE_UNMUTE); } if (stream != NULL) { @@ -378,21 +378,21 @@ switch_status_t conf_api_sub_unmute(conf_member_t *member, switch_stream_handle_ if (test_eflag(member->conference, EFLAG_UNMUTE_MEMBER) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "unmute-member"); switch_event_fire(&event); } - if (conf_utils_test_flag(member->conference, CFLAG_POSITIONAL)) { - conf_al_gen_arc(member->conference, NULL); + if (conference_utils_test_flag(member->conference, CFLAG_POSITIONAL)) { + conference_al_gen_arc(member->conference, NULL); } - conf_member_update_status_field(member); + conference_member_update_status_field(member); return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_conf_video_vmute_snap(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_conference_video_vmute_snap(conference_member_t *member, switch_stream_handle_t *stream, void *data) { switch_bool_t clear = SWITCH_FALSE; @@ -416,12 +416,12 @@ switch_status_t conf_api_sub_conf_video_vmute_snap(conf_member_t *member, switch clear = SWITCH_TRUE; } - conf_video_vmute_snap(member, clear); + conference_video_vmute_snap(member, clear); return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_vmute(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_vmute(conference_member_t *member, switch_stream_handle_t *stream, void *data) { switch_event_t *event; @@ -432,8 +432,8 @@ switch_status_t conf_api_sub_vmute(conf_member_t *member, switch_stream_handle_t return SWITCH_STATUS_SUCCESS; } - conf_utils_member_clear_flag_locked(member, MFLAG_CAN_BE_SEEN); - conf_video_reset_video_bitrate_counters(member); + conference_utils_member_clear_flag_locked(member, MFLAG_CAN_BE_SEEN); + conference_video_reset_video_bitrate_counters(member); if (member->channel) { switch_channel_set_flag(member->channel, CF_VIDEO_PAUSE_READ); @@ -442,7 +442,7 @@ switch_status_t conf_api_sub_vmute(conf_member_t *member, switch_stream_handle_t } if (!(data) || !strstr((char *) data, "quiet")) { - conf_utils_member_set_flag(member, MFLAG_INDICATE_MUTE); + conference_utils_member_set_flag(member, MFLAG_INDICATE_MUTE); } if (stream != NULL) { @@ -451,32 +451,32 @@ switch_status_t conf_api_sub_vmute(conf_member_t *member, switch_stream_handle_t if (test_eflag(member->conference, EFLAG_MUTE_MEMBER) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "vmute-member"); switch_event_fire(&event); } - conf_member_update_status_field(member); + conference_member_update_status_field(member); return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_tvmute(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_tvmute(conference_member_t *member, switch_stream_handle_t *stream, void *data) { if (member == NULL) return SWITCH_STATUS_GENERR; - if (conf_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN)) { - return conf_api_sub_vmute(member, stream, data); + if (conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN)) { + return conference_api_sub_vmute(member, stream, data); } - return conf_api_sub_unvmute(member, stream, data); + return conference_api_sub_unvmute(member, stream, data); } -switch_status_t conf_api_sub_unvmute(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_unvmute(conference_member_t *member, switch_stream_handle_t *stream, void *data) { switch_event_t *event; mcu_layer_t *layer = NULL; @@ -491,12 +491,12 @@ switch_status_t conf_api_sub_unvmute(conf_member_t *member, switch_stream_handle if (member->conference->canvas) { switch_mutex_lock(member->conference->canvas->mutex); layer = &member->conference->canvas->layers[member->video_layer_id]; - conf_video_clear_layer(layer); + conference_video_clear_layer(layer); switch_mutex_unlock(member->conference->canvas->mutex); } - conf_utils_member_set_flag_locked(member, MFLAG_CAN_BE_SEEN); - conf_video_reset_video_bitrate_counters(member); + conference_utils_member_set_flag_locked(member, MFLAG_CAN_BE_SEEN); + conference_video_reset_video_bitrate_counters(member); if (member->channel) { switch_channel_clear_flag(member->channel, CF_VIDEO_PAUSE_READ); @@ -504,7 +504,7 @@ switch_status_t conf_api_sub_unvmute(conf_member_t *member, switch_stream_handle } if (!(data) || !strstr((char *) data, "quiet")) { - conf_utils_member_set_flag(member, MFLAG_INDICATE_UNMUTE); + conference_utils_member_set_flag(member, MFLAG_INDICATE_UNMUTE); } if (stream != NULL) { @@ -513,66 +513,66 @@ switch_status_t conf_api_sub_unvmute(conf_member_t *member, switch_stream_handle if (test_eflag(member->conference, EFLAG_UNMUTE_MEMBER) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "unvmute-member"); switch_event_fire(&event); } - conf_member_update_status_field(member); + conference_member_update_status_field(member); return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_deaf(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_deaf(conference_member_t *member, switch_stream_handle_t *stream, void *data) { switch_event_t *event; if (member == NULL) return SWITCH_STATUS_GENERR; - conf_utils_member_clear_flag_locked(member, MFLAG_CAN_HEAR); + conference_utils_member_clear_flag_locked(member, MFLAG_CAN_HEAR); if (stream != NULL) { stream->write_function(stream, "OK deaf %u\n", member->id); } if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "deaf-member"); switch_event_fire(&event); } - if (conf_utils_test_flag(member->conference, CFLAG_POSITIONAL)) { - conf_al_gen_arc(member->conference, NULL); + if (conference_utils_test_flag(member->conference, CFLAG_POSITIONAL)) { + conference_al_gen_arc(member->conference, NULL); } return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_undeaf(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_undeaf(conference_member_t *member, switch_stream_handle_t *stream, void *data) { switch_event_t *event; if (member == NULL) return SWITCH_STATUS_GENERR; - conf_utils_member_set_flag_locked(member, MFLAG_CAN_HEAR); + conference_utils_member_set_flag_locked(member, MFLAG_CAN_HEAR); if (stream != NULL) { stream->write_function(stream, "OK undeaf %u\n", member->id); } if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "undeaf-member"); switch_event_fire(&event); } - if (conf_utils_test_flag(member->conference, CFLAG_POSITIONAL)) { - conf_al_gen_arc(member->conference, NULL); + if (conference_utils_test_flag(member->conference, CFLAG_POSITIONAL)) { + conference_al_gen_arc(member->conference, NULL); } return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_hup(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_hup(conference_member_t *member, switch_stream_handle_t *stream, void *data) { switch_event_t *event; @@ -580,11 +580,11 @@ switch_status_t conf_api_sub_hup(conf_member_t *member, switch_stream_handle_t * return SWITCH_STATUS_GENERR; } - conf_utils_member_clear_flag(member, MFLAG_RUNNING); + conference_utils_member_clear_flag(member, MFLAG_RUNNING); if (member->conference && test_eflag(member->conference, EFLAG_HUP_MEMBER)) { if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "hup-member"); switch_event_fire(&event); } @@ -593,7 +593,7 @@ switch_status_t conf_api_sub_hup(conf_member_t *member, switch_stream_handle_t * return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_kick(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_kick(conference_member_t *member, switch_stream_handle_t *stream, void *data) { switch_event_t *event; @@ -601,8 +601,8 @@ switch_status_t conf_api_sub_kick(conf_member_t *member, switch_stream_handle_t return SWITCH_STATUS_GENERR; } - conf_utils_member_clear_flag(member, MFLAG_RUNNING); - conf_utils_member_set_flag_locked(member, MFLAG_KICKED); + conference_utils_member_clear_flag(member, MFLAG_RUNNING); + conference_utils_member_set_flag_locked(member, MFLAG_KICKED); switch_core_session_kill_channel(member->session, SWITCH_SIG_BREAK); if (data && member->session) { @@ -615,7 +615,7 @@ switch_status_t conf_api_sub_kick(conf_member_t *member, switch_stream_handle_t if (member->conference && test_eflag(member->conference, EFLAG_KICK_MEMBER)) { if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "kick-member"); switch_event_fire(&event); } @@ -625,7 +625,7 @@ switch_status_t conf_api_sub_kick(conf_member_t *member, switch_stream_handle_t } -switch_status_t conf_api_sub_dtmf(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_dtmf(conference_member_t *member, switch_stream_handle_t *stream, void *data) { switch_event_t *event; char *dtmf = (char *) data; @@ -658,7 +658,7 @@ switch_status_t conf_api_sub_dtmf(conf_member_t *member, switch_stream_handle_t if (test_eflag(member->conference, EFLAG_DTMF_MEMBER) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "dtmf-member"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Digits", dtmf); switch_event_fire(&event); @@ -667,7 +667,7 @@ switch_status_t conf_api_sub_dtmf(conf_member_t *member, switch_stream_handle_t return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_watching_canvas(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_watching_canvas(conference_member_t *member, switch_stream_handle_t *stream, void *data) { int index; char *val = (char *) data; @@ -677,7 +677,7 @@ switch_status_t conf_api_sub_watching_canvas(conf_member_t *member, switch_strea return SWITCH_STATUS_SUCCESS; } - index = conf_member_get_canvas_id(member, val, SWITCH_TRUE); + index = conference_member_get_canvas_id(member, val, SWITCH_TRUE); if (index < 0) { stream->write_function(stream, "-ERR Invalid DATA\n"); @@ -685,7 +685,7 @@ switch_status_t conf_api_sub_watching_canvas(conf_member_t *member, switch_strea } member->watching_canvas_id = index; - conf_video_reset_member_codec_index(member); + conference_video_reset_member_codec_index(member); switch_core_session_request_video_refresh(member->session); switch_core_media_gen_key_frame(member->session); member->conference->canvases[index]->send_keyframe = 10; @@ -695,7 +695,7 @@ switch_status_t conf_api_sub_watching_canvas(conf_member_t *member, switch_strea return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_canvas(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_canvas(conference_member_t *member, switch_stream_handle_t *stream, void *data) { int index; char *val = (char *) data; @@ -708,7 +708,7 @@ switch_status_t conf_api_sub_canvas(conf_member_t *member, switch_stream_handle_ switch_mutex_lock(member->conference->canvas_mutex); - index = conf_member_get_canvas_id(member, val, SWITCH_FALSE); + index = conference_member_get_canvas_id(member, val, SWITCH_FALSE); if (index < 0) { stream->write_function(stream, "-ERR Invalid DATA\n"); @@ -716,13 +716,13 @@ switch_status_t conf_api_sub_canvas(conf_member_t *member, switch_stream_handle_ return SWITCH_STATUS_SUCCESS; } - conf_video_detach_video_layer(member); + conference_video_detach_video_layer(member); member->canvas_id = index; member->layer_timeout = DEFAULT_LAYER_TIMEOUT; canvas = member->conference->canvases[member->canvas_id]; - conf_video_attach_video_layer(member, canvas, index); - conf_video_reset_member_codec_index(member); + conference_video_attach_video_layer(member, canvas, index); + conference_video_reset_member_codec_index(member); switch_mutex_unlock(member->conference->canvas_mutex); switch_core_session_request_video_refresh(member->session); @@ -736,7 +736,7 @@ switch_status_t conf_api_sub_canvas(conf_member_t *member, switch_stream_handle_ -switch_status_t conf_api_sub_layer(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_layer(conference_member_t *member, switch_stream_handle_t *stream, void *data) { int index = -1; mcu_canvas_t *canvas = NULL; @@ -783,7 +783,7 @@ switch_status_t conf_api_sub_layer(conf_member_t *member, switch_stream_handle_t index = canvas->total_layers - 1; } - conf_video_attach_video_layer(member, canvas, index); + conference_video_attach_video_layer(member, canvas, index); switch_mutex_unlock(member->conference->canvas_mutex); switch_core_session_request_video_refresh(member->session); @@ -796,7 +796,7 @@ switch_status_t conf_api_sub_layer(conf_member_t *member, switch_stream_handle_t } -switch_status_t conf_api_sub_energy(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_energy(conference_member_t *member, switch_stream_handle_t *stream, void *data) { switch_event_t *event; @@ -826,7 +826,7 @@ switch_status_t conf_api_sub_energy(conf_member_t *member, switch_stream_handle_ } if (test_eflag(member->conference, EFLAG_ENERGY_LEVEL_MEMBER) && data && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "energy-level-member"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Energy-Level", "%d", member->energy_level); switch_event_fire(&event); @@ -835,7 +835,7 @@ switch_status_t conf_api_sub_energy(conf_member_t *member, switch_stream_handle_ return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_auto_position(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_auto_position(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { #ifdef OPENAL_POSITIONING char *arg = NULL; @@ -848,18 +848,18 @@ switch_status_t conf_api_sub_auto_position(conference_obj_t *conference, switch_ if (!zstr(arg)) { if (!strcasecmp(arg, "on")) { - conf_utils_set_flag(conference, CFLAG_POSITIONAL); + conference_utils_set_flag(conference, CFLAG_POSITIONAL); set = 1; } else if (!strcasecmp(arg, "off")) { - conf_utils_clear_flag(conference, CFLAG_POSITIONAL); + conference_utils_clear_flag(conference, CFLAG_POSITIONAL); } } - if (set && conf_utils_test_flag(conference, CFLAG_POSITIONAL)) { - conf_al_gen_arc(conference, stream); + if (set && conference_utils_test_flag(conference, CFLAG_POSITIONAL)) { + conference_al_gen_arc(conference, stream); } - stream->write_function(stream, "+OK positioning %s\n", conf_utils_test_flag(conference, CFLAG_POSITIONAL) ? "on" : "off"); + stream->write_function(stream, "+OK positioning %s\n", conference_utils_test_flag(conference, CFLAG_POSITIONAL) ? "on" : "off"); #else stream->write_function(stream, "-ERR not supported\n"); @@ -869,7 +869,7 @@ switch_status_t conf_api_sub_auto_position(conference_obj_t *conference, switch_ return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_position(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_position(conference_member_t *member, switch_stream_handle_t *stream, void *data) { #ifndef OPENAL_POSITIONING if (stream) stream->write_function(stream, "-ERR not supported\n"); @@ -880,16 +880,16 @@ switch_status_t conf_api_sub_position(conf_member_t *member, switch_stream_handl return SWITCH_STATUS_GENERR; } - if (conf_utils_member_test_flag(member, MFLAG_NO_POSITIONAL)) { + if (conference_utils_member_test_flag(member, MFLAG_NO_POSITIONAL)) { if (stream) stream->write_function(stream, "%s has positional audio blocked.\n", switch_channel_get_name(member->channel)); return SWITCH_STATUS_SUCCESS; } if (!member->al) { - if (!conf_utils_member_test_flag(member, MFLAG_POSITIONAL) && member->conference->channels == 2) { - conf_utils_member_set_flag(member, MFLAG_POSITIONAL); - member->al = conf_al_create(member->pool); + if (!conference_utils_member_test_flag(member, MFLAG_POSITIONAL) && member->conference->channels == 2) { + conference_utils_member_set_flag(member, MFLAG_POSITIONAL); + member->al = conference_al_create(member->pool); } else { if (stream) { @@ -901,7 +901,7 @@ switch_status_t conf_api_sub_position(conf_member_t *member, switch_stream_handl if (data) { - if (conf_member_parse_position(member, data) != SWITCH_STATUS_SUCCESS) { + if (conference_member_parse_position(member, data) != SWITCH_STATUS_SUCCESS) { if (stream) { stream->write_function(stream, "invalid input!\n"); } @@ -916,7 +916,7 @@ switch_status_t conf_api_sub_position(conf_member_t *member, switch_stream_handl if (test_eflag(member->conference, EFLAG_SET_POSITION_MEMBER) && data && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "set-position-member"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Position", "%0.2f:%0.2f:%0.2f", member->al->pos_x, member->al->pos_y, member->al->pos_z); switch_event_fire(&event); @@ -927,7 +927,7 @@ switch_status_t conf_api_sub_position(conf_member_t *member, switch_stream_handl return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_volume_in(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_volume_in(conference_member_t *member, switch_stream_handle_t *stream, void *data) { switch_event_t *event; @@ -954,7 +954,7 @@ switch_status_t conf_api_sub_volume_in(conf_member_t *member, switch_stream_hand } if (test_eflag(member->conference, EFLAG_VOLUME_IN_MEMBER) && data && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "volume-in-member"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Volume-Level", "%d", member->volume_in_level); switch_event_fire(&event); @@ -963,7 +963,7 @@ switch_status_t conf_api_sub_volume_in(conf_member_t *member, switch_stream_hand return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_volume_out(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_volume_out(conference_member_t *member, switch_stream_handle_t *stream, void *data) { switch_event_t *event; @@ -989,7 +989,7 @@ switch_status_t conf_api_sub_volume_out(conf_member_t *member, switch_stream_han } if (test_eflag(member->conference, EFLAG_VOLUME_OUT_MEMBER) && data && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "volume-out-member"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Volume-Level", "%d", member->volume_out_level); switch_event_fire(&event); @@ -998,11 +998,11 @@ switch_status_t conf_api_sub_volume_out(conf_member_t *member, switch_stream_han return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_vid_bandwidth(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { int32_t i, video_write_bandwidth; - if (!conf_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING)) { + if (!conference_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING)) { stream->write_function(stream, "Bandwidth control not available.\n"); return SWITCH_STATUS_SUCCESS; } @@ -1024,7 +1024,7 @@ switch_status_t conf_api_sub_vid_bandwidth(conference_obj_t *conference, switch_ return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_vid_fps(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_vid_fps(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { float fps = 0; @@ -1040,7 +1040,7 @@ switch_status_t conf_api_sub_vid_fps(conference_obj_t *conference, switch_stream fps = atof(argv[2]); - if (conf_video_set_fps(conference, fps)) { + if (conference_video_set_fps(conference, fps)) { stream->write_function(stream, "FPS set to [%s]\n", argv[2]); } else { stream->write_function(stream, "Invalid FPS [%s]\n", argv[2]); @@ -1050,7 +1050,7 @@ switch_status_t conf_api_sub_vid_fps(conference_obj_t *conference, switch_stream } -switch_status_t conf_api_sub_write_png(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_write_png(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { switch_status_t status = SWITCH_STATUS_FALSE; mcu_canvas_t *canvas = NULL; @@ -1081,7 +1081,7 @@ switch_status_t conf_api_sub_write_png(conference_obj_t *conference, switch_stre return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_vid_layout(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_vid_layout(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { video_layout_t *vlayout = NULL; int idx = 0; @@ -1124,7 +1124,7 @@ switch_status_t conf_api_sub_vid_layout(conference_obj_t *conference, switch_str return SWITCH_STATUS_SUCCESS; } else { if (((lg = switch_core_hash_find(conference->layout_group_hash, group_name)))) { - vlayout = conf_video_find_best_layout(conference, lg, 0); + vlayout = conference_video_find_best_layout(conference, lg, 0); } if (!vlayout) { @@ -1164,7 +1164,7 @@ switch_status_t conf_api_sub_vid_layout(conference_obj_t *conference, switch_str return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_list(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_list(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { int ret_status = SWITCH_STATUS_GENERR; int count = 0; @@ -1200,8 +1200,8 @@ switch_status_t conf_api_sub_list(conference_obj_t *conference, switch_stream_ha } if (conference == NULL) { - switch_mutex_lock(conf_globals.hash_mutex); - for (hi = switch_core_hash_first(conf_globals.conference_hash); hi; hi = switch_core_hash_next(&hi)) { + switch_mutex_lock(conference_globals.hash_mutex); + for (hi = switch_core_hash_first(conference_globals.conference_hash); hi; hi = switch_core_hash_next(&hi)) { int fcount = 0; switch_core_hash_this(hi, NULL, NULL, &val); conference = (conference_obj_t *) val; @@ -1209,59 +1209,59 @@ switch_status_t conf_api_sub_list(conference_obj_t *conference, switch_stream_ha stream->write_function(stream, "Conference %s (%u member%s rate: %u%s flags: ", conference->name, conference->count, - conference->count == 1 ? "" : "s", conference->rate, conf_utils_test_flag(conference, CFLAG_LOCKED) ? " locked" : ""); + conference->count == 1 ? "" : "s", conference->rate, conference_utils_test_flag(conference, CFLAG_LOCKED) ? " locked" : ""); - if (conf_utils_test_flag(conference, CFLAG_LOCKED)) { + if (conference_utils_test_flag(conference, CFLAG_LOCKED)) { stream->write_function(stream, "%slocked", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_DESTRUCT)) { + if (conference_utils_test_flag(conference, CFLAG_DESTRUCT)) { stream->write_function(stream, "%sdestruct", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_WAIT_MOD)) { + if (conference_utils_test_flag(conference, CFLAG_WAIT_MOD)) { stream->write_function(stream, "%swait_mod", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_AUDIO_ALWAYS)) { + if (conference_utils_test_flag(conference, CFLAG_AUDIO_ALWAYS)) { stream->write_function(stream, "%saudio_always", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_RUNNING)) { + if (conference_utils_test_flag(conference, CFLAG_RUNNING)) { stream->write_function(stream, "%srunning", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_ANSWERED)) { + if (conference_utils_test_flag(conference, CFLAG_ANSWERED)) { stream->write_function(stream, "%sanswered", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_ENFORCE_MIN)) { + if (conference_utils_test_flag(conference, CFLAG_ENFORCE_MIN)) { stream->write_function(stream, "%senforce_min", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_BRIDGE_TO)) { + if (conference_utils_test_flag(conference, CFLAG_BRIDGE_TO)) { stream->write_function(stream, "%sbridge_to", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_DYNAMIC)) { + if (conference_utils_test_flag(conference, CFLAG_DYNAMIC)) { stream->write_function(stream, "%sdynamic", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_EXIT_SOUND)) { + if (conference_utils_test_flag(conference, CFLAG_EXIT_SOUND)) { stream->write_function(stream, "%sexit_sound", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_ENTER_SOUND)) { + if (conference_utils_test_flag(conference, CFLAG_ENTER_SOUND)) { stream->write_function(stream, "%senter_sound", fcount ? "|" : ""); fcount++; } @@ -1271,62 +1271,62 @@ switch_status_t conf_api_sub_list(conference_obj_t *conference, switch_stream_ha fcount++; } - if (conf_utils_test_flag(conference, CFLAG_VID_FLOOR)) { + if (conference_utils_test_flag(conference, CFLAG_VID_FLOOR)) { stream->write_function(stream, "%svideo_floor_only", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_RFC4579)) { + if (conference_utils_test_flag(conference, CFLAG_RFC4579)) { stream->write_function(stream, "%svideo_rfc4579", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_LIVEARRAY_SYNC)) { + if (conference_utils_test_flag(conference, CFLAG_LIVEARRAY_SYNC)) { stream->write_function(stream, "%slivearray_sync", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_VID_FLOOR_LOCK)) { + if (conference_utils_test_flag(conference, CFLAG_VID_FLOOR_LOCK)) { stream->write_function(stream, "%svideo_floor_lock", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_TRANSCODE_VIDEO)) { + if (conference_utils_test_flag(conference, CFLAG_TRANSCODE_VIDEO)) { stream->write_function(stream, "%stranscode_video", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_VIDEO_MUXING)) { + if (conference_utils_test_flag(conference, CFLAG_VIDEO_MUXING)) { stream->write_function(stream, "%svideo_muxing", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING)) { + if (conference_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING)) { stream->write_function(stream, "%sminimize_video_encoding", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_MANAGE_INBOUND_VIDEO_BITRATE)) { + if (conference_utils_test_flag(conference, CFLAG_MANAGE_INBOUND_VIDEO_BITRATE)) { stream->write_function(stream, "%smanage_inbound_bitrate", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_JSON_STATUS)) { + if (conference_utils_test_flag(conference, CFLAG_JSON_STATUS)) { stream->write_function(stream, "%sjson_status", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_VIDEO_BRIDGE_FIRST_TWO)) { + if (conference_utils_test_flag(conference, CFLAG_VIDEO_BRIDGE_FIRST_TWO)) { stream->write_function(stream, "%svideo_bridge_first_two", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_VIDEO_REQUIRED_FOR_CANVAS)) { + if (conference_utils_test_flag(conference, CFLAG_VIDEO_REQUIRED_FOR_CANVAS)) { stream->write_function(stream, "%svideo_required_for_canvas", fcount ? "|" : ""); fcount++; } - if (conf_utils_test_flag(conference, CFLAG_PERSONAL_CANVAS)) { + if (conference_utils_test_flag(conference, CFLAG_PERSONAL_CANVAS)) { stream->write_function(stream, "%spersonal_canvas", fcount ? "|" : ""); fcount++; } @@ -1340,19 +1340,19 @@ switch_status_t conf_api_sub_list(conference_obj_t *conference, switch_stream_ha count++; if (!summary) { if (pretty) { - conf_list_pretty(conference, stream); + conference_list_pretty(conference, stream); } else { conference_list(conference, stream, d); } } } - switch_mutex_unlock(conf_globals.hash_mutex); + switch_mutex_unlock(conference_globals.hash_mutex); } else { count++; if (countonly) { - conf_list_count_only(conference, stream); + conference_list_count_only(conference, stream); } else if (pretty) { - conf_list_pretty(conference, stream); + conference_list_pretty(conference, stream); } else { conference_list(conference, stream, d); } @@ -1367,7 +1367,7 @@ switch_status_t conf_api_sub_list(conference_obj_t *conference, switch_stream_ha return ret_status; } -switch_status_t conf_api_sub_floor(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_floor(conference_member_t *member, switch_stream_handle_t *stream, void *data) { if (member == NULL) @@ -1376,12 +1376,12 @@ switch_status_t conf_api_sub_floor(conf_member_t *member, switch_stream_handle_t switch_mutex_lock(member->conference->mutex); if (member->conference->floor_holder == member) { - conf_member_set_floor_holder(member->conference, NULL); + conference_member_set_floor_holder(member->conference, NULL); if (stream != NULL) { stream->write_function(stream, "OK floor none\n"); } } else if (member->conference->floor_holder == NULL) { - conf_member_set_floor_holder(member->conference, member); + conference_member_set_floor_holder(member->conference, member); if (stream != NULL) { stream->write_function(stream, "OK floor %u\n", member->id); } @@ -1396,18 +1396,18 @@ switch_status_t conf_api_sub_floor(conf_member_t *member, switch_stream_handle_t return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_clear_vid_floor(conference_obj_t *conference, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_clear_vid_floor(conference_obj_t *conference, switch_stream_handle_t *stream, void *data) { switch_mutex_lock(conference->mutex); - conf_utils_clear_flag(conference, CFLAG_VID_FLOOR_LOCK); - //conf_video_set_floor_holder(conference, NULL); + conference_utils_clear_flag(conference, CFLAG_VID_FLOOR_LOCK); + //conference_video_set_floor_holder(conference, NULL); switch_mutex_unlock(conference->mutex); return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_vid_mute_img(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_vid_mute_img(conference_member_t *member, switch_stream_handle_t *stream, void *data) { char *text = (char *) data; mcu_layer_t *layer = NULL; @@ -1447,7 +1447,7 @@ switch_status_t conf_api_sub_vid_mute_img(conf_member_t *member, switch_stream_h } -switch_status_t conf_api_sub_vid_logo_img(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_vid_logo_img(conference_member_t *member, switch_stream_handle_t *stream, void *data) { char *text = (char *) data; mcu_layer_t *layer = NULL; @@ -1473,7 +1473,7 @@ switch_status_t conf_api_sub_vid_logo_img(conf_member_t *member, switch_stream_h member->video_logo = switch_core_strdup(member->pool, text); } - conf_video_layer_set_logo(member, layer, text); + conference_video_layer_set_logo(member, layer, text); end: @@ -1485,7 +1485,7 @@ switch_status_t conf_api_sub_vid_logo_img(conf_member_t *member, switch_stream_h } -switch_status_t conf_api_sub_vid_res_id(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_vid_res_id(conference_member_t *member, switch_stream_handle_t *stream, void *data) { char *text = (char *) data; //mcu_layer_t *layer = NULL; @@ -1519,7 +1519,7 @@ switch_status_t conf_api_sub_vid_res_id(conf_member_t *member, switch_stream_han stream->write_function(stream, "+OK reservation_id %s\n", text); } - conf_video_detach_video_layer(member); + conference_video_detach_video_layer(member); switch_mutex_unlock(member->conference->canvas->mutex); @@ -1527,7 +1527,7 @@ switch_status_t conf_api_sub_vid_res_id(conf_member_t *member, switch_stream_han } -switch_status_t conf_api_sub_vid_banner(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_vid_banner(conference_member_t *member, switch_stream_handle_t *stream, void *data) { mcu_layer_t *layer = NULL; char *text = (char *) data; @@ -1558,7 +1558,7 @@ switch_status_t conf_api_sub_vid_banner(conf_member_t *member, switch_stream_han member->video_banner_text = switch_core_strdup(member->pool, text); - conf_video_layer_set_banner(member, layer, NULL); + conference_video_layer_set_banner(member, layer, NULL); stream->write_function(stream, "+OK\n"); @@ -1569,7 +1569,7 @@ switch_status_t conf_api_sub_vid_banner(conf_member_t *member, switch_stream_han return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_vid_floor(conf_member_t *member, switch_stream_handle_t *stream, void *data) +switch_status_t conference_api_sub_vid_floor(conference_member_t *member, switch_stream_handle_t *stream, void *data) { int force = 0; @@ -1587,10 +1587,10 @@ switch_status_t conf_api_sub_vid_floor(conf_member_t *member, switch_stream_hand force = 1; } - if (member->conference->video_floor_holder == member->id && conf_utils_test_flag(member->conference, CFLAG_VID_FLOOR_LOCK)) { - conf_utils_clear_flag(member->conference, CFLAG_VID_FLOOR_LOCK); + if (member->conference->video_floor_holder == member->id && conference_utils_test_flag(member->conference, CFLAG_VID_FLOOR_LOCK)) { + conference_utils_clear_flag(member->conference, CFLAG_VID_FLOOR_LOCK); - conf_member_set_floor_holder(member->conference, member); + conference_member_set_floor_holder(member->conference, member); if (stream == NULL) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "conference %s OK video floor auto\n", member->conference->name); } else { @@ -1598,8 +1598,8 @@ switch_status_t conf_api_sub_vid_floor(conf_member_t *member, switch_stream_hand } } else if (force || member->conference->video_floor_holder == 0) { - conf_utils_set_flag(member->conference, CFLAG_VID_FLOOR_LOCK); - conf_video_set_floor_holder(member->conference, member, SWITCH_TRUE); + conference_utils_set_flag(member->conference, CFLAG_VID_FLOOR_LOCK); + conference_video_set_floor_holder(member->conference, member, SWITCH_TRUE); if (test_eflag(member->conference, EFLAG_FLOOR_CHANGE)) { if (stream == NULL) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "conference %s OK video floor %d %s\n", @@ -1624,11 +1624,11 @@ switch_status_t conf_api_sub_vid_floor(conf_member_t *member, switch_stream_hand -switch_status_t conf_api_sub_file_seek(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_file_seek(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { if (argc == 3) { switch_mutex_lock(conference->mutex); - conf_fnode_seek(conference->fnode, stream, argv[2]); + conference_fnode_seek(conference->fnode, stream, argv[2]); switch_mutex_unlock(conference->mutex); return SWITCH_STATUS_SUCCESS; @@ -1636,14 +1636,14 @@ switch_status_t conf_api_sub_file_seek(conference_obj_t *conference, switch_stre if (argc == 4) { uint32_t id = atoi(argv[3]); - conf_member_t *member = conf_member_get(conference, id); + conference_member_t *member = conference_member_get(conference, id); if (member == NULL) { stream->write_function(stream, "Member: %u not found.\n", id); return SWITCH_STATUS_GENERR; } switch_mutex_lock(member->fnode_mutex); - conf_fnode_seek(member->fnode, stream, argv[2]); + conference_fnode_seek(member->fnode, stream, argv[2]); switch_mutex_unlock(member->fnode_mutex); switch_thread_rwlock_unlock(member->rwlock); return SWITCH_STATUS_SUCCESS; @@ -1652,7 +1652,7 @@ switch_status_t conf_api_sub_file_seek(conference_obj_t *conference, switch_stre return SWITCH_STATUS_GENERR; } -switch_status_t conf_api_sub_play(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_play(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { int ret_status = SWITCH_STATUS_GENERR; switch_event_t *event; @@ -1671,7 +1671,7 @@ switch_status_t conf_api_sub_play(conference_obj_t *conference, switch_stream_ha stream->write_function(stream, "(play) Playing file %s\n", argv[2]); if (test_eflag(conference, EFLAG_PLAY_FILE) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); if (conference->fnode && conference->fnode->fh.params) { switch_event_merge(event, conference->fnode->fh.params); @@ -1688,19 +1688,19 @@ switch_status_t conf_api_sub_play(conference_obj_t *conference, switch_stream_ha ret_status = SWITCH_STATUS_SUCCESS; } else if (argc >= 4) { uint32_t id = atoi(argv[3]); - conf_member_t *member; + conference_member_t *member; switch_bool_t mux = SWITCH_TRUE; if (argc > 4 && !strcasecmp(argv[4], "nomux")) { mux = SWITCH_FALSE; } - if ((member = conf_member_get(conference, id))) { - if (conf_member_play_file(member, argv[2], 0, mux) == SWITCH_STATUS_SUCCESS) { + if ((member = conference_member_get(conference, id))) { + if (conference_member_play_file(member, argv[2], 0, mux) == SWITCH_STATUS_SUCCESS) { stream->write_function(stream, "(play) Playing file %s to member %u\n", argv[2], id); if (test_eflag(conference, EFLAG_PLAY_FILE_MEMBER) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); if (member->fnode->fh.params) { switch_event_merge(event, member->fnode->fh.params); @@ -1723,7 +1723,7 @@ switch_status_t conf_api_sub_play(conference_obj_t *conference, switch_stream_ha return ret_status; } -switch_status_t conf_api_sub_say(conference_obj_t *conference, switch_stream_handle_t *stream, const char *text) +switch_status_t conference_api_sub_say(conference_obj_t *conference, switch_stream_handle_t *stream, const char *text) { switch_event_t *event; @@ -1732,14 +1732,14 @@ switch_status_t conf_api_sub_say(conference_obj_t *conference, switch_stream_han return SWITCH_STATUS_GENERR; } - if (conf_say(conference, text, 0) != SWITCH_STATUS_SUCCESS) { + if (conference_say(conference, text, 0) != SWITCH_STATUS_SUCCESS) { stream->write_function(stream, "(say) Error!\n"); return SWITCH_STATUS_GENERR; } stream->write_function(stream, "(say) OK\n"); if (test_eflag(conference, EFLAG_SPEAK_TEXT) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "speak-text"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Text", text); switch_event_fire(&event); @@ -1747,14 +1747,14 @@ switch_status_t conf_api_sub_say(conference_obj_t *conference, switch_stream_han return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_saymember(conference_obj_t *conference, switch_stream_handle_t *stream, const char *text) +switch_status_t conference_api_sub_saymember(conference_obj_t *conference, switch_stream_handle_t *stream, const char *text) { int ret_status = SWITCH_STATUS_GENERR; char *expanded = NULL; char *start_text = NULL; char *workspace = NULL; uint32_t id = 0; - conf_member_t *member = NULL; + conference_member_t *member = NULL; switch_event_t *event; if (zstr(text)) { @@ -1779,7 +1779,7 @@ switch_status_t conf_api_sub_saymember(conference_obj_t *conference, switch_stre goto done; } - if (!(member = conf_member_get(conference, id))) { + if (!(member = conference_member_get(conference, id))) { stream->write_function(stream, "(saymember) Unknown Member %u!\n", id); goto done; } @@ -1790,7 +1790,7 @@ switch_status_t conf_api_sub_saymember(conference_obj_t *conference, switch_stre expanded = NULL; } - if (!text || conf_member_say(member, (char *) text, 0) != SWITCH_STATUS_SUCCESS) { + if (!text || conference_member_say(member, (char *) text, 0) != SWITCH_STATUS_SUCCESS) { stream->write_function(stream, "(saymember) Error!\n"); goto done; } @@ -1798,7 +1798,7 @@ switch_status_t conf_api_sub_saymember(conference_obj_t *conference, switch_stre stream->write_function(stream, "(saymember) OK\n"); if (test_eflag(member->conference, EFLAG_SPEAK_TEXT_MEMBER) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "speak-text-member"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Text", text); switch_event_fire(&event); @@ -1816,7 +1816,7 @@ switch_status_t conf_api_sub_saymember(conference_obj_t *conference, switch_stre return ret_status; } -switch_status_t conf_api_sub_stop(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_stop(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { uint8_t current = 0, all = 0, async = 0; @@ -1836,10 +1836,10 @@ switch_status_t conf_api_sub_stop(conference_obj_t *conference, switch_stream_ha if (argc == 4) { uint32_t id = atoi(argv[3]); - conf_member_t *member; + conference_member_t *member; - if ((member = conf_member_get(conference, id))) { - uint32_t stopped = conf_member_stop_file(member, async ? FILE_STOP_ASYNC : current ? FILE_STOP_CURRENT : FILE_STOP_ALL); + if ((member = conference_member_get(conference, id))) { + uint32_t stopped = conference_member_stop_file(member, async ? FILE_STOP_ASYNC : current ? FILE_STOP_CURRENT : FILE_STOP_ALL); stream->write_function(stream, "Stopped %u files.\n", stopped); switch_thread_rwlock_unlock(member->rwlock); } else { @@ -1852,7 +1852,7 @@ switch_status_t conf_api_sub_stop(conference_obj_t *conference, switch_stream_ha return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_relate(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_relate(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { uint8_t nospeak = 0, nohear = 0, sendvideo = 0, clear = 0; @@ -1860,7 +1860,7 @@ switch_status_t conf_api_sub_relate(conference_obj_t *conference, switch_stream_ switch_assert(stream != NULL); if (argc <= 3) { - conf_member_t *member; + conference_member_t *member; switch_mutex_lock(conference->mutex); @@ -1904,17 +1904,17 @@ switch_status_t conf_api_sub_relate(conference_obj_t *conference, switch_stream_ } if (clear) { - conf_member_t *member = NULL, *other_member = NULL; + conference_member_t *member = NULL, *other_member = NULL; uint32_t id = atoi(argv[2]); uint32_t oid = atoi(argv[3]); - if ((member = conf_member_get(conference, id))) { - conf_member_del_relationship(member, oid); - other_member = conf_member_get(conference, oid); + if ((member = conference_member_get(conference, id))) { + conference_member_del_relationship(member, oid); + other_member = conference_member_get(conference, oid); if (other_member) { - if (conf_utils_member_test_flag(other_member, MFLAG_RECEIVING_VIDEO)) { - conf_utils_member_clear_flag(other_member, MFLAG_RECEIVING_VIDEO); + if (conference_utils_member_test_flag(other_member, MFLAG_RECEIVING_VIDEO)) { + conference_utils_member_clear_flag(other_member, MFLAG_RECEIVING_VIDEO); if (conference->floor_holder) { switch_core_session_request_video_refresh(conference->floor_holder->session); } @@ -1931,40 +1931,40 @@ switch_status_t conf_api_sub_relate(conference_obj_t *conference, switch_stream_ } if (nospeak || nohear || sendvideo) { - conf_member_t *member = NULL, *other_member = NULL; + conference_member_t *member = NULL, *other_member = NULL; uint32_t id = atoi(argv[2]); uint32_t oid = atoi(argv[3]); - if ((member = conf_member_get(conference, id))) { - other_member = conf_member_get(conference, oid); + if ((member = conference_member_get(conference, id))) { + other_member = conference_member_get(conference, oid); } if (member && other_member) { conference_relationship_t *rel = NULL; - if (sendvideo && conf_utils_member_test_flag(other_member, MFLAG_RECEIVING_VIDEO) && (! (nospeak || nohear))) { + if (sendvideo && conference_utils_member_test_flag(other_member, MFLAG_RECEIVING_VIDEO) && (! (nospeak || nohear))) { stream->write_function(stream, "member %d already receiving video", oid); goto skip; } - if ((rel = conf_member_get_relationship(member, other_member))) { + if ((rel = conference_member_get_relationship(member, other_member))) { rel->flags = 0; } else { - rel = conf_member_add_relationship(member, oid); + rel = conference_member_add_relationship(member, oid); } if (rel) { switch_set_flag(rel, RFLAG_CAN_SPEAK | RFLAG_CAN_HEAR); if (nospeak) { switch_clear_flag(rel, RFLAG_CAN_SPEAK); - conf_utils_member_clear_flag_locked(member, MFLAG_TALKING); + conference_utils_member_clear_flag_locked(member, MFLAG_TALKING); } if (nohear) { switch_clear_flag(rel, RFLAG_CAN_HEAR); } if (sendvideo) { switch_set_flag(rel, RFLAG_CAN_SEND_VIDEO); - conf_utils_member_set_flag(other_member, MFLAG_RECEIVING_VIDEO); + conference_utils_member_set_flag(other_member, MFLAG_RECEIVING_VIDEO); switch_core_session_request_video_refresh(member->session); } @@ -1989,7 +1989,7 @@ skip: return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_lock(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_lock(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { switch_event_t *event; @@ -2000,10 +2000,10 @@ switch_status_t conf_api_sub_lock(conference_obj_t *conference, switch_stream_ha conference_file_play(conference, conference->is_locked_sound, CONF_DEFAULT_LEADIN, NULL, 0); } - conf_utils_set_flag_locked(conference, CFLAG_LOCKED); + conference_utils_set_flag_locked(conference, CFLAG_LOCKED); stream->write_function(stream, "OK %s locked\n", argv[0]); if (test_eflag(conference, EFLAG_LOCK) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "lock"); switch_event_fire(&event); } @@ -2011,7 +2011,7 @@ switch_status_t conf_api_sub_lock(conference_obj_t *conference, switch_stream_ha return 0; } -switch_status_t conf_api_sub_unlock(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_unlock(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { switch_event_t *event; @@ -2022,10 +2022,10 @@ switch_status_t conf_api_sub_unlock(conference_obj_t *conference, switch_stream_ conference_file_play(conference, conference->is_unlocked_sound, CONF_DEFAULT_LEADIN, NULL, 0); } - conf_utils_clear_flag_locked(conference, CFLAG_LOCKED); + conference_utils_clear_flag_locked(conference, CFLAG_LOCKED); stream->write_function(stream, "OK %s unlocked\n", argv[0]); if (test_eflag(conference, EFLAG_UNLOCK) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "unlock"); switch_event_fire(&event); } @@ -2033,7 +2033,7 @@ switch_status_t conf_api_sub_unlock(conference_obj_t *conference, switch_stream_ return 0; } -switch_status_t conf_api_sub_exit_sound(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_exit_sound(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { switch_event_t *event; @@ -2046,18 +2046,18 @@ switch_status_t conf_api_sub_exit_sound(conference_obj_t *conference, switch_str } if ( !strcasecmp(argv[2], "on") ) { - conf_utils_set_flag_locked(conference, CFLAG_EXIT_SOUND); + conference_utils_set_flag_locked(conference, CFLAG_EXIT_SOUND); stream->write_function(stream, "OK %s exit sounds on (%s)\n", argv[0], conference->exit_sound); if (test_eflag(conference, EFLAG_LOCK) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "exit-sounds-on"); switch_event_fire(&event); } } else if ( !strcasecmp(argv[2], "off") || !strcasecmp(argv[2], "none") ) { - conf_utils_clear_flag_locked(conference, CFLAG_EXIT_SOUND); + conference_utils_clear_flag_locked(conference, CFLAG_EXIT_SOUND); stream->write_function(stream, "OK %s exit sounds off (%s)\n", argv[0], conference->exit_sound); if (test_eflag(conference, EFLAG_LOCK) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "exit-sounds-off"); switch_event_fire(&event); } @@ -2070,7 +2070,7 @@ switch_status_t conf_api_sub_exit_sound(conference_obj_t *conference, switch_str conference->exit_sound = switch_core_strdup(conference->pool, argv[3]); stream->write_function(stream, "OK %s exit sound file set to %s\n", argv[0], conference->exit_sound); if (test_eflag(conference, EFLAG_LOCK) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "exit-sound-file-changed"); switch_event_fire(&event); } @@ -2084,7 +2084,7 @@ switch_status_t conf_api_sub_exit_sound(conference_obj_t *conference, switch_str } -switch_status_t conf_api_sub_enter_sound(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_enter_sound(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { switch_event_t *event; @@ -2097,18 +2097,18 @@ switch_status_t conf_api_sub_enter_sound(conference_obj_t *conference, switch_st } if ( !strcasecmp(argv[2], "on") ) { - conf_utils_set_flag_locked(conference, CFLAG_ENTER_SOUND); + conference_utils_set_flag_locked(conference, CFLAG_ENTER_SOUND); stream->write_function(stream, "OK %s enter sounds on (%s)\n", argv[0], conference->enter_sound); if (test_eflag(conference, EFLAG_LOCK) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "enter-sounds-on"); switch_event_fire(&event); } } else if ( !strcasecmp(argv[2], "off") || !strcasecmp(argv[2], "none") ) { - conf_utils_clear_flag_locked(conference, CFLAG_ENTER_SOUND); + conference_utils_clear_flag_locked(conference, CFLAG_ENTER_SOUND); stream->write_function(stream, "OK %s enter sounds off (%s)\n", argv[0], conference->enter_sound); if (test_eflag(conference, EFLAG_LOCK) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "enter-sounds-off"); switch_event_fire(&event); } @@ -2120,7 +2120,7 @@ switch_status_t conf_api_sub_enter_sound(conference_obj_t *conference, switch_st conference->enter_sound = switch_core_strdup(conference->pool, argv[3]); stream->write_function(stream, "OK %s enter sound file set to %s\n", argv[0], conference->enter_sound); if (test_eflag(conference, EFLAG_LOCK) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "enter-sound-file-changed"); switch_event_fire(&event); } @@ -2134,7 +2134,7 @@ switch_status_t conf_api_sub_enter_sound(conference_obj_t *conference, switch_st } -switch_status_t conf_api_sub_dial(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_dial(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { switch_call_cause_t cause; char *tmp; @@ -2153,16 +2153,16 @@ switch_status_t conf_api_sub_dial(conference_obj_t *conference, switch_stream_ha } if (conference) { - conf_outcall(conference, NULL, NULL, argv[2], 60, NULL, argv[4], argv[3], NULL, &cause, NULL, NULL); + conference_outcall(conference, NULL, NULL, argv[2], 60, NULL, argv[4], argv[3], NULL, &cause, NULL, NULL); } else { - conf_outcall(NULL, argv[0], NULL, argv[2], 60, NULL, argv[4], argv[3], NULL, &cause, NULL, NULL); + conference_outcall(NULL, argv[0], NULL, argv[2], 60, NULL, argv[4], argv[3], NULL, &cause, NULL, NULL); } stream->write_function(stream, "Call Requested: result: [%s]\n", switch_channel_cause2str(cause)); return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_bgdial(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_bgdial(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { switch_uuid_t uuid; char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; @@ -2178,9 +2178,9 @@ switch_status_t conf_api_sub_bgdial(conference_obj_t *conference, switch_stream_ switch_uuid_format(uuid_str, &uuid); if (conference) { - conf_outcall_bg(conference, NULL, NULL, argv[2], 60, NULL, argv[4], argv[3], uuid_str, NULL, NULL, NULL); + conference_outcall_bg(conference, NULL, NULL, argv[2], 60, NULL, argv[4], argv[3], uuid_str, NULL, NULL, NULL); } else { - conf_outcall_bg(NULL, argv[0], NULL, argv[2], 60, NULL, argv[4], argv[3], uuid_str, NULL, NULL, NULL); + conference_outcall_bg(NULL, argv[0], NULL, argv[2], 60, NULL, argv[4], argv[3], uuid_str, NULL, NULL, NULL); } stream->write_function(stream, "OK Job-UUID: %s\n", uuid_str); @@ -2190,10 +2190,10 @@ switch_status_t conf_api_sub_bgdial(conference_obj_t *conference, switch_stream_ -switch_status_t conf_api_sub_transfer(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_transfer(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { switch_status_t ret_status = SWITCH_STATUS_SUCCESS; - char *conf_name = NULL, *profile_name; + char *conference_name = NULL, *profile_name; switch_event_t *params = NULL; switch_assert(conference != NULL); @@ -2202,38 +2202,38 @@ switch_status_t conf_api_sub_transfer(conference_obj_t *conference, switch_strea if (argc > 3 && !zstr(argv[2])) { int x; - conf_name = strdup(argv[2]); + conference_name = strdup(argv[2]); - if ((profile_name = strchr(conf_name, '@'))) { + if ((profile_name = strchr(conference_name, '@'))) { *profile_name++ = '\0'; } else { profile_name = "default"; } for (x = 3; x < argc; x++) { - conf_member_t *member = NULL; + conference_member_t *member = NULL; uint32_t id = atoi(argv[x]); switch_channel_t *channel; switch_event_t *event; char *xdest = NULL; - if (!id || !(member = conf_member_get(conference, id))) { + if (!id || !(member = conference_member_get(conference, id))) { stream->write_function(stream, "No Member %u in conference %s.\n", id, conference->name); continue; } channel = switch_core_session_get_channel(member->session); - xdest = switch_core_session_sprintf(member->session, "conference:%s@%s", conf_name, profile_name); + xdest = switch_core_session_sprintf(member->session, "conference:%s@%s", conference_name, profile_name); switch_ivr_session_transfer(member->session, xdest, "inline", NULL); - switch_channel_set_variable(channel, "last_transfered_conference", conf_name); + switch_channel_set_variable(channel, "last_transfered_conference", conference_name); stream->write_function(stream, "OK Member '%d' sent to conference %s.\n", member->id, argv[2]); /* tell them what happened */ if (test_eflag(conference, EFLAG_TRANSFER) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Old-Conference-Name", conference->name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "New-Conference-Name", argv[3]); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "transfer"); @@ -2250,14 +2250,14 @@ switch_status_t conf_api_sub_transfer(conference_obj_t *conference, switch_strea switch_event_destroy(¶ms); } - switch_safe_free(conf_name); + switch_safe_free(conference_name); return ret_status; } -switch_status_t conf_api_sub_check_record(conference_obj_t *conference, switch_stream_handle_t *stream, int arc, char **argv) +switch_status_t conference_api_sub_check_record(conference_obj_t *conference, switch_stream_handle_t *stream, int arc, char **argv) { - conf_record_t *rec; + conference_record_t *rec; int x = 0; switch_mutex_lock(conference->flag_mutex); @@ -2274,7 +2274,7 @@ switch_status_t conf_api_sub_check_record(conference_obj_t *conference, switch_s return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_record(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_record(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { switch_assert(conference != NULL); switch_assert(stream != NULL); @@ -2286,11 +2286,11 @@ switch_status_t conf_api_sub_record(conference_obj_t *conference, switch_stream_ stream->write_function(stream, "Record file %s\n", argv[2]); conference->record_filename = switch_core_strdup(conference->pool, argv[2]); conference->record_count++; - conf_record_launch_thread(conference, argv[2], SWITCH_FALSE); + conference_record_launch_thread(conference, argv[2], SWITCH_FALSE); return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_norecord(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_norecord(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { int all, before = conference->record_count, ttl = 0; switch_event_t *event; @@ -2303,12 +2303,12 @@ switch_status_t conf_api_sub_norecord(conference_obj_t *conference, switch_strea all = (strcasecmp(argv[2], "all") == 0); - if (!conf_record_stop(conference, stream, all ? NULL : argv[2]) && !all) { + if (!conference_record_stop(conference, stream, all ? NULL : argv[2]) && !all) { stream->write_function(stream, "non-existant recording '%s'\n", argv[2]); } else { if (test_eflag(conference, EFLAG_RECORD) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "stop-recording"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Path", all ? "all" : argv[2]); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Other-Recordings", conference->record_count ? "true" : "false"); @@ -2322,7 +2322,7 @@ switch_status_t conf_api_sub_norecord(conference_obj_t *conference, switch_strea return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_pauserec(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_pauserec(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { switch_event_t *event; recording_action_type_t action; @@ -2345,12 +2345,12 @@ switch_status_t conf_api_sub_pauserec(conference_obj_t *conference, switch_strea switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s recording file %s\n", action == REC_ACTION_PAUSE ? "Pause" : "Resume", argv[2]); - if (!conf_record_action(conference, argv[2], action)) { + if (!conference_record_action(conference, argv[2], action)) { stream->write_function(stream, "non-existant recording '%s'\n", argv[2]); } else { if (test_eflag(conference, EFLAG_RECORD) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); if (action == REC_ACTION_PAUSE) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "pause-recording"); } else { @@ -2365,7 +2365,7 @@ switch_status_t conf_api_sub_pauserec(conference_obj_t *conference, switch_strea return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_api_sub_recording(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_recording(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { switch_assert(conference != NULL); switch_assert(stream != NULL); @@ -2379,36 +2379,36 @@ switch_status_t conf_api_sub_recording(conference_obj_t *conference, switch_stre if (argc <= 3) { /* It means that old syntax is used */ - return conf_api_sub_record(conference,stream,argc,argv); + return conference_api_sub_record(conference,stream,argc,argv); } else { /* for new syntax call existing functions with fixed parameter list */ if (strcasecmp(argv[2], "start") == 0) { argv[1] = argv[2]; argv[2] = argv[3]; - return conf_api_sub_record(conference,stream,4,argv); + return conference_api_sub_record(conference,stream,4,argv); } else if (strcasecmp(argv[2], "stop") == 0) { argv[1] = argv[2]; argv[2] = argv[3]; - return conf_api_sub_norecord(conference,stream,4,argv); + return conference_api_sub_norecord(conference,stream,4,argv); } else if (strcasecmp(argv[2], "check") == 0) { argv[1] = argv[2]; argv[2] = argv[3]; - return conf_api_sub_check_record(conference,stream,4,argv); + return conference_api_sub_check_record(conference,stream,4,argv); } else if (strcasecmp(argv[2], "pause") == 0) { argv[1] = argv[2]; argv[2] = argv[3]; - return conf_api_sub_pauserec(conference,stream,4,argv); + return conference_api_sub_pauserec(conference,stream,4,argv); } else if (strcasecmp(argv[2], "resume") == 0) { argv[1] = argv[2]; argv[2] = argv[3]; - return conf_api_sub_pauserec(conference,stream,4,argv); + return conference_api_sub_pauserec(conference,stream,4,argv); } else { return SWITCH_STATUS_GENERR; } } } -switch_status_t conf_api_sub_file_vol(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_file_vol(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { if (argc >= 1) { conference_file_node_t *fnode; @@ -2454,7 +2454,7 @@ switch_status_t conf_api_sub_file_vol(conference_obj_t *conference, switch_strea } } -switch_status_t conf_api_sub_pin(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_pin(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { switch_assert(conference != NULL); switch_assert(stream != NULL); @@ -2477,7 +2477,7 @@ switch_status_t conf_api_sub_pin(conference_obj_t *conference, switch_stream_han } } -switch_status_t conf_api_sub_get(conference_obj_t *conference, +switch_status_t conference_api_sub_get(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { int ret_status = SWITCH_STATUS_GENERR; @@ -2514,16 +2514,16 @@ switch_status_t conf_api_sub_get(conference_obj_t *conference, conference->caller_id_number); } else if (strcasecmp(argv[2], "is_locked") == 0) { stream->write_function(stream, "%s", - conf_utils_test_flag(conference, CFLAG_LOCKED) ? "locked" : ""); - } else if (strcasecmp(argv[2], "endconf_grace_time") == 0) { + conference_utils_test_flag(conference, CFLAG_LOCKED) ? "locked" : ""); + } else if (strcasecmp(argv[2], "endconference_grace_time") == 0) { stream->write_function(stream, "%d", - conference->endconf_grace_time); + conference->endconference_grace_time); } else if (strcasecmp(argv[2], "uuid") == 0) { stream->write_function(stream, "%s", conference->uuid_str); } else if (strcasecmp(argv[2], "wait_mod") == 0) { stream->write_function(stream, "%s", - conf_utils_test_flag(conference, CFLAG_WAIT_MOD) ? "true" : ""); + conference_utils_test_flag(conference, CFLAG_WAIT_MOD) ? "true" : ""); } else { ret_status = SWITCH_STATUS_FALSE; } @@ -2532,7 +2532,7 @@ switch_status_t conf_api_sub_get(conference_obj_t *conference, return ret_status; } -switch_status_t conf_api_sub_set(conference_obj_t *conference, +switch_status_t conference_api_sub_set(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { int ret_status = SWITCH_STATUS_GENERR; @@ -2557,11 +2557,11 @@ switch_status_t conf_api_sub_set(conference_obj_t *conference, } else if (strcasecmp(argv[2], "caller_id_number") == 0) { stream->write_function(stream, "%s",conference->caller_id_number); conference->caller_id_number = switch_core_strdup(conference->pool, argv[3]); - } else if (strcasecmp(argv[2], "endconf_grace_time") == 0) { + } else if (strcasecmp(argv[2], "endconference_grace_time") == 0) { int new_gt = atoi(argv[3]); if (new_gt >= 0) { - stream->write_function(stream, "%d", conference->endconf_grace_time); - conference->endconf_grace_time = new_gt; + stream->write_function(stream, "%d", conference->endconference_grace_time); + conference->endconference_grace_time = new_gt; } else { ret_status = SWITCH_STATUS_FALSE; } @@ -2575,7 +2575,7 @@ switch_status_t conf_api_sub_set(conference_obj_t *conference, -switch_status_t conf_api_sub_xml_list(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +switch_status_t conference_api_sub_xml_list(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { int count = 0; switch_hash_index_t *hi; @@ -2588,8 +2588,8 @@ switch_status_t conf_api_sub_xml_list(conference_obj_t *conference, switch_strea switch_assert(x_conferences); if (conference == NULL) { - switch_mutex_lock(conf_globals.hash_mutex); - for (hi = switch_core_hash_first(conf_globals.conference_hash); hi; hi = switch_core_hash_next(&hi)) { + switch_mutex_lock(conference_globals.hash_mutex); + for (hi = switch_core_hash_first(conference_globals.conference_hash); hi; hi = switch_core_hash_next(&hi)) { switch_core_hash_this(hi, NULL, NULL, &val); conference = (conference_obj_t *) val; @@ -2597,15 +2597,15 @@ switch_status_t conf_api_sub_xml_list(conference_obj_t *conference, switch_strea switch_assert(conference); count++; - conf_xlist(conference, x_conference, off); + conference_xlist(conference, x_conference, off); } - switch_mutex_unlock(conf_globals.hash_mutex); + switch_mutex_unlock(conference_globals.hash_mutex); } else { x_conference = switch_xml_add_child_d(x_conferences, "conference", off++); switch_assert(conference); count++; - conf_xlist(conference, x_conference, off); + conference_xlist(conference, x_conference, off); } @@ -2622,7 +2622,7 @@ switch_status_t conf_api_sub_xml_list(conference_obj_t *conference, switch_strea -switch_status_t conf_api_dispatch(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv, const char *cmdline, int argn) +switch_status_t conference_api_dispatch(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv, const char *cmdline, int argn) { switch_status_t status = SWITCH_STATUS_FALSE; uint32_t i, found = 0; @@ -2631,18 +2631,18 @@ switch_status_t conf_api_dispatch(conference_obj_t *conference, switch_stream_ha /* loop through the command table to find a match */ for (i = 0; i < CONFFUNCAPISIZE && !found; i++) { - if (strcasecmp(argv[argn], conf_api_sub_commands[i].pname) == 0) { + if (strcasecmp(argv[argn], conference_api_sub_commands[i].pname) == 0) { found = 1; - switch (conf_api_sub_commands[i].fntype) { + switch (conference_api_sub_commands[i].fntype) { /* commands that we've broken the command line into arguments for */ case CONF_API_SUB_ARGS_SPLIT: { - conf_api_args_cmd_t pfn = (conf_api_args_cmd_t) conf_api_sub_commands[i].pfnapicmd; + conference_api_args_cmd_t pfn = (conference_api_args_cmd_t) conference_api_sub_commands[i].pfnapicmd; if (pfn(conference, stream, argc, argv) != SWITCH_STATUS_SUCCESS) { /* command returned error, so show syntax usage */ - stream->write_function(stream, "%s %s", conf_api_sub_commands[i].pcommand, conf_api_sub_commands[i].psyntax); + stream->write_function(stream, "%s %s", conference_api_sub_commands[i].pcommand, conference_api_sub_commands[i].psyntax); } } break; @@ -2664,10 +2664,10 @@ switch_status_t conf_api_dispatch(conference_obj_t *conference, switch_stream_ha } if (all || non_mod) { - conf_member_itterator(conference, stream, non_mod, (conf_api_member_cmd_t) conf_api_sub_commands[i].pfnapicmd, argv[argn + 2]); + conference_member_itterator(conference, stream, non_mod, (conference_api_member_cmd_t) conference_api_sub_commands[i].pfnapicmd, argv[argn + 2]); } else if (last) { - conf_member_t *member = NULL; - conf_member_t *last_member = NULL; + conference_member_t *member = NULL; + conference_member_t *last_member = NULL; switch_mutex_lock(conference->member_mutex); @@ -2681,15 +2681,15 @@ switch_status_t conf_api_dispatch(conference_obj_t *conference, switch_stream_ha } /* exec functio on last (oldest) member */ - if (last_member != NULL && last_member->session && !conf_utils_member_test_flag(last_member, MFLAG_NOCHANNEL)) { - conf_api_member_cmd_t pfn = (conf_api_member_cmd_t) conf_api_sub_commands[i].pfnapicmd; + if (last_member != NULL && last_member->session && !conference_utils_member_test_flag(last_member, MFLAG_NOCHANNEL)) { + conference_api_member_cmd_t pfn = (conference_api_member_cmd_t) conference_api_sub_commands[i].pfnapicmd; pfn(last_member, stream, argv[argn + 2]); } switch_mutex_unlock(conference->member_mutex); } else if (id) { - conf_api_member_cmd_t pfn = (conf_api_member_cmd_t) conf_api_sub_commands[i].pfnapicmd; - conf_member_t *member = conf_member_get(conference, id); + conference_api_member_cmd_t pfn = (conference_api_member_cmd_t) conference_api_sub_commands[i].pfnapicmd; + conference_member_t *member = conference_member_get(conference, id); if (member != NULL) { pfn(member, stream, argv[argn + 2]); @@ -2698,7 +2698,7 @@ switch_status_t conf_api_dispatch(conference_obj_t *conference, switch_stream_ha stream->write_function(stream, "Non-Existant ID %u\n", id); } } else { - stream->write_function(stream, "%s %s", conf_api_sub_commands[i].pcommand, conf_api_sub_commands[i].psyntax); + stream->write_function(stream, "%s %s", conference_api_sub_commands[i].pcommand, conference_api_sub_commands[i].psyntax); } } break; @@ -2706,10 +2706,10 @@ switch_status_t conf_api_dispatch(conference_obj_t *conference, switch_stream_ha /* commands that deals with all text after command */ case CONF_API_SUB_ARGS_AS_ONE: { - conf_api_text_cmd_t pfn = (conf_api_text_cmd_t) conf_api_sub_commands[i].pfnapicmd; + conference_api_text_cmd_t pfn = (conference_api_text_cmd_t) conference_api_sub_commands[i].pfnapicmd; char *start_text; const char *modified_cmdline = cmdline; - const char *cmd = conf_api_sub_commands[i].pname; + const char *cmd = conference_api_sub_commands[i].pname; if (!zstr(modified_cmdline) && (start_text = strstr(modified_cmdline, cmd))) { modified_cmdline = start_text + strlen(cmd); @@ -2721,7 +2721,7 @@ switch_status_t conf_api_dispatch(conference_obj_t *conference, switch_stream_ha /* call the command handler */ if (pfn(conference, stream, modified_cmdline) != SWITCH_STATUS_SUCCESS) { /* command returned error, so show syntax usage */ - stream->write_function(stream, "%s %s", conf_api_sub_commands[i].pcommand, conf_api_sub_commands[i].psyntax); + stream->write_function(stream, "%s %s", conference_api_sub_commands[i].pcommand, conference_api_sub_commands[i].psyntax); } } break; diff --git a/src/mod/applications/mod_conference/mod_conference_cdr.c b/src/mod/applications/mod_conference/conference_cdr.c similarity index 90% rename from src/mod/applications/mod_conference/mod_conference_cdr.c rename to src/mod/applications/mod_conference/conference_cdr.c index cb80d04078..bbff2a1964 100644 --- a/src/mod/applications/mod_conference/mod_conference_cdr.c +++ b/src/mod/applications/mod_conference/conference_cdr.c @@ -42,28 +42,28 @@ #include -inline switch_bool_t conf_cdr_test_mflag(conf_cdr_node_t *np, member_flag_t mflag) +inline switch_bool_t conference_cdr_test_mflag(conference_cdr_node_t *np, member_flag_t mflag) { return !!np->mflags[mflag]; } -const char *conf_cdr_audio_flow(conf_member_t *member) +const char *conference_cdr_audio_flow(conference_member_t *member) { const char *flow = "sendrecv"; - if (!conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { + if (!conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { flow = "recvonly"; } if (member->channel && switch_channel_test_flag(member->channel, CF_HOLD)) { - flow = conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK) ? "sendonly" : "inactive"; + flow = conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) ? "sendonly" : "inactive"; } return flow; } -char *conf_cdr_rfc4579_render(conference_obj_t *conference, switch_event_t *event, switch_event_t *revent) +char *conference_cdr_rfc4579_render(conference_obj_t *conference, switch_event_t *event, switch_event_t *revent) { switch_xml_t xml, x_tag, x_tag1, x_tag2, x_tag3, x_tag4; char tmp[30]; @@ -71,7 +71,7 @@ char *conf_cdr_rfc4579_render(conference_obj_t *conference, switch_event_t *even char *dup_domain = NULL; char *uri; int off = 0, off1 = 0, off2 = 0, off3 = 0, off4 = 0; - conf_cdr_node_t *np; + conference_cdr_node_t *np; char *tmpp = tmp; char *xml_text = NULL; @@ -250,7 +250,7 @@ char *conf_cdr_rfc4579_render(conference_obj_t *conference, switch_event_t *even const char *var; //char buf[1024]; - //switch_snprintf(buf, sizeof(buf), "conf_%s_%s_%s", conference->name, conference->domain, np->cp->caller_id_number); + //switch_snprintf(buf, sizeof(buf), "conference_%s_%s_%s", conference->name, conference->domain, np->cp->caller_id_number); //switch_channel_set_variable(channel, "conference_call_key", buf); if (!(x_tag3 = switch_xml_add_child_d(x_tag2, "media", off3++))) { @@ -276,7 +276,7 @@ char *conf_cdr_rfc4579_render(conference_obj_t *conference, switch_event_t *even if (!(x_tag4 = switch_xml_add_child_d(x_tag3, "status", off4++))) { abort(); } - switch_xml_set_txt_d(x_tag4, conf_cdr_audio_flow(np->member)); + switch_xml_set_txt_d(x_tag4, conference_cdr_audio_flow(np->member)); if (switch_channel_test_flag(channel, CF_VIDEO)) { @@ -327,13 +327,13 @@ char *conf_cdr_rfc4579_render(conference_obj_t *conference, switch_event_t *even } -cJSON *conf_cdr_json_render(conference_obj_t *conference, cJSON *req) +cJSON *conference_cdr_json_render(conference_obj_t *conference, cJSON *req) { char tmp[30]; const char *domain; const char *name; char *dup_domain = NULL; char *uri; - conf_cdr_node_t *np; + conference_cdr_node_t *np; char *tmpp = tmp; cJSON *json = cJSON_CreateObject(), *jusers = NULL, *jold_users = NULL, *juser = NULL, *jvars = NULL; @@ -437,7 +437,7 @@ cJSON *conf_cdr_json_render(conference_obj_t *conference, cJSON *req) switch_channel_get_variables(channel, &var_event); - if ((prefix = switch_event_get_header(var_event, "json_conf_var_prefix"))) { + if ((prefix = switch_event_get_header(var_event, "json_conference_var_prefix"))) { all = strcasecmp(prefix, "__all__"); } else { prefix = "json_"; @@ -457,7 +457,7 @@ cJSON *conf_cdr_json_render(conference_obj_t *conference, cJSON *req) json_add_child_string(juser, "rtpAudioSSRC", var); } - json_add_child_string(juser, "rtpAudioDirection", conf_cdr_audio_flow(np->member)); + json_add_child_string(juser, "rtpAudioDirection", conference_cdr_audio_flow(np->member)); if (switch_channel_test_flag(channel, CF_VIDEO)) { @@ -486,7 +486,7 @@ cJSON *conf_cdr_json_render(conference_obj_t *conference, cJSON *req) return json; } -void conf_cdr_del(conf_member_t *member) +void conference_cdr_del(conference_member_t *member) { if (member->channel) { switch_channel_get_variables(member->channel, &member->cdr_node->var_event); @@ -498,9 +498,9 @@ void conf_cdr_del(conf_member_t *member) } } -void conf_cdr_add(conf_member_t *member) +void conference_cdr_add(conference_member_t *member) { - conf_cdr_node_t *np; + conference_cdr_node_t *np; switch_caller_profile_t *cp; switch_channel_t *channel; @@ -530,9 +530,9 @@ void conf_cdr_add(conf_member_t *member) } -void conf_cdr_rejected(conference_obj_t *conference, switch_channel_t *channel, cdr_reject_reason_t reason) +void conference_cdr_rejected(conference_obj_t *conference, switch_channel_t *channel, cdr_reject_reason_t reason) { - conf_cdr_reject_t *rp; + conference_cdr_reject_t *rp; switch_caller_profile_t *cp; rp = switch_core_alloc(conference->pool, sizeof(*rp)); @@ -549,12 +549,12 @@ void conf_cdr_rejected(conference_obj_t *conference, switch_channel_t *channel, rp->cp = switch_caller_profile_dup(conference->pool, cp); } -void conf_cdr_render(conference_obj_t *conference) +void conference_cdr_render(conference_obj_t *conference) { switch_xml_t cdr, x_ptr, x_member, x_members, x_conference, x_cp, x_flags, x_tag, x_rejected, x_attempt; - conf_cdr_node_t *np; - conf_cdr_reject_t *rp; - int cdr_off = 0, conf_off = 0; + conference_cdr_node_t *np; + conference_cdr_reject_t *rp; + int cdr_off = 0, conference_off = 0; char str[512]; char *path = NULL, *xml_text; int fd; @@ -571,30 +571,30 @@ void conf_cdr_render(conference_obj_t *conference) abort(); } - if (!(x_ptr = switch_xml_add_child_d(x_conference, "name", conf_off++))) { + if (!(x_ptr = switch_xml_add_child_d(x_conference, "name", conference_off++))) { abort(); } switch_xml_set_txt_d(x_ptr, conference->name); - if (!(x_ptr = switch_xml_add_child_d(x_conference, "hostname", conf_off++))) { + if (!(x_ptr = switch_xml_add_child_d(x_conference, "hostname", conference_off++))) { abort(); } switch_xml_set_txt_d(x_ptr, switch_core_get_hostname()); - if (!(x_ptr = switch_xml_add_child_d(x_conference, "rate", conf_off++))) { + if (!(x_ptr = switch_xml_add_child_d(x_conference, "rate", conference_off++))) { abort(); } switch_snprintf(str, sizeof(str), "%d", conference->rate); switch_xml_set_txt_d(x_ptr, str); - if (!(x_ptr = switch_xml_add_child_d(x_conference, "interval", conf_off++))) { + if (!(x_ptr = switch_xml_add_child_d(x_conference, "interval", conference_off++))) { abort(); } switch_snprintf(str, sizeof(str), "%d", conference->interval); switch_xml_set_txt_d(x_ptr, str); - if (!(x_ptr = switch_xml_add_child_d(x_conference, "start_time", conf_off++))) { + if (!(x_ptr = switch_xml_add_child_d(x_conference, "start_time", conference_off++))) { abort(); } switch_xml_set_attr_d(x_ptr, "type", "UNIX-epoch"); @@ -602,17 +602,17 @@ void conf_cdr_render(conference_obj_t *conference) switch_xml_set_txt_d(x_ptr, str); - if (!(x_ptr = switch_xml_add_child_d(x_conference, "end_time", conf_off++))) { + if (!(x_ptr = switch_xml_add_child_d(x_conference, "end_time", conference_off++))) { abort(); } - switch_xml_set_attr_d(x_ptr, "endconf_forced", conf_utils_test_flag(conference, CFLAG_ENDCONF_FORCED) ? "true" : "false"); + switch_xml_set_attr_d(x_ptr, "endconference_forced", conference_utils_test_flag(conference, CFLAG_ENDCONF_FORCED) ? "true" : "false"); switch_xml_set_attr_d(x_ptr, "type", "UNIX-epoch"); switch_snprintf(str, sizeof(str), "%ld", (long)conference->end_time); switch_xml_set_txt_d(x_ptr, str); - if (!(x_members = switch_xml_add_child_d(x_conference, "members", conf_off++))) { + if (!(x_members = switch_xml_add_child_d(x_conference, "members", conference_off++))) { abort(); } @@ -621,7 +621,7 @@ void conf_cdr_render(conference_obj_t *conference) int flag_off = 0; - if (!(x_member = switch_xml_add_child_d(x_members, "member", conf_off++))) { + if (!(x_member = switch_xml_add_child_d(x_members, "member", conference_off++))) { abort(); } @@ -647,16 +647,16 @@ void conf_cdr_render(conference_obj_t *conference) switch_assert(x_flags); x_tag = switch_xml_add_child_d(x_flags, "is_moderator", flag_off++); - switch_xml_set_txt_d(x_tag, conf_cdr_test_mflag(np, MFLAG_MOD) ? "true" : "false"); + switch_xml_set_txt_d(x_tag, conference_cdr_test_mflag(np, MFLAG_MOD) ? "true" : "false"); x_tag = switch_xml_add_child_d(x_flags, "end_conference", flag_off++); - switch_xml_set_txt_d(x_tag, conf_cdr_test_mflag(np, MFLAG_ENDCONF) ? "true" : "false"); + switch_xml_set_txt_d(x_tag, conference_cdr_test_mflag(np, MFLAG_ENDCONF) ? "true" : "false"); x_tag = switch_xml_add_child_d(x_flags, "was_kicked", flag_off++); - switch_xml_set_txt_d(x_tag, conf_cdr_test_mflag(np, MFLAG_KICKED) ? "true" : "false"); + switch_xml_set_txt_d(x_tag, conference_cdr_test_mflag(np, MFLAG_KICKED) ? "true" : "false"); x_tag = switch_xml_add_child_d(x_flags, "is_ghost", flag_off++); - switch_xml_set_txt_d(x_tag, conf_cdr_test_mflag(np, MFLAG_GHOST) ? "true" : "false"); + switch_xml_set_txt_d(x_tag, conference_cdr_test_mflag(np, MFLAG_GHOST) ? "true" : "false"); if (!(x_cp = switch_xml_add_child_d(x_member, "caller_profile", member_off++))) { abort(); @@ -674,7 +674,7 @@ void conf_cdr_render(conference_obj_t *conference) } - if (!(x_rejected = switch_xml_add_child_d(x_conference, "rejected", conf_off++))) { + if (!(x_rejected = switch_xml_add_child_d(x_conference, "rejected", conference_off++))) { abort(); } diff --git a/src/mod/applications/mod_conference/mod_conference_event.c b/src/mod/applications/mod_conference/conference_event.c similarity index 79% rename from src/mod/applications/mod_conference/mod_conference_event.c rename to src/mod/applications/mod_conference/conference_event.c index 1f536fe070..24d6fbce51 100644 --- a/src/mod/applications/mod_conference/mod_conference_event.c +++ b/src/mod/applications/mod_conference/conference_event.c @@ -42,13 +42,13 @@ #include -void conf_event_mod_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id) +void conference_event_mod_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id) { cJSON *data, *addobj = NULL; const char *action = NULL; char *value = NULL; cJSON *jid = 0; - char *conf_name = strdup(event_channel + 15); + char *conference_name = strdup(event_channel + 15); int cid = 0; char *p; switch_stream_handle_t stream = { 0 }; @@ -57,7 +57,7 @@ void conf_event_mod_channel_handler(const char *event_channel, cJSON *json, cons char *argv[10] = {0}; int argc = 0; - if (conf_name && (p = strchr(conf_name, '@'))) { + if (conference_name && (p = strchr(conference_name, '@'))) { *p = '\0'; } @@ -87,7 +87,7 @@ void conf_event_mod_channel_handler(const char *event_channel, cJSON *json, cons } } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "conf %s CMD %s [%s] %d\n", conf_name, key, action, cid); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "conf %s CMD %s [%s] %d\n", conference_name, key, action, cid); if (zstr(action)) { goto end; @@ -103,7 +103,7 @@ void conf_event_mod_channel_handler(const char *event_channel, cJSON *json, cons !strcasecmp(action, "unvmute") || !strcasecmp(action, "tvmute") ) { - exec = switch_mprintf("%s %s %d", conf_name, action, cid); + exec = switch_mprintf("%s %s %d", conference_name, action, cid); } else if (!strcasecmp(action, "volume_in") || !strcasecmp(action, "volume_out") || !strcasecmp(action, "vid-res-id") || @@ -112,26 +112,26 @@ void conf_event_mod_channel_handler(const char *event_channel, cJSON *json, cons !strcasecmp(action, "vid-canvas") || !strcasecmp(action, "vid-watching-canvas") || !strcasecmp(action, "vid-banner")) { - exec = switch_mprintf("%s %s %d %s", conf_name, action, cid, argv[0]); + exec = switch_mprintf("%s %s %d %s", conference_name, action, cid, argv[0]); } else if (!strcasecmp(action, "play") || !strcasecmp(action, "stop")) { - exec = switch_mprintf("%s %s %s", conf_name, action, argv[0]); + exec = switch_mprintf("%s %s %s", conference_name, action, argv[0]); } else if (!strcasecmp(action, "recording") || !strcasecmp(action, "vid-layout") || !strcasecmp(action, "vid-write-png")) { if (!argv[1]) { argv[1] = "all"; } - exec = switch_mprintf("%s %s %s %s", conf_name, action, argv[0], argv[1]); + exec = switch_mprintf("%s %s %s %s", conference_name, action, argv[0], argv[1]); } else if (!strcasecmp(action, "transfer") && cid) { - conf_member_t *member; + conference_member_t *member; conference_obj_t *conference; exec = switch_mprintf("%s %s %s", argv[0], switch_str_nil(argv[1]), switch_str_nil(argv[2])); stream.write_function(&stream, "+OK Call transferred to %s", argv[0]); - if ((conference = conf_find(conf_name, NULL))) { - if ((member = conf_member_get(conference, cid))) { + if ((conference = conference_find(conference_name, NULL))) { + if ((member = conference_member_get(conference, cid))) { switch_ivr_session_transfer(member->session, argv[0], argv[1], argv[2]); switch_thread_rwlock_unlock(member->rwlock); } @@ -144,8 +144,8 @@ void conf_event_mod_channel_handler(const char *event_channel, cJSON *json, cons const void *vvar; cJSON *array = cJSON_CreateArray(); conference_obj_t *conference = NULL; - if ((conference = conf_find(conf_name, NULL))) { - switch_mutex_lock(conf_globals.setup_mutex); + if ((conference = conference_find(conference_name, NULL))) { + switch_mutex_lock(conference_globals.setup_mutex); if (conference->layout_hash) { for (hi = switch_core_hash_first(conference->layout_hash); hi; hi = switch_core_hash_next(&hi)) { switch_core_hash_this(hi, &vvar, NULL, &val); @@ -163,14 +163,14 @@ void conf_event_mod_channel_handler(const char *event_channel, cJSON *json, cons } } - switch_mutex_unlock(conf_globals.setup_mutex); + switch_mutex_unlock(conference_globals.setup_mutex); switch_thread_rwlock_unlock(conference->rwlock); } addobj = array; } if (exec) { - conf_api_main_real(exec, NULL, &stream); + conference_api_main_real(exec, NULL, &stream); } end: @@ -193,26 +193,26 @@ void conf_event_mod_channel_handler(const char *event_channel, cJSON *json, cons cJSON_AddItemToObject(jdata, "error", cJSON_CreateString("Invalid Command")); } - switch_event_channel_broadcast(event_channel, &msg, __FILE__, conf_globals.event_channel_id); + switch_event_channel_broadcast(event_channel, &msg, __FILE__, conference_globals.event_channel_id); switch_safe_free(stream.data); switch_safe_free(exec); - switch_safe_free(conf_name); + switch_safe_free(conference_name); } -void conf_event_la_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id) +void conference_event_la_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id) { - switch_live_array_parse_json(json, conf_globals.event_channel_id); + switch_live_array_parse_json(json, conference_globals.event_channel_id); } -void conf_event_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id) +void conference_event_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id) { char *domain = NULL, *name = NULL; conference_obj_t *conference = NULL; - cJSON *data, *reply = NULL, *conf_desc = NULL; + cJSON *data, *reply = NULL, *conference_desc = NULL; const char *action = NULL; char *dup = NULL; @@ -236,40 +236,40 @@ void conf_event_channel_handler(const char *event_channel, cJSON *json, const ch } if (!strcasecmp(action, "bootstrap")) { - if (!zstr(name) && (conference = conf_find(name, domain))) { - conf_desc = conf_cdr_json_render(conference, json); + if (!zstr(name) && (conference = conference_find(name, domain))) { + conference_desc = conference_cdr_json_render(conference, json); } else { - conf_desc = cJSON_CreateObject(); - json_add_child_string(conf_desc, "conferenceDescription", "FreeSWITCH Conference"); - json_add_child_string(conf_desc, "conferenceState", "inactive"); - json_add_child_array(conf_desc, "users"); - json_add_child_array(conf_desc, "oldUsers"); + conference_desc = cJSON_CreateObject(); + json_add_child_string(conference_desc, "conferenceDescription", "FreeSWITCH Conference"); + json_add_child_string(conference_desc, "conferenceState", "inactive"); + json_add_child_array(conference_desc, "users"); + json_add_child_array(conference_desc, "oldUsers"); } } else { - conf_desc = cJSON_CreateObject(); - json_add_child_string(conf_desc, "error", "Invalid action"); + conference_desc = cJSON_CreateObject(); + json_add_child_string(conference_desc, "error", "Invalid action"); } - json_add_child_string(conf_desc, "action", "conferenceDescription"); + json_add_child_string(conference_desc, "action", "conferenceDescription"); - cJSON_AddItemToObject(reply, "data", conf_desc); + cJSON_AddItemToObject(reply, "data", conference_desc); switch_safe_free(dup); - switch_event_channel_broadcast(event_channel, &reply, "mod_conference", conf_globals.event_channel_id); + switch_event_channel_broadcast(event_channel, &reply, "mod_conference", conference_globals.event_channel_id); } -void conf_event_send_json(conference_obj_t *conference) +void conference_event_send_json(conference_obj_t *conference) { - cJSON *event, *conf_desc = NULL; + cJSON *event, *conference_desc = NULL; char *name = NULL, *domain = NULL, *dup_domain = NULL; char *event_channel = NULL; - if (!conf_utils_test_flag(conference, CFLAG_JSON_EVENTS)) { + if (!conference_utils_test_flag(conference, CFLAG_JSON_EVENTS)) { return; } - conf_desc = conf_cdr_json_render(conference, NULL); + conference_desc = conference_cdr_json_render(conference, NULL); if (!(name = conference->name)) { name = "conference"; @@ -287,20 +287,20 @@ void conf_event_send_json(conference_obj_t *conference) event = cJSON_CreateObject(); json_add_child_string(event, "eventChannel", event_channel); - cJSON_AddItemToObject(event, "data", conf_desc); + cJSON_AddItemToObject(event, "data", conference_desc); - switch_event_channel_broadcast(event_channel, &event, "mod_conference", conf_globals.event_channel_id); + switch_event_channel_broadcast(event_channel, &event, "mod_conference", conference_globals.event_channel_id); switch_safe_free(dup_domain); switch_safe_free(event_channel); } -void conf_event_la_command_handler(switch_live_array_t *la, const char *cmd, const char *sessid, cJSON *jla, void *user_data) +void conference_event_la_command_handler(switch_live_array_t *la, const char *cmd, const char *sessid, cJSON *jla, void *user_data) { } -void conf_event_adv_la(conference_obj_t *conference, conf_member_t *member, switch_bool_t join) +void conference_event_adv_la(conference_obj_t *conference, conference_member_t *member, switch_bool_t join) { //if (member->video_flow == SWITCH_MEDIA_FLOW_SENDONLY) { @@ -326,21 +326,21 @@ void conf_event_adv_la(conference_obj_t *conference, conf_member_t *member, swit cJSON_AddItemToObject(data, "action", cJSON_CreateString(join ? "conference-liveArray-join" : "conference-liveArray-part")); cJSON_AddItemToObject(data, "laChannel", cJSON_CreateString(conference->la_event_channel)); cJSON_AddItemToObject(data, "laName", cJSON_CreateString(conference->la_name)); - cJSON_AddItemToObject(data, "role", cJSON_CreateString(conf_utils_member_test_flag(member, MFLAG_MOD) ? "moderator" : "participant")); + cJSON_AddItemToObject(data, "role", cJSON_CreateString(conference_utils_member_test_flag(member, MFLAG_MOD) ? "moderator" : "participant")); cJSON_AddItemToObject(data, "chatID", cJSON_CreateString(conference->chat_id)); cJSON_AddItemToObject(data, "canvasCount", cJSON_CreateNumber(conference->canvas_count)); - if (conf_utils_member_test_flag(member, MFLAG_SECOND_SCREEN)) { + if (conference_utils_member_test_flag(member, MFLAG_SECOND_SCREEN)) { cJSON_AddItemToObject(data, "secondScreen", cJSON_CreateTrue()); } - if (conf_utils_member_test_flag(member, MFLAG_MOD)) { + if (conference_utils_member_test_flag(member, MFLAG_MOD)) { cJSON_AddItemToObject(data, "modChannel", cJSON_CreateString(conference->mod_event_channel)); } switch_core_get_variables(&variables); for (hp = variables->headers; hp; hp = hp->next) { - if (!strncasecmp(hp->name, "conf_verto_", 11)) { + if (!strncasecmp(hp->name, "conference_verto_", 11)) { char *var = hp->name + 11; if (var) { cJSON_AddItemToObject(data, var, cJSON_CreateString(hp->value)); @@ -349,7 +349,7 @@ void conf_event_adv_la(conference_obj_t *conference, conf_member_t *member, swit } switch_event_destroy(&variables); - switch_event_channel_broadcast(event_channel, &msg, "mod_conference", conf_globals.event_channel_id); + switch_event_channel_broadcast(event_channel, &msg, "mod_conference", conference_globals.event_channel_id); if (cookie) { switch_event_channel_permission_modify(cookie, conference->la_event_channel, join); @@ -358,13 +358,13 @@ void conf_event_adv_la(conference_obj_t *conference, conf_member_t *member, swit } } -void conf_event_send_rfc(conference_obj_t *conference) +void conference_event_send_rfc(conference_obj_t *conference) { switch_event_t *event; char *body; char *name = NULL, *domain = NULL, *dup_domain = NULL; - if (!conf_utils_test_flag(conference, CFLAG_RFC4579)) { + if (!conference_utils_test_flag(conference, CFLAG_RFC4579)) { return; } @@ -386,7 +386,7 @@ void conf_event_send_rfc(conference_obj_t *conference) switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "conference-name", name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "conference-domain", domain); - body = conf_cdr_rfc4579_render(conference, NULL, event); + body = conference_cdr_rfc4579_render(conference, NULL, event); switch_event_add_body(event, "%s", body); free(body); switch_event_fire(&event); @@ -397,7 +397,7 @@ void conf_event_send_rfc(conference_obj_t *conference) } -switch_status_t conf_event_add_data(conference_obj_t *conference, switch_event_t *event) +switch_status_t conference_event_add_data(conference_obj_t *conference, switch_event_t *event) { switch_status_t status = SWITCH_STATUS_SUCCESS; @@ -411,9 +411,9 @@ switch_status_t conf_event_add_data(conference_obj_t *conference, switch_event_t } /* send a message to every member of the conference */ -void conf_event_chat_message_broadcast(conference_obj_t *conference, switch_event_t *event) +void conference_event_chat_message_broadcast(conference_obj_t *conference, switch_event_t *event) { - conf_member_t *member = NULL; + conference_member_t *member = NULL; switch_event_t *processed; switch_assert(conference != NULL); @@ -421,7 +421,7 @@ void conf_event_chat_message_broadcast(conference_obj_t *conference, switch_even switch_mutex_lock(conference->member_mutex); for (member = conference->members; member; member = member->next) { - if (member->session && !conf_utils_member_test_flag(member, MFLAG_NOCHANNEL)) { + if (member->session && !conference_utils_member_test_flag(member, MFLAG_NOCHANNEL)) { const char *presence_id = switch_channel_get_variable(member->channel, "presence_id"); const char *chat_proto = switch_channel_get_variable(member->channel, "chat_proto"); switch_event_t *reply = NULL; @@ -446,7 +446,7 @@ void conf_event_chat_message_broadcast(conference_obj_t *conference, switch_even switch_mutex_unlock(conference->member_mutex); } -void conf_event_call_setup_handler(switch_event_t *event) +void conference_event_call_setup_handler(switch_event_t *event) { switch_status_t status = SWITCH_STATUS_FALSE; conference_obj_t *conference = NULL; @@ -462,12 +462,12 @@ void conf_event_call_setup_handler(switch_event_t *event) if (!ext) ext = dial_str; - if (!zstr(conf) && !zstr(dial_str) && !zstr(action) && (conference = conf_find(conf, domain))) { + if (!zstr(conf) && !zstr(dial_str) && !zstr(action) && (conference = conference_find(conf, domain))) { switch_event_t *var_event; switch_event_header_t *hp; - if (conf_utils_test_flag(conference, CFLAG_RFC4579)) { - char *key = switch_mprintf("conf_%s_%s_%s_%s", conference->name, conference->domain, ext, ext_domain); + if (conference_utils_test_flag(conference, CFLAG_RFC4579)) { + char *key = switch_mprintf("conference_%s_%s_%s_%s", conference->name, conference->domain, ext, ext_domain); char *expanded = NULL, *ostr = dial_str;; if (!strcasecmp(action, "call")) { @@ -503,7 +503,7 @@ void conf_event_call_setup_handler(switch_event_t *event) } } - status = conf_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); @@ -512,9 +512,9 @@ void conf_event_call_setup_handler(switch_event_t *event) } else if (!strcasecmp(action, "end")) { if (switch_core_session_hupall_matching_var("conference_call_key", key, SWITCH_CAUSE_NORMAL_CLEARING)) { - conf_send_notify(conference, "SIP/2.0 200 OK\r\n", call_id, SWITCH_TRUE); + conference_send_notify(conference, "SIP/2.0 200 OK\r\n", call_id, SWITCH_TRUE); } else { - conf_send_notify(conference, "SIP/2.0 481 Failure\r\n", call_id, SWITCH_TRUE); + conference_send_notify(conference, "SIP/2.0 481 Failure\r\n", call_id, SWITCH_TRUE); } status = SWITCH_STATUS_SUCCESS; } @@ -547,7 +547,7 @@ void conf_event_call_setup_handler(switch_event_t *event) } -void conf_data_event_handler(switch_event_t *event) +void conference_data_event_handler(switch_event_t *event) { switch_event_t *revent; char *name = switch_event_get_header(event, "conference-name"); @@ -555,14 +555,14 @@ void conf_data_event_handler(switch_event_t *event) conference_obj_t *conference = NULL; char *body = NULL; - if (!zstr(name) && (conference = conf_find(name, domain))) { - if (conf_utils_test_flag(conference, CFLAG_RFC4579)) { + if (!zstr(name) && (conference = conference_find(name, domain))) { + if (conference_utils_test_flag(conference, CFLAG_RFC4579)) { switch_event_dup(&revent, event); revent->event_id = SWITCH_EVENT_CONFERENCE_DATA; revent->flags |= EF_UNIQ_HEADERS; switch_event_add_header(revent, SWITCH_STACK_TOP, "Event-Name", "CONFERENCE_DATA"); - body = conf_cdr_rfc4579_render(conference, event, revent); + body = conference_cdr_rfc4579_render(conference, event, revent); switch_event_add_body(revent, "%s", body); switch_event_fire(&revent); switch_safe_free(body); @@ -572,11 +572,11 @@ void conf_data_event_handler(switch_event_t *event) } -void conf_event_pres_handler(switch_event_t *event) +void conference_event_pres_handler(switch_event_t *event) { char *to = switch_event_get_header(event, "to"); char *domain_name = NULL; - char *dup_to = NULL, *conf_name, *dup_conf_name = NULL; + char *dup_to = NULL, *conference_name, *dup_conference_name = NULL; conference_obj_t *conference; if (!to || strncasecmp(to, "conf+", 5) || !strchr(to, '@')) { @@ -588,16 +588,16 @@ void conf_event_pres_handler(switch_event_t *event) } - conf_name = dup_to + 5; + conference_name = dup_to + 5; - if ((domain_name = strchr(conf_name, '@'))) { + if ((domain_name = strchr(conference_name, '@'))) { *domain_name++ = '\0'; } - dup_conf_name = switch_mprintf("%q@%q", conf_name, domain_name); + dup_conference_name = switch_mprintf("%q@%q", conference_name, domain_name); - if ((conference = conf_find(conf_name, NULL)) || (conference = conf_find(dup_conf_name, NULL))) { + if ((conference = conference_find(conference_name, NULL)) || (conference = conference_find(dup_conference_name, NULL))) { if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", CONF_CHAT_PROTO); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", conference->name); @@ -608,7 +608,7 @@ void conf_event_pres_handler(switch_event_t *event) switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", EC++); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "unique-id", conf_name); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "unique-id", conference_name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_ROUTING"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", conference->count == 1 ? "early" : "confirmed"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-direction", conference->count == 1 ? "outbound" : "inbound"); @@ -617,14 +617,14 @@ void conf_event_pres_handler(switch_event_t *event) switch_thread_rwlock_unlock(conference->rwlock); } else if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", CONF_CHAT_PROTO); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", conf_name); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", conference_name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", to); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "force-status", "Idle"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", "unknown"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", EC++); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "unique-id", conf_name); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "unique-id", conference_name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_HANGUP"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", "terminated"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-direction", "inbound"); @@ -632,7 +632,7 @@ void conf_event_pres_handler(switch_event_t *event) } switch_safe_free(dup_to); - switch_safe_free(dup_conf_name); + switch_safe_free(dup_conference_name); } @@ -670,7 +670,7 @@ switch_status_t chat_send(switch_event_t *message_event) switch_copy_string(name, to, sizeof(name)); } - if (!(conference = conf_find(name, NULL))) { + if (!(conference = conference_find(name, NULL))) { switch_core_chat_send_args(proto, CONF_CHAT_PROTO, to, hint && strchr(hint, '/') ? hint : from, "", "Conference not active.", NULL, NULL, SWITCH_FALSE); return SWITCH_STATUS_FALSE; @@ -681,9 +681,9 @@ switch_status_t chat_send(switch_event_t *message_event) if (body != NULL && (lbuf = strdup(body))) { /* special case list */ if (conference->broadcast_chat_messages) { - conf_event_chat_message_broadcast(conference, message_event); + conference_event_chat_message_broadcast(conference, message_event); } else if (switch_stristr("list", lbuf)) { - conf_list_pretty(conference, &stream); + conference_list_pretty(conference, &stream); /* provide help */ } else { return SWITCH_STATUS_SUCCESS; diff --git a/src/mod/applications/mod_conference/mod_conference_file.c b/src/mod/applications/mod_conference/conference_file.c similarity index 94% rename from src/mod/applications/mod_conference/mod_conference_file.c rename to src/mod/applications/mod_conference/conference_file.c index 00b14bef85..757e9e94ee 100644 --- a/src/mod/applications/mod_conference/mod_conference_file.c +++ b/src/mod/applications/mod_conference/conference_file.c @@ -45,12 +45,12 @@ switch_status_t conference_file_close(conference_obj_t *conference, conference_file_node_t *node) { switch_event_t *event; - conf_member_t *member = NULL; + conference_member_t *member = NULL; if (test_eflag(conference, EFLAG_PLAY_FILE_DONE) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "seconds", "%ld", (long) node->fh.samples_in / node->fh.native_rate); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "milliseconds", "%ld", (long) node->fh.samples_in / (node->fh.native_rate / 1000)); @@ -63,8 +63,8 @@ switch_status_t conference_file_close(conference_obj_t *conference, conference_f if (node->member_id) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "play-file-member-done"); - if ((member = conf_member_get(conference, node->member_id))) { - conf_member_add_event_data(member, event); + if ((member = conference_member_get(conference, node->member_id))) { + conference_member_add_event_data(member, event); switch_thread_rwlock_unlock(member->rwlock); } @@ -83,7 +83,7 @@ switch_status_t conference_file_close(conference_obj_t *conference, conference_f #ifdef OPENAL_POSITIONING if (node->al && node->al->device) { - conf_al_close(node->al); + conference_al_close(node->al); } #endif if (switch_core_file_has_video(&node->fh) && conference->canvas) { @@ -175,7 +175,7 @@ switch_status_t conference_file_play(conference_obj_t *conference, char *file, u } if (!async && say) { - status = conf_say(conference, file + 4, leadin); + status = conference_say(conference, file + 4, leadin); goto done; } @@ -196,7 +196,7 @@ switch_status_t conference_file_play(conference_obj_t *conference, char *file, u switch_safe_free(params_portion); } else if (!async) { - status = conf_say(conference, file, leadin); + status = conference_say(conference, file, leadin); goto done; } else { goto done; @@ -232,7 +232,7 @@ switch_status_t conference_file_play(conference_obj_t *conference, char *file, u flags = SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT; - if (conference->members_with_video && conf_utils_test_flag(conference, CFLAG_TRANSCODE_VIDEO)) { + if (conference->members_with_video && conference_utils_test_flag(conference, CFLAG_TRANSCODE_VIDEO)) { flags |= SWITCH_FILE_FLAG_VIDEO; } @@ -244,7 +244,7 @@ switch_status_t conference_file_play(conference_obj_t *conference, char *file, u if (test_eflag(conference, EFLAG_PLAY_FILE) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); if (fnode->fh.params) { switch_event_merge(event, conference->fnode->fh.params); @@ -271,8 +271,8 @@ switch_status_t conference_file_play(conference_obj_t *conference, char *file, u } if (!bad_params && !zstr(position) && conference->channels == 2) { - fnode->al = conf_al_create(pool); - if (conf_al_parse_position(fnode->al, position) != SWITCH_STATUS_SUCCESS) { + fnode->al = conference_al_create(pool); + if (conference_al_parse_position(fnode->al, position) != SWITCH_STATUS_SUCCESS) { switch_core_file_close(&fnode->fh); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Position Data.\n"); fnode->al = NULL; @@ -288,7 +288,7 @@ switch_status_t conference_file_play(conference_obj_t *conference, char *file, u fnode->file = switch_core_strdup(fnode->pool, file); if (!conference->fnode || (async && !conference->async_fnode)) { - conf_video_fnode_check(fnode); + conference_video_fnode_check(fnode); } /* Queue the node */ diff --git a/src/mod/applications/mod_conference/mod_conference_loop.c b/src/mod/applications/mod_conference/conference_loop.c similarity index 70% rename from src/mod/applications/mod_conference/mod_conference_loop.c rename to src/mod/applications/mod_conference/conference_loop.c index 63aa47704b..dff632a030 100644 --- a/src/mod/applications/mod_conference/mod_conference_loop.c +++ b/src/mod/applications/mod_conference/conference_loop.c @@ -42,40 +42,40 @@ #include struct _mapping control_mappings[] = { - {"mute", conf_loop_mute_toggle}, - {"mute on", conf_loop_mute_on}, - {"mute off", conf_loop_mute_off}, - {"vmute", conf_loop_vmute_toggle}, - {"vmute on", conf_loop_vmute_on}, - {"vmute off", conf_loop_vmute_off}, - {"vmute snap", conf_loop_conf_video_vmute_snap}, - {"vmute snapoff", conf_loop_conf_video_vmute_snapoff}, - {"deaf mute", conf_loop_deafmute_toggle}, - {"energy up", conf_loop_energy_up}, - {"energy equ", conf_loop_energy_equ_conf}, - {"energy dn", conf_loop_energy_dn}, - {"vol talk up", conf_loop_volume_talk_up}, - {"vol talk zero", conf_loop_volume_talk_zero}, - {"vol talk dn", conf_loop_volume_talk_dn}, - {"vol listen up", conf_loop_volume_listen_up}, - {"vol listen zero", conf_loop_volume_listen_zero}, - {"vol listen dn", conf_loop_volume_listen_dn}, - {"hangup", conf_loop_hangup}, - {"event", conf_loop_event}, - {"lock", conf_loop_lock_toggle}, - {"transfer", conf_loop_transfer}, - {"execute_application", conf_loop_exec_app}, - {"floor", conf_loop_floor_toggle}, - {"vid-floor", conf_loop_vid_floor_toggle}, - {"vid-floor-force", conf_loop_vid_floor_force} + {"mute", conference_loop_mute_toggle}, + {"mute on", conference_loop_mute_on}, + {"mute off", conference_loop_mute_off}, + {"vmute", conference_loop_vmute_toggle}, + {"vmute on", conference_loop_vmute_on}, + {"vmute off", conference_loop_vmute_off}, + {"vmute snap", conference_loop_conference_video_vmute_snap}, + {"vmute snapoff", conference_loop_conference_video_vmute_snapoff}, + {"deaf mute", conference_loop_deafmute_toggle}, + {"energy up", conference_loop_energy_up}, + {"energy equ", conference_loop_energy_equ_conf}, + {"energy dn", conference_loop_energy_dn}, + {"vol talk up", conference_loop_volume_talk_up}, + {"vol talk zero", conference_loop_volume_talk_zero}, + {"vol talk dn", conference_loop_volume_talk_dn}, + {"vol listen up", conference_loop_volume_listen_up}, + {"vol listen zero", conference_loop_volume_listen_zero}, + {"vol listen dn", conference_loop_volume_listen_dn}, + {"hangup", conference_loop_hangup}, + {"event", conference_loop_event}, + {"lock", conference_loop_lock_toggle}, + {"transfer", conference_loop_transfer}, + {"execute_application", conference_loop_exec_app}, + {"floor", conference_loop_floor_toggle}, + {"vid-floor", conference_loop_vid_floor_toggle}, + {"vid-floor-force", conference_loop_vid_floor_force} }; -int conf_loop_mapping_len() +int conference_loop_mapping_len() { return (sizeof(control_mappings)/sizeof(control_mappings[0])); } -switch_status_t conf_loop_dmachine_dispatcher(switch_ivr_dmachine_match_t *match) +switch_status_t conference_loop_dmachine_dispatcher(switch_ivr_dmachine_match_t *match) { key_binding_t *binding = match->user_data; switch_channel_t *channel; @@ -96,119 +96,119 @@ switch_status_t conf_loop_dmachine_dispatcher(switch_ivr_dmachine_match_t *match binding->action.expanded_data = NULL; } - conf_utils_member_set_flag_locked(binding->member, MFLAG_FLUSH_BUFFER); + conference_utils_member_set_flag_locked(binding->member, MFLAG_FLUSH_BUFFER); return SWITCH_STATUS_SUCCESS; } -void conf_loop_floor_toggle(conf_member_t *member, caller_control_action_t *action) +void conference_loop_floor_toggle(conference_member_t *member, caller_control_action_t *action) { if (member == NULL) return; - conf_api_sub_floor(member, NULL, NULL); + conference_api_sub_floor(member, NULL, NULL); } -void conf_loop_vid_floor_toggle(conf_member_t *member, caller_control_action_t *action) +void conference_loop_vid_floor_toggle(conference_member_t *member, caller_control_action_t *action) { if (member == NULL) return; - conf_api_sub_vid_floor(member, NULL, NULL); + conference_api_sub_vid_floor(member, NULL, NULL); } -void conf_loop_vid_floor_force(conf_member_t *member, caller_control_action_t *action) +void conference_loop_vid_floor_force(conference_member_t *member, caller_control_action_t *action) { if (member == NULL) return; - conf_api_sub_vid_floor(member, NULL, "force"); + conference_api_sub_vid_floor(member, NULL, "force"); } -void conf_loop_mute_toggle(conf_member_t *member, caller_control_action_t *action) +void conference_loop_mute_toggle(conference_member_t *member, caller_control_action_t *action) { if (member == NULL) return; - if (conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { - conf_api_sub_mute(member, NULL, NULL); + if (conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { + conference_api_sub_mute(member, NULL, NULL); } else { - conf_api_sub_unmute(member, NULL, NULL); - if (!conf_utils_member_test_flag(member, MFLAG_CAN_HEAR)) { - conf_api_sub_undeaf(member, NULL, NULL); + conference_api_sub_unmute(member, NULL, NULL); + if (!conference_utils_member_test_flag(member, MFLAG_CAN_HEAR)) { + conference_api_sub_undeaf(member, NULL, NULL); } } } -void conf_loop_mute_on(conf_member_t *member, caller_control_action_t *action) +void conference_loop_mute_on(conference_member_t *member, caller_control_action_t *action) { - if (conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { - conf_api_sub_mute(member, NULL, NULL); + if (conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { + conference_api_sub_mute(member, NULL, NULL); } } -void conf_loop_mute_off(conf_member_t *member, caller_control_action_t *action) +void conference_loop_mute_off(conference_member_t *member, caller_control_action_t *action) { - if (!conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { - conf_api_sub_unmute(member, NULL, NULL); - if (!conf_utils_member_test_flag(member, MFLAG_CAN_HEAR)) { - conf_api_sub_undeaf(member, NULL, NULL); + if (!conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { + conference_api_sub_unmute(member, NULL, NULL); + if (!conference_utils_member_test_flag(member, MFLAG_CAN_HEAR)) { + conference_api_sub_undeaf(member, NULL, NULL); } } } -void conf_loop_conf_video_vmute_snap(conf_member_t *member, caller_control_action_t *action) +void conference_loop_conference_video_vmute_snap(conference_member_t *member, caller_control_action_t *action) { - conf_video_vmute_snap(member, SWITCH_FALSE); + conference_video_vmute_snap(member, SWITCH_FALSE); } -void conf_loop_conf_video_vmute_snapoff(conf_member_t *member, caller_control_action_t *action) +void conference_loop_conference_video_vmute_snapoff(conference_member_t *member, caller_control_action_t *action) { - conf_video_vmute_snap(member, SWITCH_TRUE); + conference_video_vmute_snap(member, SWITCH_TRUE); } -void conf_loop_vmute_toggle(conf_member_t *member, caller_control_action_t *action) +void conference_loop_vmute_toggle(conference_member_t *member, caller_control_action_t *action) { if (member == NULL) return; - if (conf_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN)) { - conf_api_sub_vmute(member, NULL, NULL); + if (conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN)) { + conference_api_sub_vmute(member, NULL, NULL); } else { - conf_api_sub_unvmute(member, NULL, NULL); + conference_api_sub_unvmute(member, NULL, NULL); } } -void conf_loop_vmute_on(conf_member_t *member, caller_control_action_t *action) +void conference_loop_vmute_on(conference_member_t *member, caller_control_action_t *action) { - if (conf_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN)) { - conf_api_sub_vmute(member, NULL, NULL); + if (conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN)) { + conference_api_sub_vmute(member, NULL, NULL); } } -void conf_loop_vmute_off(conf_member_t *member, caller_control_action_t *action) +void conference_loop_vmute_off(conference_member_t *member, caller_control_action_t *action) { - if (!conf_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN)) { - conf_api_sub_unvmute(member, NULL, NULL); + if (!conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN)) { + conference_api_sub_unvmute(member, NULL, NULL); } } -void conf_loop_lock_toggle(conf_member_t *member, caller_control_action_t *action) +void conference_loop_lock_toggle(conference_member_t *member, caller_control_action_t *action) { switch_event_t *event; if (member == NULL) return; - if (conf_utils_test_flag(member->conference, CFLAG_WAIT_MOD) && !conf_utils_member_test_flag(member, MFLAG_MOD) ) + if (conference_utils_test_flag(member->conference, CFLAG_WAIT_MOD) && !conference_utils_member_test_flag(member, MFLAG_MOD) ) return; - if (!conf_utils_test_flag(member->conference, CFLAG_LOCKED)) { + if (!conference_utils_test_flag(member->conference, CFLAG_LOCKED)) { if (member->conference->is_locked_sound) { conference_file_play(member->conference, member->conference->is_locked_sound, CONF_DEFAULT_LEADIN, NULL, 0); } - conf_utils_set_flag_locked(member->conference, CFLAG_LOCKED); + conference_utils_set_flag_locked(member->conference, CFLAG_LOCKED); if (test_eflag(member->conference, EFLAG_LOCK) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_event_add_data(member->conference, event); + conference_event_add_data(member->conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "lock"); switch_event_fire(&event); } @@ -217,10 +217,10 @@ void conf_loop_lock_toggle(conf_member_t *member, caller_control_action_t *actio conference_file_play(member->conference, member->conference->is_unlocked_sound, CONF_DEFAULT_LEADIN, NULL, 0); } - conf_utils_clear_flag_locked(member->conference, CFLAG_LOCKED); + conference_utils_clear_flag_locked(member->conference, CFLAG_LOCKED); if (test_eflag(member->conference, EFLAG_UNLOCK) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_event_add_data(member->conference, event); + conference_event_add_data(member->conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "unlock"); switch_event_fire(&event); } @@ -228,25 +228,25 @@ void conf_loop_lock_toggle(conf_member_t *member, caller_control_action_t *actio } -void conf_loop_deafmute_toggle(conf_member_t *member, caller_control_action_t *action) +void conference_loop_deafmute_toggle(conference_member_t *member, caller_control_action_t *action) { if (member == NULL) return; - if (conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { - conf_api_sub_mute(member, NULL, NULL); - if (conf_utils_member_test_flag(member, MFLAG_CAN_HEAR)) { - conf_api_sub_deaf(member, NULL, NULL); + if (conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { + conference_api_sub_mute(member, NULL, NULL); + if (conference_utils_member_test_flag(member, MFLAG_CAN_HEAR)) { + conference_api_sub_deaf(member, NULL, NULL); } } else { - conf_api_sub_unmute(member, NULL, NULL); - if (!conf_utils_member_test_flag(member, MFLAG_CAN_HEAR)) { - conf_api_sub_undeaf(member, NULL, NULL); + conference_api_sub_unmute(member, NULL, NULL); + if (!conference_utils_member_test_flag(member, MFLAG_CAN_HEAR)) { + conference_api_sub_undeaf(member, NULL, NULL); } } } -void conf_loop_energy_up(conf_member_t *member, caller_control_action_t *action) +void conference_loop_energy_up(conference_member_t *member, caller_control_action_t *action) { char msg[512], str[30] = ""; switch_event_t *event; @@ -263,19 +263,19 @@ void conf_loop_energy_up(conf_member_t *member, caller_control_action_t *action) if (test_eflag(member->conference, EFLAG_ENERGY_LEVEL) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "energy-level"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->energy_level); switch_event_fire(&event); } //switch_snprintf(msg, sizeof(msg), "Energy level %d", member->energy_level); - //conf_member_say(member, msg, 0); + //conference_member_say(member, msg, 0); switch_snprintf(str, sizeof(str), "%d", abs(member->energy_level) / 200); for (p = str; p && *p; p++) { switch_snprintf(msg, sizeof(msg), "digits/%c.wav", *p); - conf_member_play_file(member, msg, 0, SWITCH_TRUE); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } @@ -283,7 +283,7 @@ void conf_loop_energy_up(conf_member_t *member, caller_control_action_t *action) } -void conf_loop_energy_equ_conf(conf_member_t *member, caller_control_action_t *action) +void conference_loop_energy_equ_conf(conference_member_t *member, caller_control_action_t *action) { char msg[512], str[30] = "", *p; switch_event_t *event; @@ -295,24 +295,24 @@ void conf_loop_energy_equ_conf(conf_member_t *member, caller_control_action_t *a if (test_eflag(member->conference, EFLAG_ENERGY_LEVEL) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "energy-level"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->energy_level); switch_event_fire(&event); } //switch_snprintf(msg, sizeof(msg), "Energy level %d", member->energy_level); - //conf_member_say(member, msg, 0); + //conference_member_say(member, msg, 0); switch_snprintf(str, sizeof(str), "%d", abs(member->energy_level) / 200); for (p = str; p && *p; p++) { switch_snprintf(msg, sizeof(msg), "digits/%c.wav", *p); - conf_member_play_file(member, msg, 0, SWITCH_TRUE); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } } -void conf_loop_energy_dn(conf_member_t *member, caller_control_action_t *action) +void conference_loop_energy_dn(conference_member_t *member, caller_control_action_t *action) { char msg[512], str[30] = "", *p; switch_event_t *event; @@ -327,24 +327,24 @@ void conf_loop_energy_dn(conf_member_t *member, caller_control_action_t *action) if (test_eflag(member->conference, EFLAG_ENERGY_LEVEL) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "energy-level"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->energy_level); switch_event_fire(&event); } //switch_snprintf(msg, sizeof(msg), "Energy level %d", member->energy_level); - //conf_member_say(member, msg, 0); + //conference_member_say(member, msg, 0); switch_snprintf(str, sizeof(str), "%d", abs(member->energy_level) / 200); for (p = str; p && *p; p++) { switch_snprintf(msg, sizeof(msg), "digits/%c.wav", *p); - conf_member_play_file(member, msg, 0, SWITCH_TRUE); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } } -void conf_loop_volume_talk_up(conf_member_t *member, caller_control_action_t *action) +void conference_loop_volume_talk_up(conference_member_t *member, caller_control_action_t *action) { char msg[512]; switch_event_t *event; @@ -357,26 +357,26 @@ void conf_loop_volume_talk_up(conf_member_t *member, caller_control_action_t *ac if (test_eflag(member->conference, EFLAG_VOLUME_LEVEL) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "volume-level"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->volume_out_level); switch_event_fire(&event); } //switch_snprintf(msg, sizeof(msg), "Volume level %d", member->volume_out_level); - //conf_member_say(member, msg, 0); + //conference_member_say(member, msg, 0); if (member->volume_out_level < 0) { switch_snprintf(msg, sizeof(msg), "currency/negative.wav", member->volume_out_level); - conf_member_play_file(member, msg, 0, SWITCH_TRUE); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } switch_snprintf(msg, sizeof(msg), "digits/%d.wav", abs(member->volume_out_level)); - conf_member_play_file(member, msg, 0, SWITCH_TRUE); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } -void conf_loop_volume_talk_zero(conf_member_t *member, caller_control_action_t *action) +void conference_loop_volume_talk_zero(conference_member_t *member, caller_control_action_t *action) { char msg[512]; switch_event_t *event; @@ -388,26 +388,26 @@ void conf_loop_volume_talk_zero(conf_member_t *member, caller_control_action_t * if (test_eflag(member->conference, EFLAG_VOLUME_LEVEL) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "volume-level"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->volume_out_level); switch_event_fire(&event); } //switch_snprintf(msg, sizeof(msg), "Volume level %d", member->volume_out_level); - //conf_member_say(member, msg, 0); + //conference_member_say(member, msg, 0); if (member->volume_out_level < 0) { switch_snprintf(msg, sizeof(msg), "currency/negative.wav", member->volume_out_level); - conf_member_play_file(member, msg, 0, SWITCH_TRUE); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } switch_snprintf(msg, sizeof(msg), "digits/%d.wav", abs(member->volume_out_level)); - conf_member_play_file(member, msg, 0, SWITCH_TRUE); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } -void conf_loop_volume_talk_dn(conf_member_t *member, caller_control_action_t *action) +void conference_loop_volume_talk_dn(conference_member_t *member, caller_control_action_t *action) { char msg[512]; switch_event_t *event; @@ -420,25 +420,25 @@ void conf_loop_volume_talk_dn(conf_member_t *member, caller_control_action_t *ac if (test_eflag(member->conference, EFLAG_VOLUME_LEVEL) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "volume-level"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->volume_out_level); switch_event_fire(&event); } //switch_snprintf(msg, sizeof(msg), "Volume level %d", member->volume_out_level); - //conf_member_say(member, msg, 0); + //conference_member_say(member, msg, 0); if (member->volume_out_level < 0) { switch_snprintf(msg, sizeof(msg), "currency/negative.wav", member->volume_out_level); - conf_member_play_file(member, msg, 0, SWITCH_TRUE); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } switch_snprintf(msg, sizeof(msg), "digits/%d.wav", abs(member->volume_out_level)); - conf_member_play_file(member, msg, 0, SWITCH_TRUE); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } -void conf_loop_volume_listen_up(conf_member_t *member, caller_control_action_t *action) +void conference_loop_volume_listen_up(conference_member_t *member, caller_control_action_t *action) { char msg[512]; switch_event_t *event; @@ -451,26 +451,26 @@ void conf_loop_volume_listen_up(conf_member_t *member, caller_control_action_t * if (test_eflag(member->conference, EFLAG_GAIN_LEVEL) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "gain-level"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->volume_in_level); switch_event_fire(&event); } //switch_snprintf(msg, sizeof(msg), "Gain level %d", member->volume_in_level); - //conf_member_say(member, msg, 0); + //conference_member_say(member, msg, 0); if (member->volume_in_level < 0) { switch_snprintf(msg, sizeof(msg), "currency/negative.wav", member->volume_in_level); - conf_member_play_file(member, msg, 0, SWITCH_TRUE); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } switch_snprintf(msg, sizeof(msg), "digits/%d.wav", abs(member->volume_in_level)); - conf_member_play_file(member, msg, 0, SWITCH_TRUE); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } -void conf_loop_volume_listen_zero(conf_member_t *member, caller_control_action_t *action) +void conference_loop_volume_listen_zero(conference_member_t *member, caller_control_action_t *action) { char msg[512]; switch_event_t *event; @@ -482,26 +482,26 @@ void conf_loop_volume_listen_zero(conf_member_t *member, caller_control_action_t if (test_eflag(member->conference, EFLAG_GAIN_LEVEL) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "gain-level"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->volume_in_level); switch_event_fire(&event); } //switch_snprintf(msg, sizeof(msg), "Gain level %d", member->volume_in_level); - //conf_member_say(member, msg, 0); + //conference_member_say(member, msg, 0); if (member->volume_in_level < 0) { switch_snprintf(msg, sizeof(msg), "currency/negative.wav", member->volume_in_level); - conf_member_play_file(member, msg, 0, SWITCH_TRUE); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } switch_snprintf(msg, sizeof(msg), "digits/%d.wav", abs(member->volume_in_level)); - conf_member_play_file(member, msg, 0, SWITCH_TRUE); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } -void conf_loop_volume_listen_dn(conf_member_t *member, caller_control_action_t *action) +void conference_loop_volume_listen_dn(conference_member_t *member, caller_control_action_t *action) { char msg[512]; switch_event_t *event; @@ -514,29 +514,29 @@ void conf_loop_volume_listen_dn(conf_member_t *member, caller_control_action_t * if (test_eflag(member->conference, EFLAG_GAIN_LEVEL) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "gain-level"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->volume_in_level); switch_event_fire(&event); } //switch_snprintf(msg, sizeof(msg), "Gain level %d", member->volume_in_level); - //conf_member_say(member, msg, 0); + //conference_member_say(member, msg, 0); if (member->volume_in_level < 0) { switch_snprintf(msg, sizeof(msg), "currency/negative.wav", member->volume_in_level); - conf_member_play_file(member, msg, 0, SWITCH_TRUE); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } switch_snprintf(msg, sizeof(msg), "digits/%d.wav", abs(member->volume_in_level)); - conf_member_play_file(member, msg, 0, SWITCH_TRUE); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } -void conf_loop_event(conf_member_t *member, caller_control_action_t *action) +void conference_loop_event(conference_member_t *member, caller_control_action_t *action) { switch_event_t *event; if (test_eflag(member->conference, EFLAG_DTMF) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "dtmf"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "DTMF-Key", action->binded_dtmf); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Data", action->expanded_data); @@ -544,7 +544,7 @@ void conf_loop_event(conf_member_t *member, caller_control_action_t *action) } } -void conf_loop_transfer(conf_member_t *member, caller_control_action_t *action) +void conference_loop_transfer(conference_member_t *member, caller_control_action_t *action) { char *exten = NULL; char *dialplan = "XML"; @@ -556,12 +556,12 @@ void conf_loop_transfer(conf_member_t *member, caller_control_action_t *action) switch_event_t *event; if (test_eflag(member->conference, EFLAG_DTMF) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "transfer"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Dialplan", action->expanded_data); switch_event_fire(&event); } - conf_utils_member_clear_flag_locked(member, MFLAG_RUNNING); + conference_utils_member_clear_flag_locked(member, MFLAG_RUNNING); if ((mydata = switch_core_session_strdup(member->session, action->expanded_data))) { if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) { @@ -591,7 +591,7 @@ void conf_loop_transfer(conf_member_t *member, caller_control_action_t *action) return; } -void conf_loop_exec_app(conf_member_t *member, caller_control_action_t *action) +void conference_loop_exec_app(conference_member_t *member, caller_control_action_t *action) { char *app = NULL; char *arg = ""; @@ -605,7 +605,7 @@ void conf_loop_exec_app(conf_member_t *member, caller_control_action_t *action) if (!action->expanded_data) return; if (test_eflag(member->conference, EFLAG_DTMF) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "execute_app"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application", action->expanded_data); switch_event_fire(&event); @@ -650,16 +650,16 @@ void conf_loop_exec_app(conf_member_t *member, caller_control_action_t *action) return; } -void conf_loop_hangup(conf_member_t *member, caller_control_action_t *action) +void conference_loop_hangup(conference_member_t *member, caller_control_action_t *action) { - conf_utils_member_clear_flag_locked(member, MFLAG_RUNNING); + conference_utils_member_clear_flag_locked(member, MFLAG_RUNNING); } /* marshall frames from the call leg to the conference thread for muxing to other call legs */ -void *SWITCH_THREAD_FUNC conf_loop_input(switch_thread_t *thread, void *obj) +void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *obj) { switch_event_t *event; - conf_member_t *member = obj; + conference_member_t *member = obj; switch_channel_t *channel; switch_status_t status; switch_frame_t *read_frame = NULL; @@ -674,7 +674,7 @@ void *SWITCH_THREAD_FUNC conf_loop_input(switch_thread_t *thread, void *obj) switch_assert(member != NULL); - conf_utils_member_clear_flag_locked(member, MFLAG_TALKING); + conference_utils_member_clear_flag_locked(member, MFLAG_TALKING); channel = switch_core_session_get_channel(session); @@ -687,7 +687,7 @@ void *SWITCH_THREAD_FUNC conf_loop_input(switch_thread_t *thread, void *obj) /* As long as we have a valid read, feed that data into an input buffer where the conference thread will take it and mux it with any audio from other channels. */ - while (conf_utils_member_test_flag(member, MFLAG_RUNNING) && switch_channel_ready(channel)) { + while (conference_utils_member_test_flag(member, MFLAG_RUNNING) && switch_channel_ready(channel)) { if (switch_channel_ready(channel) && switch_channel_test_app_flag(channel, CF_APP_TAGGED)) { switch_yield(100000); @@ -700,18 +700,18 @@ void *SWITCH_THREAD_FUNC conf_loop_input(switch_thread_t *thread, void *obj) switch_mutex_lock(member->read_mutex); /* end the loop, if appropriate */ - if (!SWITCH_READ_ACCEPTABLE(status) || !conf_utils_member_test_flag(member, MFLAG_RUNNING)) { + if (!SWITCH_READ_ACCEPTABLE(status) || !conference_utils_member_test_flag(member, MFLAG_RUNNING)) { switch_mutex_unlock(member->read_mutex); break; } - if (switch_channel_test_flag(channel, CF_VIDEO) && !conf_utils_member_test_flag(member, MFLAG_ACK_VIDEO)) { - conf_utils_member_set_flag_locked(member, MFLAG_ACK_VIDEO); - conf_video_check_avatar(member, SWITCH_FALSE); + if (switch_channel_test_flag(channel, CF_VIDEO) && !conference_utils_member_test_flag(member, MFLAG_ACK_VIDEO)) { + conference_utils_member_set_flag_locked(member, MFLAG_ACK_VIDEO); + conference_video_check_avatar(member, SWITCH_FALSE); switch_core_session_video_reinit(member->session); - conf_video_set_floor_holder(member->conference, member, SWITCH_FALSE); - } else if (conf_utils_member_test_flag(member, MFLAG_ACK_VIDEO) && !switch_channel_test_flag(channel, CF_VIDEO)) { - conf_video_check_avatar(member, SWITCH_FALSE); + conference_video_set_floor_holder(member->conference, member, SWITCH_FALSE); + } else if (conference_utils_member_test_flag(member, MFLAG_ACK_VIDEO) && !switch_channel_test_flag(channel, CF_VIDEO)) { + conference_video_check_avatar(member, SWITCH_FALSE); } /* if we have caller digits, feed them to the parser to find an action */ @@ -720,8 +720,8 @@ void *SWITCH_THREAD_FUNC conf_loop_input(switch_thread_t *thread, void *obj) switch_channel_dequeue_dtmf_string(channel, dtmf, sizeof(dtmf)); - if (conf_utils_member_test_flag(member, MFLAG_DIST_DTMF)) { - conf_member_send_all_dtmf(member, member->conference, dtmf); + if (conference_utils_member_test_flag(member, MFLAG_DIST_DTMF)) { + conference_member_send_all_dtmf(member, member->conference, dtmf); } else if (member->dmachine) { char *p; char str[2] = ""; @@ -753,19 +753,19 @@ void *SWITCH_THREAD_FUNC conf_loop_input(switch_thread_t *thread, void *obj) if (hangunder_hits) { hangunder_hits--; } - if (conf_utils_member_test_flag(member, MFLAG_TALKING)) { + if (conference_utils_member_test_flag(member, MFLAG_TALKING)) { if (++hangover_hits >= hangover) { hangover_hits = hangunder_hits = 0; - conf_utils_member_clear_flag_locked(member, MFLAG_TALKING); - conf_member_update_status_field(member); - conf_member_check_agc_levels(member); - conf_member_clear_avg(member); + conference_utils_member_clear_flag_locked(member, MFLAG_TALKING); + conference_member_update_status_field(member); + conference_member_check_agc_levels(member); + conference_member_clear_avg(member); member->score_iir = 0; member->floor_packets = 0; if (test_eflag(member->conference, EFLAG_STOP_TALKING) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "stop-talking"); switch_event_fire(&event); } @@ -777,19 +777,19 @@ void *SWITCH_THREAD_FUNC conf_loop_input(switch_thread_t *thread, void *obj) if (member->nt_tally > (int32_t)(member->read_impl.actual_samples_per_second / member->read_impl.samples_per_packet) * 3) { member->agc_volume_in_level = 0; - conf_member_clear_avg(member); + conference_member_clear_avg(member); } /* Check for input volume adjustments */ if (!member->conference->agc_level) { member->conference->agc_level = 0; - conf_member_clear_avg(member); + conference_member_clear_avg(member); } /* if the member can speak, compute the audio energy level and */ /* generate events when the level crosses the threshold */ - if ((conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK) || conf_utils_member_test_flag(member, MFLAG_MUTE_DETECT))) { + if ((conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) || conference_utils_member_test_flag(member, MFLAG_MUTE_DETECT))) { uint32_t energy = 0, i = 0, samples = 0, j = 0; int16_t *data; int agc_period = (member->read_impl.actual_samples_per_second / member->read_impl.samples_per_packet) / 4; @@ -820,8 +820,8 @@ void *SWITCH_THREAD_FUNC conf_loop_input(switch_thread_t *thread, void *obj) } if (member->conference->agc_level && member->score && - conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK) && - conf_member_noise_gate_check(member) + conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) && + conference_member_noise_gate_check(member) ) { int last_shift = abs((int)(member->last_score - member->score)); @@ -846,7 +846,7 @@ void *SWITCH_THREAD_FUNC conf_loop_input(switch_thread_t *thread, void *obj) if (++member->agc_concur >= agc_period) { if (!member->vol_period) { - conf_member_check_agc_levels(member); + conference_member_check_agc_levels(member); } member->agc_concur = 0; } @@ -860,7 +860,7 @@ void *SWITCH_THREAD_FUNC conf_loop_input(switch_thread_t *thread, void *obj) member->score_iir = SCORE_MAX_IIR; } - if (conf_member_noise_gate_check(member)) { + if (conference_member_noise_gate_check(member)) { uint32_t diff = member->score - member->energy_level; if (hangover_hits) { hangover_hits--; @@ -879,27 +879,27 @@ void *SWITCH_THREAD_FUNC conf_loop_input(switch_thread_t *thread, void *obj) hangover_hits = hangunder_hits = 0; member->last_talking = switch_epoch_time_now(NULL); - if (!conf_utils_member_test_flag(member, MFLAG_TALKING)) { - conf_utils_member_set_flag_locked(member, MFLAG_TALKING); - conf_member_update_status_field(member); + if (!conference_utils_member_test_flag(member, MFLAG_TALKING)) { + conference_utils_member_set_flag_locked(member, MFLAG_TALKING); + conference_member_update_status_field(member); member->floor_packets = 0; - if (test_eflag(member->conference, EFLAG_START_TALKING) && conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK) && + if (test_eflag(member->conference, EFLAG_START_TALKING) && conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "start-talking"); switch_event_fire(&event); } - if (conf_utils_member_test_flag(member, MFLAG_MUTE_DETECT) && !conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { + if (conference_utils_member_test_flag(member, MFLAG_MUTE_DETECT) && !conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { if (!zstr(member->conference->mute_detect_sound)) { - conf_utils_member_set_flag(member, MFLAG_INDICATE_MUTE_DETECT); + conference_utils_member_set_flag(member, MFLAG_INDICATE_MUTE_DETECT); } if (test_eflag(member->conference, EFLAG_MUTE_DETECT) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "mute-detect"); switch_event_fire(&event); } @@ -915,18 +915,18 @@ void *SWITCH_THREAD_FUNC conf_loop_input(switch_thread_t *thread, void *obj) member->nt_tally++; } - if (conf_utils_member_test_flag(member, MFLAG_TALKING) && conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { + if (conference_utils_member_test_flag(member, MFLAG_TALKING) && conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { switch_event_t *event; if (++hangover_hits >= hangover) { hangover_hits = hangunder_hits = 0; - conf_utils_member_clear_flag_locked(member, MFLAG_TALKING); - conf_member_update_status_field(member); - conf_member_check_agc_levels(member); - conf_member_clear_avg(member); + conference_utils_member_clear_flag_locked(member, MFLAG_TALKING); + conference_member_update_status_field(member); + conference_member_check_agc_levels(member); + conference_member_clear_avg(member); if (test_eflag(member->conference, EFLAG_STOP_TALKING) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "stop-talking"); switch_event_fire(&event); } @@ -940,7 +940,7 @@ void *SWITCH_THREAD_FUNC conf_loop_input(switch_thread_t *thread, void *obj) if (member == member->conference->floor_holder) { if (member->id != member->conference->video_floor_holder && (member->floor_packets > member->conference->video_floor_packets || member->energy_level == 0)) { - conf_video_set_floor_holder(member->conference, member, SWITCH_FALSE); + conference_video_set_floor_holder(member->conference, member, SWITCH_FALSE); } } } @@ -953,7 +953,7 @@ void *SWITCH_THREAD_FUNC conf_loop_input(switch_thread_t *thread, void *obj) if (loops > 500) { member->loop_loop = 1; - if (conf_member_setup_media(member, member->conference)) { + if (conference_member_setup_media(member, member->conference)) { switch_mutex_unlock(member->read_mutex); break; } @@ -962,8 +962,8 @@ void *SWITCH_THREAD_FUNC conf_loop_input(switch_thread_t *thread, void *obj) } /* skip frames that are not actual media or when we are muted or silent */ - if ((conf_utils_member_test_flag(member, MFLAG_TALKING) || member->energy_level == 0 || conf_utils_test_flag(member->conference, CFLAG_AUDIO_ALWAYS)) - && conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK) && !conf_utils_test_flag(member->conference, CFLAG_WAIT_MOD) + if ((conference_utils_member_test_flag(member, MFLAG_TALKING) || member->energy_level == 0 || conference_utils_test_flag(member->conference, CFLAG_AUDIO_ALWAYS)) + && conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) && !conference_utils_test_flag(member->conference, CFLAG_WAIT_MOD) && (member->conference->count > 1 || (member->conference->record_count && member->conference->count >= member->conference->min_recording_participants))) { switch_audio_resampler_t *read_resampler = member->read_resampler; void *data; @@ -986,7 +986,7 @@ void *SWITCH_THREAD_FUNC conf_loop_input(switch_thread_t *thread, void *obj) tmp_frame.data = data; tmp_frame.datalen = datalen; tmp_frame.rate = member->conference->rate; - conf_member_check_channels(&tmp_frame, member, SWITCH_TRUE); + conference_member_check_channels(&tmp_frame, member, SWITCH_TRUE); if (datalen) { @@ -1028,14 +1028,14 @@ void *SWITCH_THREAD_FUNC conf_loop_input(switch_thread_t *thread, void *obj) end: - conf_utils_member_clear_flag_locked(member, MFLAG_ITHREAD); + conference_utils_member_clear_flag_locked(member, MFLAG_ITHREAD); return NULL; } /* launch an input thread for the call leg */ -void conf_loop_launch_input(conf_member_t *member, switch_memory_pool_t *pool) +void conference_loop_launch_input(conference_member_t *member, switch_memory_pool_t *pool) { switch_threadattr_t *thd_attr = NULL; @@ -1044,15 +1044,15 @@ void conf_loop_launch_input(conf_member_t *member, switch_memory_pool_t *pool) switch_threadattr_create(&thd_attr, pool); switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - conf_utils_member_set_flag_locked(member, MFLAG_ITHREAD); - if (switch_thread_create(&member->input_thread, thd_attr, conf_loop_input, member, pool) != SWITCH_STATUS_SUCCESS) { - conf_utils_member_clear_flag_locked(member, MFLAG_ITHREAD); + conference_utils_member_set_flag_locked(member, MFLAG_ITHREAD); + if (switch_thread_create(&member->input_thread, thd_attr, conference_loop_input, member, pool) != SWITCH_STATUS_SUCCESS) { + conference_utils_member_clear_flag_locked(member, MFLAG_ITHREAD); } } /* marshall frames from the conference (or file or tts output) to the call leg */ /* NB. this starts the input thread after some initial setup for the call leg */ -void conf_loop_output(conf_member_t *member) +void conference_loop_output(conference_member_t *member) { switch_channel_t *channel; switch_frame_t write_frame = { 0 }; @@ -1104,13 +1104,13 @@ void conf_loop_output(conf_member_t *member) write_frame.codec = &member->write_codec; /* Start the input thread */ - conf_loop_launch_input(member, switch_core_session_get_pool(member->session)); + conference_loop_launch_input(member, switch_core_session_get_pool(member->session)); if ((call_list = switch_channel_get_private(channel, "_conference_autocall_list_"))) { const char *cid_name = switch_channel_get_variable(channel, "conference_auto_outcall_caller_id_name"); const char *cid_num = switch_channel_get_variable(channel, "conference_auto_outcall_caller_id_number"); const char *toval = switch_channel_get_variable(channel, "conference_auto_outcall_timeout"); - const char *flags = switch_channel_get_variable(channel, "conf_utils_auto_outcall_flags"); + const char *flags = switch_channel_get_variable(channel, "conference_utils_auto_outcall_flags"); const char *profile = switch_channel_get_variable(channel, "conference_auto_outcall_profile"); const char *ann = switch_channel_get_variable(channel, "conference_auto_outcall_announce"); const char *prefix = switch_channel_get_variable(channel, "conference_auto_outcall_prefix"); @@ -1120,13 +1120,13 @@ void conf_loop_output(conf_member_t *member) int wait_sec = 2; int loops = 0; - if (ann && !switch_channel_test_app_flag_key("conf_silent", channel, CONF_SILENT_REQ)) { + if (ann && !switch_channel_test_app_flag_key("conference_silent", channel, CONF_SILENT_REQ)) { member->conference->special_announce = switch_core_strdup(member->conference->pool, ann); } switch_channel_set_private(channel, "_conference_autocall_list_", NULL); - conf_utils_set_flag(member->conference, CFLAG_OUTCALL); + conference_utils_set_flag(member->conference, CFLAG_OUTCALL); if (toval) { to = atoi(toval); @@ -1151,7 +1151,7 @@ void conf_loop_output(conf_member_t *member) for (x = 0; x < argc; x++) { char *dial_str = switch_mprintf("%s%s", switch_str_nil(prefix), argv[x]); switch_assert(dial_str); - conf_outcall_bg(member->conference, NULL, NULL, dial_str, to, switch_str_nil(flags), cid_name, cid_num, NULL, + conference_outcall_bg(member->conference, NULL, NULL, dial_str, to, switch_str_nil(flags), cid_name, cid_num, NULL, profile, &member->conference->cancel_cause, NULL); switch_safe_free(dial_str); } @@ -1179,23 +1179,23 @@ void conf_loop_output(conf_member_t *member) goto end; } - conf_member_play_file(member, "tone_stream://%(500,0,640)", 0, SWITCH_TRUE); + conference_member_play_file(member, "tone_stream://%(500,0,640)", 0, SWITCH_TRUE); } - if (!conf_utils_test_flag(member->conference, CFLAG_ANSWERED)) { + if (!conference_utils_test_flag(member->conference, CFLAG_ANSWERED)) { switch_channel_answer(channel); } sanity = 2000; - while(!conf_utils_member_test_flag(member, MFLAG_ITHREAD) && sanity > 0) { + while(!conference_utils_member_test_flag(member, MFLAG_ITHREAD) && sanity > 0) { switch_cond_next(); sanity--; } /* Fair WARNING, If you expect the caller to hear anything or for digit handling to be processed, */ /* you better not block this thread loop for more than the duration of member->conference->timer_name! */ - while (!member->loop_loop && conf_utils_member_test_flag(member, MFLAG_RUNNING) && conf_utils_member_test_flag(member, MFLAG_ITHREAD) + while (!member->loop_loop && conference_utils_member_test_flag(member, MFLAG_RUNNING) && conference_utils_member_test_flag(member, MFLAG_ITHREAD) && switch_channel_ready(channel)) { switch_event_t *event; int use_timer = 0; @@ -1207,7 +1207,7 @@ void conf_loop_output(conf_member_t *member) if (switch_channel_test_flag(member->channel, CF_CONFERENCE_ADV)) { if (member->conference->la) { - conf_event_adv_la(member->conference, member, SWITCH_TRUE); + conference_event_adv_la(member->conference, member, SWITCH_TRUE); } switch_channel_clear_flag(member->channel, CF_CONFERENCE_ADV); } @@ -1236,13 +1236,13 @@ void conf_loop_output(conf_member_t *member) if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) { /* test to see if outbound channel has answered */ - if (switch_channel_test_flag(channel, CF_ANSWERED) && !conf_utils_test_flag(member->conference, CFLAG_ANSWERED)) { + if (switch_channel_test_flag(channel, CF_ANSWERED) && !conference_utils_test_flag(member->conference, CFLAG_ANSWERED)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member->session), SWITCH_LOG_DEBUG, "Outbound conference channel answered, setting CFLAG_ANSWERED\n"); - conf_utils_set_flag(member->conference, CFLAG_ANSWERED); + conference_utils_set_flag(member->conference, CFLAG_ANSWERED); } } else { - if (conf_utils_test_flag(member->conference, CFLAG_ANSWERED) && !switch_channel_test_flag(channel, CF_ANSWERED)) { + if (conference_utils_test_flag(member->conference, CFLAG_ANSWERED) && !switch_channel_test_flag(channel, CF_ANSWERED)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member->session), SWITCH_LOG_DEBUG, "CLFAG_ANSWERED set, answering inbound channel\n"); switch_channel_answer(channel); } @@ -1257,16 +1257,16 @@ void conf_loop_output(conf_member_t *member) if (mux_used < bytes) { if (++low_count >= 5) { /* partial frame sitting around this long is useless and builds delay */ - conf_utils_member_set_flag_locked(member, MFLAG_FLUSH_BUFFER); + conference_utils_member_set_flag_locked(member, MFLAG_FLUSH_BUFFER); } } else if (mux_used > flush_len) { /* getting behind, clear the buffer */ - conf_utils_member_set_flag_locked(member, MFLAG_FLUSH_BUFFER); + conference_utils_member_set_flag_locked(member, MFLAG_FLUSH_BUFFER); } } if (switch_channel_test_app_flag(channel, CF_APP_TAGGED)) { - conf_utils_member_set_flag_locked(member, MFLAG_FLUSH_BUFFER); + conference_utils_member_set_flag_locked(member, MFLAG_FLUSH_BUFFER); } else if (mux_used >= bytes) { /* Flush the output buffer and write all the data (presumably muxed) back to the channel */ switch_mutex_lock(member->audio_out_mutex); @@ -1278,7 +1278,7 @@ void conf_loop_output(conf_member_t *member) if (write_frame.datalen) { write_frame.samples = write_frame.datalen / 2 / member->conference->channels; - if( !conf_utils_member_test_flag(member, MFLAG_CAN_HEAR)) { + if( !conference_utils_member_test_flag(member, MFLAG_CAN_HEAR)) { memset(write_frame.data, 255, write_frame.datalen); } else if (member->volume_out_level) { /* Check for output volume adjustments */ switch_change_sln_volume(write_frame.data, write_frame.samples * member->conference->channels, member->volume_out_level); @@ -1287,10 +1287,10 @@ void conf_loop_output(conf_member_t *member) write_frame.timestamp = timer.samplecount; if (member->fnode) { - conf_member_add_file_data(member, write_frame.data, write_frame.datalen); + conference_member_add_file_data(member, write_frame.data, write_frame.datalen); } - conf_member_check_channels(&write_frame, member, SWITCH_FALSE); + conference_member_check_channels(&write_frame, member, SWITCH_FALSE); if (switch_core_session_write_frame(member->session, &write_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) { switch_mutex_unlock(member->audio_out_mutex); @@ -1302,59 +1302,59 @@ void conf_loop_output(conf_member_t *member) switch_mutex_unlock(member->audio_out_mutex); } - if (conf_utils_member_test_flag(member, MFLAG_FLUSH_BUFFER)) { + if (conference_utils_member_test_flag(member, MFLAG_FLUSH_BUFFER)) { if (switch_buffer_inuse(member->mux_buffer)) { switch_mutex_lock(member->audio_out_mutex); switch_buffer_zero(member->mux_buffer); switch_mutex_unlock(member->audio_out_mutex); } - conf_utils_member_clear_flag_locked(member, MFLAG_FLUSH_BUFFER); + conference_utils_member_clear_flag_locked(member, MFLAG_FLUSH_BUFFER); } switch_mutex_unlock(member->write_mutex); - if (conf_utils_member_test_flag(member, MFLAG_INDICATE_MUTE)) { + if (conference_utils_member_test_flag(member, MFLAG_INDICATE_MUTE)) { if (!zstr(member->conference->muted_sound)) { - conf_member_play_file(member, member->conference->muted_sound, 0, SWITCH_TRUE); + conference_member_play_file(member, member->conference->muted_sound, 0, SWITCH_TRUE); } else { char msg[512]; switch_snprintf(msg, sizeof(msg), "Muted"); - conf_member_say(member, msg, 0); + conference_member_say(member, msg, 0); } - conf_utils_member_clear_flag(member, MFLAG_INDICATE_MUTE); + conference_utils_member_clear_flag(member, MFLAG_INDICATE_MUTE); } - if (conf_utils_member_test_flag(member, MFLAG_INDICATE_MUTE_DETECT)) { + if (conference_utils_member_test_flag(member, MFLAG_INDICATE_MUTE_DETECT)) { if (!zstr(member->conference->mute_detect_sound)) { - conf_member_play_file(member, member->conference->mute_detect_sound, 0, SWITCH_TRUE); + conference_member_play_file(member, member->conference->mute_detect_sound, 0, SWITCH_TRUE); } else { char msg[512]; switch_snprintf(msg, sizeof(msg), "Currently Muted"); - conf_member_say(member, msg, 0); + conference_member_say(member, msg, 0); } - conf_utils_member_clear_flag(member, MFLAG_INDICATE_MUTE_DETECT); + conference_utils_member_clear_flag(member, MFLAG_INDICATE_MUTE_DETECT); } - if (conf_utils_member_test_flag(member, MFLAG_INDICATE_UNMUTE)) { + if (conference_utils_member_test_flag(member, MFLAG_INDICATE_UNMUTE)) { if (!zstr(member->conference->unmuted_sound)) { - conf_member_play_file(member, member->conference->unmuted_sound, 0, SWITCH_TRUE); + conference_member_play_file(member, member->conference->unmuted_sound, 0, SWITCH_TRUE); } else { char msg[512]; switch_snprintf(msg, sizeof(msg), "Un-Muted"); - conf_member_say(member, msg, 0); + conference_member_say(member, msg, 0); } - conf_utils_member_clear_flag(member, MFLAG_INDICATE_UNMUTE); + conference_utils_member_clear_flag(member, MFLAG_INDICATE_UNMUTE); } if (switch_core_session_private_event_count(member->session)) { switch_channel_set_app_flag(channel, CF_APP_TAGGED); switch_ivr_parse_all_events(member->session); switch_channel_clear_app_flag(channel, CF_APP_TAGGED); - conf_utils_member_set_flag_locked(member, MFLAG_FLUSH_BUFFER); + conference_utils_member_set_flag_locked(member, MFLAG_FLUSH_BUFFER); switch_core_session_set_read_codec(member->session, &member->read_codec); } else { switch_ivr_parse_all_messages(member->session); @@ -1371,7 +1371,7 @@ void conf_loop_output(conf_member_t *member) end: if (!member->loop_loop) { - conf_utils_member_clear_flag_locked(member, MFLAG_RUNNING); + conference_utils_member_clear_flag_locked(member, MFLAG_RUNNING); /* Wait for the input thread to end */ if (member->input_thread) { diff --git a/src/mod/applications/mod_conference/mod_conference_member.c b/src/mod/applications/mod_conference/conference_member.c similarity index 78% rename from src/mod/applications/mod_conference/mod_conference_member.c rename to src/mod/applications/mod_conference/conference_member.c index 4ef8716d38..7277401b84 100644 --- a/src/mod/applications/mod_conference/mod_conference_member.c +++ b/src/mod/applications/mod_conference/conference_member.c @@ -41,7 +41,7 @@ */ #include -int conf_member_noise_gate_check(conf_member_t *member) +int conference_member_noise_gate_check(conference_member_t *member) { int r = 0; @@ -62,7 +62,7 @@ int conf_member_noise_gate_check(conf_member_t *member) return r; } -void conf_member_clear_avg(conf_member_t *member) +void conference_member_clear_avg(conference_member_t *member) { member->avg_score = 0; @@ -71,7 +71,7 @@ void conf_member_clear_avg(conf_member_t *member) member->agc_concur = 0; } -void conf_member_do_binding(conf_member_t *member, conf_key_callback_t handler, const char *digits, const char *data) +void conference_member_do_binding(conference_member_t *member, conference_key_callback_t handler, const char *digits, const char *data) { key_binding_t *binding; @@ -85,11 +85,11 @@ void conf_member_do_binding(conf_member_t *member, conf_key_callback_t handler, } binding->handler = handler; - switch_ivr_dmachine_bind(member->dmachine, "conf", digits, 0, conf_loop_dmachine_dispatcher, binding); + switch_ivr_dmachine_bind(member->dmachine, "conf", digits, 0, conference_loop_dmachine_dispatcher, binding); } -void conf_member_bind_controls(conf_member_t *member, const char *controls) +void conference_member_bind_controls(conference_member_t *member, const char *controls) { switch_xml_t cxml, cfg, xgroups, xcontrol; switch_event_t *params; @@ -123,12 +123,12 @@ void conf_member_bind_controls(conf_member_t *member, const char *controls) if (zstr(key) || zstr(digits)) continue; - for(i = 0; i < conf_loop_mapping_len(); i++) { + for(i = 0; i < conference_loop_mapping_len(); i++) { if (!strcasecmp(key, control_mappings[i].name)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s binding '%s' to '%s'\n", switch_core_session_get_name(member->session), digits, key); - conf_member_do_binding(member, control_mappings[i].handler, digits, data); + conference_member_do_binding(member, control_mappings[i].handler, digits, data); } } } @@ -145,24 +145,24 @@ void conf_member_bind_controls(conf_member_t *member, const char *controls) } -void conf_member_update_status_field(conf_member_t *member) +void conference_member_update_status_field(conference_member_t *member) { char *str, *vstr = "", display[128] = "", *json_display = NULL; cJSON *json, *audio, *video; if (!member->conference->la || !member->json || - !member->status_field || switch_channel_test_flag(member->channel, CF_VIDEO_ONLY) || conf_utils_member_test_flag(member, MFLAG_SECOND_SCREEN)) { + !member->status_field || switch_channel_test_flag(member->channel, CF_VIDEO_ONLY) || conference_utils_member_test_flag(member, MFLAG_SECOND_SCREEN)) { return; } switch_live_array_lock(member->conference->la); - if (conf_utils_test_flag(member->conference, CFLAG_JSON_STATUS)) { + if (conference_utils_test_flag(member->conference, CFLAG_JSON_STATUS)) { json = cJSON_CreateObject(); audio = cJSON_CreateObject(); - cJSON_AddItemToObject(audio, "muted", cJSON_CreateBool(!conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK))); + cJSON_AddItemToObject(audio, "muted", cJSON_CreateBool(!conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK))); cJSON_AddItemToObject(audio, "onHold", cJSON_CreateBool(switch_channel_test_flag(member->channel, CF_HOLD))); - cJSON_AddItemToObject(audio, "talking", cJSON_CreateBool(conf_utils_member_test_flag(member, MFLAG_TALKING))); + cJSON_AddItemToObject(audio, "talking", cJSON_CreateBool(conference_utils_member_test_flag(member, MFLAG_TALKING))); cJSON_AddItemToObject(audio, "floor", cJSON_CreateBool(member == member->conference->floor_holder)); cJSON_AddItemToObject(audio, "energyScore", cJSON_CreateNumber(member->score)); cJSON_AddItemToObject(json, "audio", audio); @@ -171,9 +171,9 @@ void conf_member_update_status_field(conf_member_t *member) video = cJSON_CreateObject(); cJSON_AddItemToObject(video, "avatarPresented", cJSON_CreateBool(!!member->avatar_png_img)); cJSON_AddItemToObject(video, "mediaFlow", cJSON_CreateString(member->video_flow == SWITCH_MEDIA_FLOW_SENDONLY ? "sendOnly" : "sendRecv")); - cJSON_AddItemToObject(video, "muted", cJSON_CreateBool(!conf_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN))); + cJSON_AddItemToObject(video, "muted", cJSON_CreateBool(!conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN))); cJSON_AddItemToObject(video, "floor", cJSON_CreateBool(member && member->id == member->conference->video_floor_holder)); - if (member && member->id == member->conference->video_floor_holder && conf_utils_test_flag(member->conference, CFLAG_VID_FLOOR_LOCK)) { + if (member && member->id == member->conference->video_floor_holder && conference_utils_test_flag(member->conference, CFLAG_VID_FLOOR_LOCK)) { cJSON_AddItemToObject(video, "floorLocked", cJSON_CreateTrue()); } cJSON_AddItemToObject(video, "reservationID", member->video_reservation_id ? @@ -189,24 +189,24 @@ void conf_member_update_status_field(conf_member_t *member) json_display = cJSON_PrintUnformatted(json); cJSON_Delete(json); } else { - if (!conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { + if (!conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { str = "MUTE"; } else if (switch_channel_test_flag(member->channel, CF_HOLD)) { str = "HOLD"; } else if (member == member->conference->floor_holder) { - if (conf_utils_member_test_flag(member, MFLAG_TALKING)) { + if (conference_utils_member_test_flag(member, MFLAG_TALKING)) { str = "TALKING (FLOOR)"; } else { str = "FLOOR"; } - } else if (conf_utils_member_test_flag(member, MFLAG_TALKING)) { + } else if (conference_utils_member_test_flag(member, MFLAG_TALKING)) { str = "TALKING"; } else { str = "ACTIVE"; } if (switch_channel_test_flag(member->channel, CF_VIDEO)) { - if (!conf_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN)) { + if (!conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN)) { vstr = " VIDEO (BLIND)"; } else { vstr = " VIDEO"; @@ -230,7 +230,7 @@ void conf_member_update_status_field(conf_member_t *member) switch_live_array_unlock(member->conference->la); } -switch_status_t conf_member_add_event_data(conf_member_t *member, switch_event_t *event) +switch_status_t conference_member_add_event_data(conference_member_t *member, switch_event_t *event) { switch_status_t status = SWITCH_STATUS_SUCCESS; @@ -238,7 +238,7 @@ switch_status_t conf_member_add_event_data(conf_member_t *member, switch_event_t return status; if (member->conference) { - status = conf_event_add_data(member->conference, event); + status = conference_event_add_data(member->conference, event); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Floor", "%s", (member == member->conference->floor_holder) ? "true" : "false" ); } @@ -255,14 +255,14 @@ switch_status_t conf_member_add_event_data(conf_member_t *member, switch_event_t } - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Hear", "%s", conf_utils_member_test_flag(member, MFLAG_CAN_HEAR) ? "true" : "false" ); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "See", "%s", conf_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN) ? "true" : "false" ); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Speak", "%s", conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK) ? "true" : "false" ); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Talking", "%s", conf_utils_member_test_flag(member, MFLAG_TALKING) ? "true" : "false" ); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Mute-Detect", "%s", conf_utils_member_test_flag(member, MFLAG_MUTE_DETECT) ? "true" : "false" ); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Hear", "%s", conference_utils_member_test_flag(member, MFLAG_CAN_HEAR) ? "true" : "false" ); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "See", "%s", conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN) ? "true" : "false" ); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Speak", "%s", conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) ? "true" : "false" ); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Talking", "%s", conference_utils_member_test_flag(member, MFLAG_TALKING) ? "true" : "false" ); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Mute-Detect", "%s", conference_utils_member_test_flag(member, MFLAG_MUTE_DETECT) ? "true" : "false" ); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-Type", "%s", conf_utils_member_test_flag(member, MFLAG_MOD) ? "moderator" : "member"); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-Ghost", "%s", conf_utils_member_test_flag(member, MFLAG_GHOST) ? "true" : "false"); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-Type", "%s", conference_utils_member_test_flag(member, MFLAG_MOD) ? "moderator" : "member"); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-Ghost", "%s", conference_utils_member_test_flag(member, MFLAG_GHOST) ? "true" : "false"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Energy-Level", "%d", member->energy_level); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Current-Energy", "%d", member->score); @@ -271,17 +271,17 @@ switch_status_t conf_member_add_event_data(conf_member_t *member, switch_event_t #ifndef OPENAL_POSITIONING -switch_status_t conf_member_parse_position(conf_member_t *member, const char *data) +switch_status_t conference_member_parse_position(conference_member_t *member, const char *data) { return SWITCH_STATUS_FALSE; } #else -switch_status_t conf_member_parse_position(conf_member_t *member, const char *data) +switch_status_t conference_member_parse_position(conference_member_t *member, const char *data) { switch_status_t status = SWITCH_STATUS_FALSE; if (member->al) { - status = conf_al_parse_position(member->al, data); + status = conference_al_parse_position(member->al, data); } return status; @@ -290,7 +290,7 @@ switch_status_t conf_member_parse_position(conf_member_t *member, const char *da #endif /* if other_member has a relationship with member, produce it */ -conference_relationship_t *conf_member_get_relationship(conf_member_t *member, conf_member_t *other_member) +conference_relationship_t *conference_member_get_relationship(conference_member_t *member, conference_member_t *other_member) { conference_relationship_t *rel = NULL, *global = NULL; @@ -318,7 +318,7 @@ conference_relationship_t *conf_member_get_relationship(conf_member_t *member, c } /* stop playing a file for the member of the conference */ -uint32_t conf_member_stop_file(conf_member_t *member, file_stop_t stop) +uint32_t conference_member_stop_file(conference_member_t *member, file_stop_t stop) { conference_file_node_t *nptr; uint32_t count = 0; @@ -349,9 +349,9 @@ uint32_t conf_member_stop_file(conf_member_t *member, file_stop_t stop) /* traverse the conference member list for the specified member id and return it's pointer */ -conf_member_t *conf_member_get(conference_obj_t *conference, uint32_t id) +conference_member_t *conference_member_get(conference_obj_t *conference, uint32_t id) { - conf_member_t *member = NULL; + conference_member_t *member = NULL; switch_assert(conference != NULL); if (!id) { @@ -361,7 +361,7 @@ conf_member_t *conf_member_get(conference_obj_t *conference, uint32_t id) switch_mutex_lock(conference->member_mutex); for (member = conference->members; member; member = member->next) { - if (conf_utils_member_test_flag(member, MFLAG_NOCHANNEL)) { + if (conference_utils_member_test_flag(member, MFLAG_NOCHANNEL)) { continue; } @@ -371,8 +371,8 @@ conf_member_t *conf_member_get(conference_obj_t *conference, uint32_t id) } if (member) { - if (!conf_utils_member_test_flag(member, MFLAG_INTREE) || - conf_utils_member_test_flag(member, MFLAG_KICKED) || + if (!conference_utils_member_test_flag(member, MFLAG_INTREE) || + conference_utils_member_test_flag(member, MFLAG_KICKED) || (member->session && !switch_channel_up(switch_core_session_get_channel(member->session)))) { /* member is kicked or hanging up so forget it */ @@ -392,7 +392,7 @@ conf_member_t *conf_member_get(conference_obj_t *conference, uint32_t id) return member; } -void conf_member_check_agc_levels(conf_member_t *member) +void conference_member_check_agc_levels(conference_member_t *member) { int x = 0; @@ -415,13 +415,13 @@ void conf_member_check_agc_levels(conf_member_t *member) member->id, member->conference->agc_level - member->avg_score, member->conference->agc_level, member->score, member->avg_score, member->agc_volume_in_level, x > 0 ? "+++" : "---"); - conf_member_clear_avg(member); + conference_member_clear_avg(member); } } -void conf_member_check_channels(switch_frame_t *frame, conf_member_t *member, switch_bool_t in) +void conference_member_check_channels(switch_frame_t *frame, conference_member_t *member, switch_bool_t in) { - if (member->conference->channels != member->read_impl.number_of_channels || conf_utils_member_test_flag(member, MFLAG_POSITIONAL)) { + if (member->conference->channels != member->read_impl.number_of_channels || conference_utils_member_test_flag(member, MFLAG_POSITIONAL)) { uint32_t rlen; int from, to; @@ -435,14 +435,14 @@ void conf_member_check_channels(switch_frame_t *frame, conf_member_t *member, sw rlen = frame->datalen / 2 / from; - if (in && frame->rate == 48000 && ((from == 1 && to == 2) || (from == 2 && to == 2)) && conf_utils_member_test_flag(member, MFLAG_POSITIONAL)) { + if (in && frame->rate == 48000 && ((from == 1 && to == 2) || (from == 2 && to == 2)) && conference_utils_member_test_flag(member, MFLAG_POSITIONAL)) { if (from == 2 && to == 2) { switch_mux_channels((int16_t *) frame->data, rlen, 2, 1); frame->datalen /= 2; rlen = frame->datalen / 2; } - conf_al_process(member->al, frame->data, frame->datalen, frame->rate); + conference_al_process(member->al, frame->data, frame->datalen, frame->rate); } else { switch_mux_channels((int16_t *) frame->data, rlen, from, to); } @@ -453,7 +453,7 @@ void conf_member_check_channels(switch_frame_t *frame, conf_member_t *member, sw } -void conf_member_add_file_data(conf_member_t *member, int16_t *data, switch_size_t file_data_len) +void conference_member_add_file_data(conference_member_t *member, int16_t *data, switch_size_t file_data_len) { switch_size_t file_sample_len; int16_t file_frame[SWITCH_RECOMMENDED_BUFFER_SIZE] = { 0 }; @@ -517,7 +517,7 @@ void conf_member_add_file_data(conf_member_t *member, int16_t *data, switch_size } if (member->fnode->al) { - conf_al_process(member->fnode->al, file_frame, file_sample_len * 2, member->conference->rate); + conference_al_process(member->fnode->al, file_frame, file_sample_len * 2, member->conference->rate); } for (i = 0; i < (int)file_sample_len * member->conference->channels; i++) { @@ -541,7 +541,7 @@ void conf_member_add_file_data(conf_member_t *member, int16_t *data, switch_size /* Add a custom relationship to a member */ -conference_relationship_t *conf_member_add_relationship(conf_member_t *member, uint32_t id) +conference_relationship_t *conference_member_add_relationship(conference_member_t *member, uint32_t id) { conference_relationship_t *rel = NULL; @@ -563,7 +563,7 @@ conference_relationship_t *conf_member_add_relationship(conf_member_t *member, u } /* Remove a custom relationship from a member */ -switch_status_t conf_member_del_relationship(conf_member_t *member, uint32_t id) +switch_status_t conference_member_del_relationship(conference_member_t *member, uint32_t id) { switch_status_t status = SWITCH_STATUS_FALSE; conference_relationship_t *rel, *last = NULL; @@ -576,7 +576,7 @@ switch_status_t conf_member_del_relationship(conf_member_t *member, uint32_t id) if (id == 0 || rel->id == id) { /* we just forget about rel here cos it was allocated by the member's pool it will be freed when the member is */ - conf_member_t *omember; + conference_member_t *omember; status = SWITCH_STATUS_SUCCESS; @@ -587,9 +587,9 @@ switch_status_t conf_member_del_relationship(conf_member_t *member, uint32_t id) } if ((rel->flags & RFLAG_CAN_SEND_VIDEO)) { - conf_utils_member_clear_flag(member, MFLAG_RECEIVING_VIDEO); - if ((omember = conf_member_get(member->conference, rel->id))) { - conf_utils_member_clear_flag(omember, MFLAG_RECEIVING_VIDEO); + conference_utils_member_clear_flag(member, MFLAG_RECEIVING_VIDEO); + if ((omember = conference_member_get(member->conference, rel->id))) { + conference_utils_member_clear_flag(omember, MFLAG_RECEIVING_VIDEO); switch_thread_rwlock_unlock(omember->rwlock); } } @@ -611,7 +611,7 @@ switch_status_t conf_member_del_relationship(conf_member_t *member, uint32_t id) /* Gain exclusive access and add the member to the list */ -switch_status_t conf_member_add(conference_obj_t *conference, conf_member_t *member) +switch_status_t conference_member_add(conference_obj_t *conference, conference_member_t *member) { switch_status_t status = SWITCH_STATUS_FALSE; switch_event_t *event; @@ -645,46 +645,46 @@ switch_status_t conf_member_add(conference_obj_t *conference, conf_member_t *mem switch_queue_create(&member->dtmf_queue, 100, member->pool); - if (conf_utils_test_flag(conference, CFLAG_PERSONAL_CANVAS)) { + if (conference_utils_test_flag(conference, CFLAG_PERSONAL_CANVAS)) { video_layout_t *vlayout = NULL; switch_mutex_lock(conference->canvas_mutex); - if ((vlayout = conf_video_get_layout(conference, conference->video_layout_name, conference->video_layout_group))) { - conf_video_init_canvas(conference, vlayout, &member->canvas); - conf_video_init_canvas_layers(conference, member->canvas, vlayout); + if ((vlayout = conference_video_get_layout(conference, conference->video_layout_name, conference->video_layout_group))) { + conference_video_init_canvas(conference, vlayout, &member->canvas); + conference_video_init_canvas_layers(conference, member->canvas, vlayout); } switch_mutex_unlock(conference->canvas_mutex); } if (member->video_flow == SWITCH_MEDIA_FLOW_SENDONLY) { - conf_utils_member_clear_flag_locked(member, MFLAG_CAN_BE_SEEN); + conference_utils_member_clear_flag_locked(member, MFLAG_CAN_BE_SEEN); } conference->members = member; - conf_utils_member_set_flag_locked(member, MFLAG_INTREE); + conference_utils_member_set_flag_locked(member, MFLAG_INTREE); switch_mutex_unlock(conference->member_mutex); - conf_cdr_add(member); + conference_cdr_add(member); - if (!conf_utils_member_test_flag(member, MFLAG_NOCHANNEL)) { - if (conf_utils_member_test_flag(member, MFLAG_GHOST)) { + if (!conference_utils_member_test_flag(member, MFLAG_NOCHANNEL)) { + if (conference_utils_member_test_flag(member, MFLAG_GHOST)) { conference->count_ghosts++; } else { conference->count++; } - if (conf_utils_member_test_flag(member, MFLAG_ENDCONF)) { + if (conference_utils_member_test_flag(member, MFLAG_ENDCONF)) { if (conference->end_count++) { - conference->endconf_time = 0; + conference->endconference_time = 0; } } - conf_send_presence(conference); + conference_send_presence(conference); channel = switch_core_session_get_channel(member->session); member->video_flow = switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO); - conf_video_check_avatar(member, SWITCH_FALSE); + conference_video_check_avatar(member, SWITCH_FALSE); if ((var = switch_channel_get_variable_dup(member->channel, "video_initial_canvas", SWITCH_FALSE, -1))) { int id = atoi(var) - 1; @@ -706,7 +706,7 @@ switch_status_t conf_member_add(conference_obj_t *conference, conf_member_t *mem } } - conf_video_reset_member_codec_index(member); + conference_video_reset_member_codec_index(member); if ((var = switch_channel_get_variable_dup(member->channel, "video_mute_png", SWITCH_FALSE, -1))) { member->video_mute_png = switch_core_strdup(member->pool, var); @@ -718,12 +718,12 @@ switch_status_t conf_member_add(conference_obj_t *conference, conf_member_t *mem } if ((var = switch_channel_get_variable(channel, "video_use_dedicated_encoder")) && switch_true(var)) { - conf_utils_member_set_flag_locked(member, MFLAG_NO_MINIMIZE_ENCODING); + conference_utils_member_set_flag_locked(member, MFLAG_NO_MINIMIZE_ENCODING); } - switch_channel_set_variable_printf(channel, "conf_member_id", "%d", member->id); - switch_channel_set_variable_printf(channel, "conference_moderator", "%s", conf_utils_member_test_flag(member, MFLAG_MOD) ? "true" : "false"); - switch_channel_set_variable_printf(channel, "conference_ghost", "%s", conf_utils_member_test_flag(member, MFLAG_GHOST) ? "true" : "false"); + switch_channel_set_variable_printf(channel, "conference_member_id", "%d", member->id); + switch_channel_set_variable_printf(channel, "conference_moderator", "%s", conference_utils_member_test_flag(member, MFLAG_MOD) ? "true" : "false"); + switch_channel_set_variable_printf(channel, "conference_ghost", "%s", conference_utils_member_test_flag(member, MFLAG_GHOST) ? "true" : "false"); switch_channel_set_variable(channel, "conference_recording", conference->record_filename); switch_channel_set_variable(channel, CONFERENCE_UUID_VARIABLE, conference->uuid_str); @@ -733,26 +733,26 @@ switch_status_t conf_member_add(conference_obj_t *conference, conf_member_t *mem } if (!switch_channel_get_variable(channel, "conference_call_key")) { - char *key = switch_core_session_sprintf(member->session, "conf_%s_%s_%s", + char *key = switch_core_session_sprintf(member->session, "conference_%s_%s_%s", conference->name, conference->domain, switch_channel_get_variable(channel, "caller_id_number")); switch_channel_set_variable(channel, "conference_call_key", key); } - if (conf_utils_test_flag(conference, CFLAG_WAIT_MOD) && conf_utils_member_test_flag(member, MFLAG_MOD)) { - conf_utils_clear_flag(conference, CFLAG_WAIT_MOD); + if (conference_utils_test_flag(conference, CFLAG_WAIT_MOD) && conference_utils_member_test_flag(member, MFLAG_MOD)) { + conference_utils_clear_flag(conference, CFLAG_WAIT_MOD); } if (conference->count > 1) { - if ((conference->moh_sound && !conf_utils_test_flag(conference, CFLAG_WAIT_MOD)) || - (conf_utils_test_flag(conference, CFLAG_WAIT_MOD) && !switch_true(switch_channel_get_variable(channel, "conference_permanent_wait_mod_moh")))) { + if ((conference->moh_sound && !conference_utils_test_flag(conference, CFLAG_WAIT_MOD)) || + (conference_utils_test_flag(conference, CFLAG_WAIT_MOD) && !switch_true(switch_channel_get_variable(channel, "conference_permanent_wait_mod_moh")))) { /* stop MoH if any */ conference_file_stop(conference, FILE_STOP_ASYNC); } - if (!switch_channel_test_app_flag_key("conf_silent", channel, CONF_SILENT_REQ) && !zstr(conference->enter_sound)) { + if (!switch_channel_test_app_flag_key("conference_silent", channel, CONF_SILENT_REQ) && !zstr(conference->enter_sound)) { const char * enter_sound = switch_channel_get_variable(channel, "conference_enter_sound"); - if (conf_utils_test_flag(conference, CFLAG_ENTER_SOUND) && !conf_utils_member_test_flag(member, MFLAG_SILENT)) { + if (conference_utils_test_flag(conference, CFLAG_ENTER_SOUND) && !conference_utils_member_test_flag(member, MFLAG_SILENT)) { if (!zstr(enter_sound)) { conference_file_play(conference, (char *)enter_sound, CONF_DEFAULT_LEADIN, switch_core_session_get_channel(member->session), 0); @@ -769,24 +769,24 @@ switch_status_t conf_member_add(conference_obj_t *conference, conf_member_t *mem if (call_list) { char saymsg[1024]; switch_snprintf(saymsg, sizeof(saymsg), "Auto Calling %d parties", call_list->iteration); - conf_member_say(member, saymsg, 0); + conference_member_say(member, saymsg, 0); } else { - if (!switch_channel_test_app_flag_key("conf_silent", channel, CONF_SILENT_REQ)) { + if (!switch_channel_test_app_flag_key("conference_silent", channel, CONF_SILENT_REQ)) { /* announce the total number of members in the conference */ if (conference->count >= conference->announce_count && conference->announce_count > 1) { switch_snprintf(msg, sizeof(msg), "There are %d callers", conference->count); - conf_member_say(member, msg, CONF_DEFAULT_LEADIN); - } else if (conference->count == 1 && !conference->perpetual_sound && !conf_utils_test_flag(conference, CFLAG_WAIT_MOD)) { + conference_member_say(member, msg, CONF_DEFAULT_LEADIN); + } 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 */ - if (!conf_utils_test_flag(conference, CFLAG_BRIDGE_TO)) { - if (conference->alone_sound && !conf_utils_member_test_flag(member, MFLAG_GHOST)) { + if (!conference_utils_test_flag(conference, CFLAG_BRIDGE_TO)) { + if (conference->alone_sound && !conference_utils_member_test_flag(member, MFLAG_GHOST)) { 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."); - conf_member_say(member, msg, CONF_DEFAULT_LEADIN); + conference_member_say(member, msg, CONF_DEFAULT_LEADIN); } } } @@ -794,35 +794,35 @@ switch_status_t conf_member_add(conference_obj_t *conference, conf_member_t *mem } if (conference->min && conference->count >= conference->min) { - conf_utils_set_flag(conference, CFLAG_ENFORCE_MIN); + conference_utils_set_flag(conference, CFLAG_ENFORCE_MIN); } - if (!switch_channel_test_app_flag_key("conf_silent", channel, CONF_SILENT_REQ) && + if (!switch_channel_test_app_flag_key("conference_silent", channel, CONF_SILENT_REQ) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); + conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "add-member"); switch_event_fire(&event); } - switch_channel_clear_app_flag_key("conf_silent", channel, CONF_SILENT_REQ); - switch_channel_set_app_flag_key("conf_silent", channel, CONF_SILENT_DONE); + switch_channel_clear_app_flag_key("conference_silent", channel, CONF_SILENT_REQ); + switch_channel_set_app_flag_key("conference_silent", channel, CONF_SILENT_DONE); if ((position = switch_channel_get_variable(channel, "conference_position"))) { if (conference->channels == 2) { - if (conf_utils_member_test_flag(member, MFLAG_NO_POSITIONAL)) { + if (conference_utils_member_test_flag(member, MFLAG_NO_POSITIONAL)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "%s has positional audio blocked.\n", switch_channel_get_name(channel)); } else { - if (conf_member_parse_position(member, position) != SWITCH_STATUS_SUCCESS) { + if (conference_member_parse_position(member, position) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "%s invalid position data\n", switch_channel_get_name(channel)); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s position data set\n", switch_channel_get_name(channel)); } - conf_utils_member_set_flag(member, MFLAG_POSITIONAL); - member->al = conf_al_create(member->pool); + conference_utils_member_set_flag(member, MFLAG_POSITIONAL); + member->al = conference_al_create(member->pool); } } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "%s cannot set position data on mono conference.\n", switch_channel_get_name(channel)); @@ -834,7 +834,7 @@ switch_status_t conf_member_add(conference_obj_t *conference, conf_member_t *mem controls = switch_channel_get_variable(channel, "conference_controls"); if (zstr(controls)) { - if (!conf_utils_member_test_flag(member, MFLAG_MOD) || !conference->moderator_controls) { + if (!conference_utils_member_test_flag(member, MFLAG_MOD) || !conference->moderator_controls) { controls = conference->caller_controls; } else { controls = conference->moderator_controls; @@ -848,7 +848,7 @@ switch_status_t conf_member_add(conference_obj_t *conference, conf_member_t *mem if (strcasecmp(controls, "none")) { switch_ivr_dmachine_create(&member->dmachine, "mod_conference", NULL, conference->ivr_dtmf_timeout, conference->ivr_input_timeout, NULL, NULL, NULL); - conf_member_bind_controls(member, controls); + conference_member_bind_controls(member, controls); } } @@ -858,7 +858,7 @@ switch_status_t conf_member_add(conference_obj_t *conference, conf_member_t *mem switch_mutex_unlock(member->audio_in_mutex); if (conference->la && member->channel && !switch_channel_test_flag(member->channel, CF_VIDEO_ONLY)) { - if (!conf_utils_member_test_flag(member, MFLAG_SECOND_SCREEN)) { + if (!conference_utils_member_test_flag(member, MFLAG_SECOND_SCREEN)) { member->json = cJSON_CreateArray(); cJSON_AddItemToArray(member->json, cJSON_CreateStringPrintf("%0.4d", member->id)); cJSON_AddItemToArray(member->json, cJSON_CreateString(switch_channel_get_variable(member->channel, "caller_id_number"))); @@ -877,35 +877,35 @@ switch_status_t conf_member_add(conference_obj_t *conference, conf_member_t *mem cJSON_AddItemToArray(member->json, cJSON_CreateNull()); - conf_member_update_status_field(member); + conference_member_update_status_field(member); //switch_live_array_add_alias(conference->la, switch_core_session_get_uuid(member->session), "conference"); } - conf_event_adv_la(conference, member, SWITCH_TRUE); + conference_event_adv_la(conference, member, SWITCH_TRUE); - if (!conf_utils_member_test_flag(member, MFLAG_SECOND_SCREEN)) { + if (!conference_utils_member_test_flag(member, MFLAG_SECOND_SCREEN)) { switch_live_array_add(conference->la, switch_core_session_get_uuid(member->session), -1, &member->json, SWITCH_FALSE); } } - if (conf_utils_test_flag(conference, CFLAG_POSITIONAL)) { - conf_al_gen_arc(conference, NULL); + if (conference_utils_test_flag(conference, CFLAG_POSITIONAL)) { + conference_al_gen_arc(conference, NULL); } - conf_event_send_rfc(conference); - conf_event_send_json(conference); + conference_event_send_rfc(conference); + conference_event_send_json(conference); switch_mutex_unlock(conference->mutex); status = SWITCH_STATUS_SUCCESS; - conf_video_find_floor(member, SWITCH_TRUE); + conference_video_find_floor(member, SWITCH_TRUE); - if (conf_utils_member_test_flag(member, MFLAG_JOIN_VID_FLOOR)) { - conf_video_set_floor_holder(conference, member, SWITCH_TRUE); - conf_utils_set_flag(member->conference, CFLAG_VID_FLOOR_LOCK); + if (conference_utils_member_test_flag(member, MFLAG_JOIN_VID_FLOOR)) { + conference_video_set_floor_holder(conference, member, SWITCH_TRUE); + conference_utils_set_flag(member->conference, CFLAG_VID_FLOOR_LOCK); if (test_eflag(conference, EFLAG_FLOOR_CHANGE)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "conference %s OK video floor %d %s\n", @@ -916,10 +916,10 @@ switch_status_t conf_member_add(conference_obj_t *conference, conf_member_t *mem return status; } -void conf_member_set_floor_holder(conference_obj_t *conference, conf_member_t *member) +void conference_member_set_floor_holder(conference_obj_t *conference, conference_member_t *member) { switch_event_t *event; - conf_member_t *old_member = NULL; + conference_member_t *old_member = NULL; int old_id = 0; if (conference->floor_holder) { @@ -939,7 +939,7 @@ void conf_member_set_floor_holder(conference_obj_t *conference, conf_member_t *m switch_channel_get_name(member->channel)); conference->floor_holder = member; - conf_member_update_status_field(member); + conference_member_update_status_field(member); } else { conference->floor_holder = NULL; } @@ -947,16 +947,16 @@ void conf_member_set_floor_holder(conference_obj_t *conference, conf_member_t *m if (old_member) { old_id = old_member->id; - conf_member_update_status_field(old_member); + conference_member_update_status_field(old_member); old_member->floor_packets = 0; } - conf_utils_set_flag(conference, CFLAG_FLOOR_CHANGE); + conference_utils_set_flag(conference, CFLAG_FLOOR_CHANGE); switch_mutex_unlock(conference->mutex); if (test_eflag(conference, EFLAG_FLOOR_CHANGE)) { switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT); - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "floor-change"); if (old_id) { switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Old-ID", "%d", old_id); @@ -965,7 +965,7 @@ void conf_member_set_floor_holder(conference_obj_t *conference, conf_member_t *m } if (conference->floor_holder) { - conf_member_add_event_data(conference->floor_holder, event); + conference_member_add_event_data(conference->floor_holder, event); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-ID", "%d", conference->floor_holder->id); } else { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "New-ID", "none"); @@ -977,10 +977,10 @@ void conf_member_set_floor_holder(conference_obj_t *conference, conf_member_t *m } /* Gain exclusive access and remove the member from the list */ -switch_status_t conf_member_del(conference_obj_t *conference, conf_member_t *member) +switch_status_t conference_member_del(conference_obj_t *conference, conference_member_t *member) { switch_status_t status = SWITCH_STATUS_FALSE; - conf_member_t *imember, *last = NULL; + conference_member_t *imember, *last = NULL; switch_event_t *event; conference_file_node_t *member_fnode; switch_speech_handle_t *member_sh; @@ -999,18 +999,18 @@ switch_status_t conf_member_del(conference_obj_t *conference, conf_member_t *mem lock_member(member); - conf_member_del_relationship(member, 0); + conference_member_del_relationship(member, 0); - conf_cdr_del(member); + conference_cdr_del(member); #ifdef OPENAL_POSITIONING if (member->al && member->al->device) { - conf_al_close(member->al); + conference_al_close(member->al); } #endif if (member->canvas) { - conf_video_destroy_canvas(&member->canvas); + conference_video_destroy_canvas(&member->canvas); } member_fnode = member->fnode; @@ -1032,7 +1032,7 @@ switch_status_t conf_member_del(conference_obj_t *conference, conf_member_t *mem switch_mutex_lock(member->audio_in_mutex); switch_mutex_lock(member->audio_out_mutex); lock_member(member); - conf_utils_member_clear_flag(member, MFLAG_INTREE); + conference_utils_member_clear_flag(member, MFLAG_INTREE); if (member->rec) { conference->recording_members--; @@ -1077,11 +1077,11 @@ switch_status_t conf_member_del(conference_obj_t *conference, conf_member_t *mem } if (member == member->conference->floor_holder) { - conf_member_set_floor_holder(member->conference, NULL); + conference_member_set_floor_holder(member->conference, NULL); } if (member->id == member->conference->video_floor_holder) { - conf_utils_clear_flag(member->conference, CFLAG_VID_FLOOR_LOCK); + conference_utils_clear_flag(member->conference, CFLAG_VID_FLOOR_LOCK); if (member->conference->last_video_floor_holder) { member->conference->video_floor_holder = member->conference->last_video_floor_holder; member->conference->last_video_floor_holder = 0; @@ -1089,36 +1089,36 @@ switch_status_t conf_member_del(conference_obj_t *conference, conf_member_t *mem member->conference->video_floor_holder = 0; } - if (!conf_utils_member_test_flag(member, MFLAG_NOCHANNEL)) { + if (!conference_utils_member_test_flag(member, MFLAG_NOCHANNEL)) { switch_channel_t *channel = switch_core_session_get_channel(member->session); - if (conf_utils_member_test_flag(member, MFLAG_GHOST)) { + if (conference_utils_member_test_flag(member, MFLAG_GHOST)) { conference->count_ghosts--; } else { conference->count--; } - if (conf_utils_member_test_flag(member, MFLAG_ENDCONF)) { + if (conference_utils_member_test_flag(member, MFLAG_ENDCONF)) { if (!--conference->end_count) { - //conf_utils_set_flag_locked(conference, CFLAG_DESTRUCT); - conference->endconf_time = switch_epoch_time_now(NULL); + //conference_utils_set_flag_locked(conference, CFLAG_DESTRUCT); + conference->endconference_time = switch_epoch_time_now(NULL); } } - conf_send_presence(conference); + conference_send_presence(conference); switch_channel_set_variable(channel, "conference_call_key", NULL); - if ((conference->min && conf_utils_test_flag(conference, CFLAG_ENFORCE_MIN) && (conference->count + conference->count_ghosts) < conference->min) - || (conf_utils_test_flag(conference, CFLAG_DYNAMIC) && (conference->count + conference->count_ghosts == 0))) { - conf_utils_set_flag(conference, CFLAG_DESTRUCT); + if ((conference->min && conference_utils_test_flag(conference, CFLAG_ENFORCE_MIN) && (conference->count + conference->count_ghosts) < conference->min) + || (conference_utils_test_flag(conference, CFLAG_DYNAMIC) && (conference->count + conference->count_ghosts == 0))) { + conference_utils_set_flag(conference, CFLAG_DESTRUCT); } else { - if (!switch_true(switch_channel_get_variable(channel, "conference_permanent_wait_mod_moh")) && conf_utils_test_flag(conference, CFLAG_WAIT_MOD)) { + if (!switch_true(switch_channel_get_variable(channel, "conference_permanent_wait_mod_moh")) && conference_utils_test_flag(conference, CFLAG_WAIT_MOD)) { /* Stop MOH if any */ conference_file_stop(conference, FILE_STOP_ASYNC); } - if (!exit_sound && conference->exit_sound && conf_utils_test_flag(conference, CFLAG_EXIT_SOUND) && !conf_utils_member_test_flag(member, MFLAG_SILENT)) { + if (!exit_sound && conference->exit_sound && conference_utils_test_flag(conference, CFLAG_EXIT_SOUND) && !conference_utils_member_test_flag(member, MFLAG_SILENT)) { conference_file_play(conference, conference->exit_sound, 0, channel, 0); } - if (conference->count == 1 && conference->alone_sound && !conf_utils_test_flag(conference, CFLAG_WAIT_MOD) && !conf_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); conference_file_play(conference, conference->alone_sound, 0, channel, 0); } @@ -1126,15 +1126,15 @@ switch_status_t conf_member_del(conference_obj_t *conference, conf_member_t *mem if (test_eflag(conference, EFLAG_DEL_MEMBER) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_member_add_event_data(member, event); - conf_event_add_data(conference, event); + conference_member_add_event_data(member, event); + conference_event_add_data(conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "del-member"); switch_event_fire(&event); } } - conf_video_find_floor(member, SWITCH_FALSE); - conf_video_detach_video_layer(member); + conference_video_find_floor(member, SWITCH_FALSE); + conference_video_detach_video_layer(member); member->conference = NULL; @@ -1147,14 +1147,14 @@ switch_status_t conf_member_del(conference_obj_t *conference, conf_member_t *mem if (conference->la && member->session && !switch_channel_test_flag(member->channel, CF_VIDEO_ONLY)) { switch_live_array_del(conference->la, switch_core_session_get_uuid(member->session)); //switch_live_array_clear_alias(conference->la, switch_core_session_get_uuid(member->session), "conference"); - conf_event_adv_la(conference, member, SWITCH_FALSE); + conference_event_adv_la(conference, member, SWITCH_FALSE); } - conf_event_send_rfc(conference); - conf_event_send_json(conference); + conference_event_send_rfc(conference); + conference_event_send_json(conference); - if (conf_utils_test_flag(conference, CFLAG_POSITIONAL)) { - conf_al_gen_arc(conference, NULL); + if (conference_utils_test_flag(conference, CFLAG_POSITIONAL)) { + conference_al_gen_arc(conference, NULL); } if (member->session) { @@ -1167,9 +1167,9 @@ switch_status_t conf_member_del(conference_obj_t *conference, conf_member_t *mem return status; } -void conf_member_send_all_dtmf(conf_member_t *member, conference_obj_t *conference, const char *dtmf) +void conference_member_send_all_dtmf(conference_member_t *member, conference_obj_t *conference, const char *dtmf) { - conf_member_t *imember; + conference_member_t *imember; switch_mutex_lock(conference->mutex); switch_mutex_lock(conference->member_mutex); @@ -1198,7 +1198,7 @@ void conf_member_send_all_dtmf(conf_member_t *member, conference_obj_t *conferen /* Play a file in the conference room to a member */ -switch_status_t conf_member_play_file(conf_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 status = SWITCH_STATUS_FALSE; char *dfile = NULL, *expanded = NULL; @@ -1207,7 +1207,7 @@ switch_status_t conf_member_play_file(conf_member_t *member, char *file, uint32_ int channels = member->conference->channels; int bad_params = 0; - if (member == NULL || file == NULL || conf_utils_member_test_flag(member, MFLAG_KICKED)) + if (member == NULL || file == NULL || conference_utils_member_test_flag(member, MFLAG_KICKED)) return status; if ((expanded = switch_channel_expand_variables(switch_core_session_get_channel(member->session), file)) != file) { @@ -1217,7 +1217,7 @@ switch_status_t conf_member_play_file(conf_member_t *member, char *file, uint32_ } if (!strncasecmp(file, "say:", 4)) { if (!zstr(file + 4)) { - status = conf_member_say(member, file + 4, leadin); + status = conference_member_say(member, file + 4, leadin); } goto done; } @@ -1228,7 +1228,7 @@ switch_status_t conf_member_play_file(conf_member_t *member, char *file, uint32_ } file = dfile; } else if (!zstr(file)) { - status = conf_member_say(member, file, leadin); + status = conference_member_say(member, file, leadin); goto done; } } @@ -1276,8 +1276,8 @@ switch_status_t conf_member_play_file(conf_member_t *member, char *file, uint32_ const char *position = switch_event_get_header(fnode->fh.params, "position"); if (!bad_params && !zstr(position) && member->conference->channels == 2) { - fnode->al = conf_al_create(pool); - if (conf_al_parse_position(fnode->al, position) != SWITCH_STATUS_SUCCESS) { + fnode->al = conference_al_create(pool); + if (conference_al_parse_position(fnode->al, position) != SWITCH_STATUS_SUCCESS) { switch_core_file_close(&fnode->fh); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member->session), SWITCH_LOG_ERROR, "Invalid Position Data.\n"); fnode->al = NULL; @@ -1309,7 +1309,7 @@ switch_status_t conf_member_play_file(conf_member_t *member, char *file, uint32_ } /* Say some thing with TTS in the conference room */ -switch_status_t conf_member_say(conf_member_t *member, char *text, uint32_t leadin) +switch_status_t conference_member_say(conference_member_t *member, char *text, uint32_t leadin) { conference_obj_t *conference = member->conference; conference_file_node_t *fnode, *nptr; @@ -1370,8 +1370,8 @@ switch_status_t conf_member_say(conf_member_t *member, char *text, uint32_t lead position = NULL; } else { channels = 1; - fnode->al = conf_al_create(pool); - if (conf_al_parse_position(fnode->al, position) != SWITCH_STATUS_SUCCESS) { + fnode->al = conference_al_create(pool); + if (conference_al_parse_position(fnode->al, position) != SWITCH_STATUS_SUCCESS) { fnode->al = NULL; channels = conference->channels; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Position Data.\n"); @@ -1441,9 +1441,9 @@ switch_status_t conf_member_say(conf_member_t *member, char *text, uint32_t lead /* execute a callback for every member of the conference */ -void conf_member_itterator(conference_obj_t *conference, switch_stream_handle_t *stream, uint8_t non_mod, conf_api_member_cmd_t pfncallback, void *data) +void conference_member_itterator(conference_obj_t *conference, switch_stream_handle_t *stream, uint8_t non_mod, conference_api_member_cmd_t pfncallback, void *data) { - conf_member_t *member = NULL; + conference_member_t *member = NULL; switch_assert(conference != NULL); switch_assert(stream != NULL); @@ -1451,8 +1451,8 @@ void conf_member_itterator(conference_obj_t *conference, switch_stream_handle_t switch_mutex_lock(conference->member_mutex); for (member = conference->members; member; member = member->next) { - if (!(non_mod && conf_utils_member_test_flag(member, MFLAG_MOD))) { - if (member->session && !conf_utils_member_test_flag(member, MFLAG_NOCHANNEL)) { + if (!(non_mod && conference_utils_member_test_flag(member, MFLAG_MOD))) { + if (member->session && !conference_utils_member_test_flag(member, MFLAG_NOCHANNEL)) { pfncallback(member, stream, data); } } else { @@ -1463,7 +1463,7 @@ void conf_member_itterator(conference_obj_t *conference, switch_stream_handle_t } -int conf_member_get_canvas_id(conf_member_t *member, const char *val, switch_bool_t watching) +int conference_member_get_canvas_id(conference_member_t *member, const char *val, switch_bool_t watching) { int index = -1; int cur; @@ -1526,7 +1526,7 @@ int conf_member_get_canvas_id(conf_member_t *member, const char *val, switch_boo } -int conf_member_setup_media(conf_member_t *member, conference_obj_t *conference) +int conference_member_setup_media(conference_member_t *member, conference_obj_t *conference) { switch_codec_implementation_t read_impl = { 0 }; diff --git a/src/mod/applications/mod_conference/mod_conference_record.c b/src/mod/applications/mod_conference/conference_record.c similarity index 82% rename from src/mod/applications/mod_conference/mod_conference_record.c rename to src/mod/applications/mod_conference/conference_record.c index 862dd7afaf..f6e539eb80 100644 --- a/src/mod/applications/mod_conference/mod_conference_record.c +++ b/src/mod/applications/mod_conference/conference_record.c @@ -41,12 +41,12 @@ */ #include -void conf_record_launch_thread(conference_obj_t *conference, char *path, switch_bool_t autorec) +void conference_record_launch_thread(conference_obj_t *conference, char *path, switch_bool_t autorec) { switch_thread_t *thread; switch_threadattr_t *thd_attr = NULL; switch_memory_pool_t *pool; - conf_record_t *rec; + conference_record_t *rec; /* Setup a memory pool to use. */ if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) { @@ -73,28 +73,28 @@ void conf_record_launch_thread(conference_obj_t *conference, char *path, switch_ switch_threadattr_create(&thd_attr, rec->pool); switch_threadattr_detach_set(thd_attr, 1); switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&thread, thd_attr, conf_record_thread_run, rec, rec->pool); + switch_thread_create(&thread, thd_attr, conference_record_thread_run, rec, rec->pool); } /* stop the specified recording */ -switch_status_t conf_record_stop(conference_obj_t *conference, switch_stream_handle_t *stream, char *path) +switch_status_t conference_record_stop(conference_obj_t *conference, switch_stream_handle_t *stream, char *path) { - conf_member_t *member = NULL; + conference_member_t *member = NULL; int count = 0; switch_assert(conference != NULL); switch_mutex_lock(conference->member_mutex); for (member = conference->members; member; member = member->next) { - if (conf_utils_member_test_flag(member, MFLAG_NOCHANNEL) && (!path || !strcmp(path, member->rec_path))) { - if (!conf_utils_test_flag(conference, CFLAG_CONF_RESTART_AUTO_RECORD) && member->rec && member->rec->autorec) { + if (conference_utils_member_test_flag(member, MFLAG_NOCHANNEL) && (!path || !strcmp(path, member->rec_path))) { + if (!conference_utils_test_flag(conference, CFLAG_CONF_RESTART_AUTO_RECORD) && member->rec && member->rec->autorec) { stream->write_function(stream, "Stopped AUTO recording file %s (Auto Recording Now Disabled)\n", member->rec_path); conference->auto_record = 0; } else { stream->write_function(stream, "Stopped recording file %s\n", member->rec_path); } - conf_utils_member_clear_flag_locked(member, MFLAG_RUNNING); + conference_utils_member_clear_flag_locked(member, MFLAG_RUNNING); count++; } @@ -106,9 +106,9 @@ switch_status_t conf_record_stop(conference_obj_t *conference, switch_stream_han return count; } /* stop/pause/resume the specified recording */ -switch_status_t conf_record_action(conference_obj_t *conference, char *path, recording_action_type_t action) +switch_status_t conference_record_action(conference_obj_t *conference, char *path, recording_action_type_t action) { - conf_member_t *member = NULL; + conference_member_t *member = NULL; int count = 0; //switch_file_handle_t *fh = NULL; @@ -116,21 +116,21 @@ switch_status_t conf_record_action(conference_obj_t *conference, char *path, rec switch_mutex_lock(conference->member_mutex); for (member = conference->members; member; member = member->next) { - if (conf_utils_member_test_flag(member, MFLAG_NOCHANNEL) && (!path || !strcmp(path, member->rec_path))) + if (conference_utils_member_test_flag(member, MFLAG_NOCHANNEL) && (!path || !strcmp(path, member->rec_path))) { //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Action: %d\n", action); switch (action) { case REC_ACTION_STOP: - conf_utils_member_clear_flag_locked(member, MFLAG_RUNNING); + conference_utils_member_clear_flag_locked(member, MFLAG_RUNNING); count++; break; case REC_ACTION_PAUSE: - conf_utils_member_set_flag_locked(member, MFLAG_PAUSE_RECORDING); + conference_utils_member_set_flag_locked(member, MFLAG_PAUSE_RECORDING); count = 1; break; case REC_ACTION_RESUME: - conf_utils_member_clear_flag_locked(member, MFLAG_PAUSE_RECORDING); + conference_utils_member_clear_flag_locked(member, MFLAG_PAUSE_RECORDING); count = 1; break; } @@ -142,11 +142,11 @@ switch_status_t conf_record_action(conference_obj_t *conference, char *path, rec /* Sub-Routine called by a record entity inside a conference */ -void *SWITCH_THREAD_FUNC conf_record_thread_run(switch_thread_t *thread, void *obj) +void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, void *obj) { int16_t *data_buf; - conf_member_t smember = { 0 }, *member; - conf_record_t *rp, *last = NULL, *rec = (conf_record_t *) obj; + conference_member_t smember = { 0 }, *member; + conference_record_t *rp, *last = NULL, *rec = (conference_record_t *) obj; conference_obj_t *conference = rec->conference; uint32_t samples = switch_samples_per_packet(conference->rate, conference->interval); uint32_t mux_used; @@ -170,9 +170,9 @@ void *SWITCH_THREAD_FUNC conf_record_thread_run(switch_thread_t *thread, void *o data_buf_len = samples * sizeof(int16_t) * conference->channels; switch_zmalloc(data_buf, data_buf_len); - switch_mutex_lock(conf_globals.hash_mutex); - conf_globals.threads++; - switch_mutex_unlock(conf_globals.hash_mutex); + switch_mutex_lock(conference_globals.hash_mutex); + conference_globals.threads++; + switch_mutex_unlock(conference_globals.hash_mutex); member = &smember; @@ -221,7 +221,7 @@ void *SWITCH_THREAD_FUNC conf_record_thread_run(switch_thread_t *thread, void *o flags = SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT; - if (conference->members_with_video && conf_utils_test_flag(conference, CFLAG_TRANSCODE_VIDEO)) { + if (conference->members_with_video && conference_utils_test_flag(conference, CFLAG_TRANSCODE_VIDEO)) { flags |= SWITCH_FILE_FLAG_VIDEO; if (conference->canvas) { char *orig_path = rec->path; @@ -240,7 +240,7 @@ void *SWITCH_THREAD_FUNC conf_record_thread_run(switch_thread_t *thread, void *o if (test_eflag(conference, EFLAG_RECORD) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "start-recording"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Path", rec->path); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Error", "File could not be opened for recording"); @@ -252,8 +252,8 @@ void *SWITCH_THREAD_FUNC conf_record_thread_run(switch_thread_t *thread, void *o switch_mutex_lock(conference->mutex); if (conference->video_floor_holder) { - conf_member_t *member; - if ((member = conf_member_get(conference, conference->video_floor_holder))) { + conference_member_t *member; + if ((member = conference_member_get(conference, conference->video_floor_holder))) { if (member->session) { switch_core_session_video_reinit(member->session); } @@ -278,37 +278,37 @@ void *SWITCH_THREAD_FUNC conf_record_thread_run(switch_thread_t *thread, void *o if (test_eflag(conference, EFLAG_RECORD) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "start-recording"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Path", rec->path); switch_event_fire(&event); } - if (conf_member_add(conference, member) != SWITCH_STATUS_SUCCESS) { + if (conference_member_add(conference, member) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Joining Conference\n"); goto end; } - while (conf_utils_member_test_flag(member, MFLAG_RUNNING) && conf_utils_test_flag(conference, CFLAG_RUNNING) && (conference->count + conference->count_ghosts)) { + while (conference_utils_member_test_flag(member, MFLAG_RUNNING) && conference_utils_test_flag(conference, CFLAG_RUNNING) && (conference->count + conference->count_ghosts)) { len = 0; mux_used = (uint32_t) switch_buffer_inuse(member->mux_buffer); - if (conf_utils_member_test_flag(member, MFLAG_FLUSH_BUFFER)) { + if (conference_utils_member_test_flag(member, MFLAG_FLUSH_BUFFER)) { if (mux_used) { switch_mutex_lock(member->audio_out_mutex); switch_buffer_zero(member->mux_buffer); switch_mutex_unlock(member->audio_out_mutex); mux_used = 0; } - conf_utils_member_clear_flag_locked(member, MFLAG_FLUSH_BUFFER); + conference_utils_member_clear_flag_locked(member, MFLAG_FLUSH_BUFFER); } again: if (switch_test_flag((&member->rec->fh), SWITCH_FILE_PAUSE)) { - conf_utils_member_set_flag_locked(member, MFLAG_FLUSH_BUFFER); + conference_utils_member_set_flag_locked(member, MFLAG_FLUSH_BUFFER); goto loop; } @@ -334,10 +334,10 @@ void *SWITCH_THREAD_FUNC conf_record_thread_run(switch_thread_t *thread, void *o len = (switch_size_t) samples; } - if (!conf_utils_member_test_flag(member, MFLAG_PAUSE_RECORDING)) { + if (!conference_utils_member_test_flag(member, MFLAG_PAUSE_RECORDING)) { if (!len || switch_core_file_write(&member->rec->fh, data_buf, &len) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Write Failed\n"); - conf_utils_member_clear_flag_locked(member, MFLAG_RUNNING); + conference_utils_member_clear_flag_locked(member, MFLAG_RUNNING); } } @@ -363,7 +363,7 @@ void *SWITCH_THREAD_FUNC conf_record_thread_run(switch_thread_t *thread, void *o switch_safe_free(data_buf); switch_core_timer_destroy(&timer); - conf_member_del(conference, member); + conference_member_del(conference, member); if (conference->canvas) { conference->canvas->send_keyframe = 1; @@ -371,7 +371,7 @@ void *SWITCH_THREAD_FUNC conf_record_thread_run(switch_thread_t *thread, void *o switch_buffer_destroy(&member->audio_buffer); switch_buffer_destroy(&member->mux_buffer); - conf_utils_member_clear_flag_locked(member, MFLAG_RUNNING); + conference_utils_member_clear_flag_locked(member, MFLAG_RUNNING); if (switch_test_flag((&member->rec->fh), SWITCH_FILE_OPEN)) { switch_mutex_lock(conference->mutex); switch_mutex_unlock(conference->mutex); @@ -379,7 +379,7 @@ void *SWITCH_THREAD_FUNC conf_record_thread_run(switch_thread_t *thread, void *o } switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Recording of %s Stopped\n", rec->path); if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "stop-recording"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Path", rec->path); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Samples-Out", "%ld", (long) member->rec->fh.samples_out); @@ -411,9 +411,9 @@ void *SWITCH_THREAD_FUNC conf_record_thread_run(switch_thread_t *thread, void *o switch_core_destroy_memory_pool(&pool); } - switch_mutex_lock(conf_globals.hash_mutex); - conf_globals.threads--; - switch_mutex_unlock(conf_globals.hash_mutex); + switch_mutex_lock(conference_globals.hash_mutex); + conference_globals.threads--; + switch_mutex_unlock(conference_globals.hash_mutex); switch_thread_rwlock_unlock(conference->rwlock); return NULL; diff --git a/src/mod/applications/mod_conference/mod_conference_utils.c b/src/mod/applications/mod_conference/conference_utils.c similarity index 85% rename from src/mod/applications/mod_conference/mod_conference_utils.c rename to src/mod/applications/mod_conference/conference_utils.c index 108e709421..98f5d8a8f1 100644 --- a/src/mod/applications/mod_conference/mod_conference_utils.c +++ b/src/mod/applications/mod_conference/conference_utils.c @@ -41,7 +41,7 @@ */ #include -const char *conf_utils_combine_flag_var(switch_core_session_t *session, const char *var_name) +const char *conference_utils_combine_flag_var(switch_core_session_t *session, const char *var_name) { switch_event_header_t *hp; switch_event_t *event, *cevent; @@ -85,7 +85,7 @@ const char *conf_utils_combine_flag_var(switch_core_session_t *session, const ch } -void conf_utils_set_mflags(const char *flags, member_flag_t *f) +void conference_utils_set_mflags(const char *flags, member_flag_t *f) { if (flags) { char *dup = strdup(flags); @@ -150,7 +150,7 @@ void conf_utils_set_mflags(const char *flags, member_flag_t *f) -void conf_utils_set_cflags(const char *flags, conference_flag_t *f) +void conference_utils_set_cflags(const char *flags, conference_flag_t *f) { if (flags) { char *dup = strdup(flags); @@ -203,7 +203,7 @@ void conf_utils_set_cflags(const char *flags, conference_flag_t *f) } -void conf_utils_clear_eflags(char *events, uint32_t *f) +void conference_utils_clear_eflags(char *events, uint32_t *f) { char buf[512] = ""; char *next = NULL; @@ -280,7 +280,7 @@ void conf_utils_clear_eflags(char *events, uint32_t *f) } -void conf_utils_merge_mflags(member_flag_t *a, member_flag_t *b) +void conference_utils_merge_mflags(member_flag_t *a, member_flag_t *b) { int x; @@ -289,71 +289,71 @@ void conf_utils_merge_mflags(member_flag_t *a, member_flag_t *b) } } -void conf_utils_set_flag(conference_obj_t *conference, conference_flag_t flag) +void conference_utils_set_flag(conference_obj_t *conference, conference_flag_t flag) { conference->flags[flag] = 1; } -void conf_utils_set_flag_locked(conference_obj_t *conference, conference_flag_t flag) +void conference_utils_set_flag_locked(conference_obj_t *conference, conference_flag_t flag) { switch_mutex_lock(conference->flag_mutex); conference->flags[flag] = 1; switch_mutex_unlock(conference->flag_mutex); } -void conf_utils_clear_flag(conference_obj_t *conference, conference_flag_t flag) +void conference_utils_clear_flag(conference_obj_t *conference, conference_flag_t flag) { conference->flags[flag] = 0; } -void conf_utils_clear_flag_locked(conference_obj_t *conference, conference_flag_t flag) +void conference_utils_clear_flag_locked(conference_obj_t *conference, conference_flag_t flag) { switch_mutex_lock(conference->flag_mutex); conference->flags[flag] = 0; switch_mutex_unlock(conference->flag_mutex); } -switch_bool_t conf_utils_test_flag(conference_obj_t *conference, conference_flag_t flag) +switch_bool_t conference_utils_test_flag(conference_obj_t *conference, conference_flag_t flag) { return !!conference->flags[flag]; } #if 0 -void conf_utils_conf_utils_set_mflag(conference_obj_t *conference, member_flag_t mflag) +void conference_utils_conference_utils_set_mflag(conference_obj_t *conference, member_flag_t mflag) { conference->mflags[mflag] = 1; } -void conf_utils_clear_mflag(conference_obj_t *conference, member_flag_t mflag) +void conference_utils_clear_mflag(conference_obj_t *conference, member_flag_t mflag) { conference->mflags[mflag] = 0; } -switch_bool_t conf_utils_test_mflag(conference_obj_t *conference, member_flag_t mflag) +switch_bool_t conference_utils_test_mflag(conference_obj_t *conference, member_flag_t mflag) { return !!conference->mflags[mflag]; } #endif -void conf_utils_member_set_flag(conf_member_t *member, member_flag_t flag) +void conference_utils_member_set_flag(conference_member_t *member, member_flag_t flag) { member->flags[flag] = 1; } -void conf_utils_member_set_flag_locked(conf_member_t *member, member_flag_t flag) +void conference_utils_member_set_flag_locked(conference_member_t *member, member_flag_t flag) { switch_mutex_lock(member->flag_mutex); member->flags[flag] = 1; switch_mutex_unlock(member->flag_mutex); } -void conf_utils_member_clear_flag(conf_member_t *member, member_flag_t flag) +void conference_utils_member_clear_flag(conference_member_t *member, member_flag_t flag) { member->flags[flag] = 0; } -void conf_utils_member_clear_flag_locked(conf_member_t *member, member_flag_t flag) +void conference_utils_member_clear_flag_locked(conference_member_t *member, member_flag_t flag) { switch_mutex_lock(member->flag_mutex); member->flags[flag] = 0; switch_mutex_unlock(member->flag_mutex); } -switch_bool_t conf_utils_member_test_flag(conf_member_t *member, member_flag_t flag) +switch_bool_t conference_utils_member_test_flag(conference_member_t *member, member_flag_t flag) { return !!member->flags[flag]; } diff --git a/src/mod/applications/mod_conference/mod_conference_video.c b/src/mod/applications/mod_conference/conference_video.c similarity index 82% rename from src/mod/applications/mod_conference/mod_conference_video.c rename to src/mod/applications/mod_conference/conference_video.c index 244d6c354c..362dd1f73f 100644 --- a/src/mod/applications/mod_conference/mod_conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -41,7 +41,7 @@ */ #include -static struct conf_fps FPS_VALS[] = { +static struct conference_fps FPS_VALS[] = { {1.0f, 1000, 90}, {5.0f, 200, 450}, {10.0f, 100, 900}, @@ -57,7 +57,7 @@ static struct conf_fps FPS_VALS[] = { }; -int conf_video_set_fps(conference_obj_t *conference, float fps) +int conference_video_set_fps(conference_obj_t *conference, float fps) { int i = 0, j = 0; @@ -80,13 +80,13 @@ int conf_video_set_fps(conference_obj_t *conference, float fps) } -void conf_video_parse_layouts(conference_obj_t *conference, int WIDTH, int HEIGHT) +void conference_video_parse_layouts(conference_obj_t *conference, int WIDTH, int HEIGHT) { switch_event_t *params; switch_xml_t cxml = NULL, cfg = NULL, x_layouts, x_layout, x_layout_settings, x_group, x_groups, x_image; char cmd_str[256] = ""; - switch_mutex_lock(conf_globals.setup_mutex); + switch_mutex_lock(conference_globals.setup_mutex); if (!conference->layout_hash) { switch_core_hash_init(&conference->layout_hash); } @@ -95,11 +95,11 @@ void conf_video_parse_layouts(conference_obj_t *conference, int WIDTH, int HEIGH if (!conference->layout_group_hash) { switch_core_hash_init(&conference->layout_group_hash); } - switch_mutex_unlock(conf_globals.setup_mutex); + switch_mutex_unlock(conference_globals.setup_mutex); switch_event_create(¶ms, SWITCH_EVENT_COMMAND); switch_assert(params); - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "conf_name", conference->name); + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "conference_name", conference->name); if (!(cxml = switch_xml_open_cfg("conference_layouts.conf", &cfg, params))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", "conference_layouts.conf"); @@ -221,7 +221,7 @@ void conf_video_parse_layouts(conference_obj_t *conference, int WIDTH, int HEIGH } switch_core_hash_insert(conference->layout_hash, name, vlayout); - switch_snprintf(cmd_str, sizeof(cmd_str), "add conference ::conference::conf_list_conferences vid-layout %s", name); + switch_snprintf(cmd_str, sizeof(cmd_str), "add conference ::conference::conference_list_conferences vid-layout %s", name); switch_console_set_complete(cmd_str); } @@ -286,21 +286,21 @@ void conf_video_parse_layouts(conference_obj_t *conference, int WIDTH, int HEIGH } /* do not use this on an img cropped with switch_img_set_rect() */ -void conf_video_reset_image(switch_image_t *img, switch_rgb_color_t *color) +void conference_video_reset_image(switch_image_t *img, switch_rgb_color_t *color) { switch_img_fill(img, 0, 0, img->d_w, img->d_h, color); } -/* clear layer and conf_video_reset_layer called inside lock always */ +/* clear layer and conference_video_reset_layer called inside lock always */ -void conf_video_clear_layer(mcu_layer_t *layer) +void conference_video_clear_layer(mcu_layer_t *layer) { switch_img_fill(layer->canvas->img, layer->x_pos, layer->y_pos, layer->screen_w, layer->screen_h, &layer->canvas->bgcolor); layer->banner_patched = 0; layer->refresh = 1; } -void conf_video_reset_layer(mcu_layer_t *layer) +void conference_video_reset_layer(mcu_layer_t *layer) { layer->tagged = 0; @@ -320,11 +320,11 @@ void conf_video_reset_layer(mcu_layer_t *layer) layer->img = switch_img_alloc(NULL, SWITCH_IMG_FMT_I420, layer->screen_w, layer->screen_h, 1); switch_assert(layer->img); - conf_video_clear_layer(layer); + conference_video_clear_layer(layer); switch_img_free(&layer->cur_img); } -void conf_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg, switch_bool_t freeze) +void conference_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg, switch_bool_t freeze) { switch_image_t *IMG, *img; @@ -372,7 +372,7 @@ void conf_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg, switch if (layer->img && (layer->img->d_w != img_w || layer->img->d_h != img_h)) { switch_img_free(&layer->img); layer->banner_patched = 0; - conf_video_clear_layer(layer); + conference_video_clear_layer(layer); } if (!layer->img) { @@ -394,8 +394,8 @@ void conf_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg, switch if (switch_img_scale(img, &layer->img, img_w, img_h) == SWITCH_STATUS_SUCCESS) { if (layer->bugged && layer->member_id > -1) { - conf_member_t *member; - if ((member = conf_member_get(layer->canvas->conference, layer->member_id))) { + conference_member_t *member; + if ((member = conference_member_get(layer->canvas->conference, layer->member_id))) { switch_frame_t write_frame = { 0 }; write_frame.img = layer->img; switch_core_media_bug_patch_video(member->session, &write_frame); @@ -429,18 +429,18 @@ void conf_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg, switch switch_mutex_unlock(layer->canvas->mutex); } -void conf_video_set_canvas_bgcolor(mcu_canvas_t *canvas, char *color) +void conference_video_set_canvas_bgcolor(mcu_canvas_t *canvas, char *color) { switch_color_set_rgb(&canvas->bgcolor, color); - conf_video_reset_image(canvas->img, &canvas->bgcolor); + conference_video_reset_image(canvas->img, &canvas->bgcolor); } -void conf_video_set_canvas_letterbox_bgcolor(mcu_canvas_t *canvas, char *color) +void conference_video_set_canvas_letterbox_bgcolor(mcu_canvas_t *canvas, char *color) { switch_color_set_rgb(&canvas->letterbox_bgcolor, color); } -void conf_video_check_used_layers(mcu_canvas_t *canvas) +void conference_video_check_used_layers(mcu_canvas_t *canvas) { int i; @@ -454,7 +454,7 @@ void conf_video_check_used_layers(mcu_canvas_t *canvas) } } -void conf_video_detach_video_layer(conf_member_t *member) +void conference_video_detach_video_layer(conference_member_t *member) { mcu_layer_t *layer = NULL; mcu_canvas_t *canvas = NULL; @@ -474,14 +474,14 @@ void conf_video_detach_video_layer(conf_member_t *member) layer = &canvas->layers[member->video_layer_id]; if (layer->geometry.audio_position) { - conf_api_sub_position(member, NULL, "0:0:0"); + conference_api_sub_position(member, NULL, "0:0:0"); } if (layer->txthandle) { switch_img_txt_handle_destroy(&layer->txthandle); } - conf_video_reset_layer(layer); + conference_video_reset_layer(layer); layer->member_id = 0; member->video_layer_id = -1; member->layer_timeout = DEFAULT_LAYER_TIMEOUT; @@ -489,7 +489,7 @@ void conf_video_detach_video_layer(conf_member_t *member) //member->canvas_id = 0; //member->watching_canvas_id = -1; member->avatar_patched = 0; - conf_video_check_used_layers(canvas); + conference_video_check_used_layers(canvas); canvas->send_keyframe = 1; switch_mutex_unlock(canvas->mutex); @@ -500,7 +500,7 @@ void conf_video_detach_video_layer(conf_member_t *member) } -void conf_video_layer_set_logo(conf_member_t *member, mcu_layer_t *layer, const char *path) +void conference_video_layer_set_logo(conference_member_t *member, mcu_layer_t *layer, const char *path) { const char *var = NULL; char *dup = NULL; @@ -585,7 +585,7 @@ void conf_video_layer_set_logo(conf_member_t *member, mcu_layer_t *layer, const } -void conf_video_layer_set_banner(conf_member_t *member, mcu_layer_t *layer, const char *text) +void conference_video_layer_set_banner(conference_member_t *member, mcu_layer_t *layer, const char *text) { switch_rgb_color_t fgcolor, bgcolor; int font_scale = 4; @@ -686,7 +686,7 @@ void conf_video_layer_set_banner(conf_member_t *member, mcu_layer_t *layer, cons switch_img_free(&layer->logo_text_img); layer->banner_img = switch_img_alloc(NULL, SWITCH_IMG_FMT_I420, layer->screen_w, font_size * 2, 1); - conf_video_reset_image(layer->banner_img, &bgcolor); + conference_video_reset_image(layer->banner_img, &bgcolor); switch_img_txt_handle_render(layer->txthandle, layer->banner_img, font_size / 2, font_size / 2, text, NULL, fg, bg, 0, 0); end: @@ -698,7 +698,7 @@ void conf_video_layer_set_banner(conf_member_t *member, mcu_layer_t *layer, cons switch_mutex_unlock(layer->canvas->mutex); } -void conf_video_reset_video_bitrate_counters(conf_member_t *member) +void conference_video_reset_video_bitrate_counters(conference_member_t *member) { member->managed_kps = 0; member->blackouts = 0; @@ -706,7 +706,7 @@ void conf_video_reset_video_bitrate_counters(conf_member_t *member) member->blanks = 0; } -switch_status_t conf_video_attach_video_layer(conf_member_t *member, mcu_canvas_t *canvas, int idx) +switch_status_t conference_video_attach_video_layer(conference_member_t *member, mcu_canvas_t *canvas, int idx) { mcu_layer_t *layer = NULL; switch_channel_t *channel = NULL; @@ -760,10 +760,10 @@ switch_status_t conf_video_attach_video_layer(conf_member_t *member, mcu_canvas_ } if (member->video_layer_id > -1) { - conf_video_detach_video_layer(member); + conference_video_detach_video_layer(member); } - conf_video_reset_layer(layer); + conference_video_reset_layer(layer); switch_img_free(&layer->mute_img); member->avatar_patched = 0; @@ -774,12 +774,12 @@ switch_status_t conf_video_attach_video_layer(conf_member_t *member, mcu_canvas_ var = NULL; if (member->video_banner_text || (var = switch_channel_get_variable_dup(channel, "video_banner_text", SWITCH_FALSE, -1))) { - conf_video_layer_set_banner(member, layer, var); + conference_video_layer_set_banner(member, layer, var); } var = NULL; if (member->video_logo || (var = switch_channel_get_variable_dup(channel, "video_logo_path", SWITCH_FALSE, -1))) { - conf_video_layer_set_logo(member, layer, var); + conference_video_layer_set_logo(member, layer, var); } layer->member_id = member->id; @@ -789,14 +789,14 @@ switch_status_t conf_video_attach_video_layer(conf_member_t *member, mcu_canvas_ canvas->send_keyframe = 1; //member->watching_canvas_id = canvas->canvas_id; - conf_video_check_used_layers(canvas); + conference_video_check_used_layers(canvas); if (layer->geometry.audio_position) { - conf_api_sub_position(member, NULL, layer->geometry.audio_position); + conference_api_sub_position(member, NULL, layer->geometry.audio_position); } switch_img_fill(canvas->img, layer->x_pos, layer->y_pos, layer->screen_w, layer->screen_h, &canvas->letterbox_bgcolor); - conf_video_reset_video_bitrate_counters(member); + conference_video_reset_video_bitrate_counters(member); end: @@ -807,7 +807,7 @@ switch_status_t conf_video_attach_video_layer(conf_member_t *member, mcu_canvas_ return status; } -void conf_video_init_canvas_layers(conference_obj_t *conference, mcu_canvas_t *canvas, video_layout_t *vlayout) +void conference_video_init_canvas_layers(conference_obj_t *conference, mcu_canvas_t *canvas, video_layout_t *vlayout) { int i = 0; @@ -858,7 +858,7 @@ void conf_video_init_canvas_layers(conference_obj_t *conference, mcu_canvas_t *c layer->geometry.audio_position = vlayout->images[i].audio_position; } - conf_video_reset_image(canvas->img, &canvas->bgcolor); + conference_video_reset_image(canvas->img, &canvas->bgcolor); for (i = 0; i < MCU_MAX_LAYERS; i++) { mcu_layer_t *layer = &canvas->layers[i]; @@ -868,7 +868,7 @@ void conf_video_init_canvas_layers(conference_obj_t *conference, mcu_canvas_t *c layer->banner_patched = 0; layer->refresh = 1; layer->canvas = canvas; - conf_video_reset_layer(layer); + conference_video_reset_layer(layer); } canvas->layers_used = 0; @@ -880,7 +880,7 @@ void conf_video_init_canvas_layers(conference_obj_t *conference, mcu_canvas_t *c } -switch_status_t conf_video_attach_canvas(conference_obj_t *conference, mcu_canvas_t *canvas, int super) +switch_status_t conference_video_attach_canvas(conference_obj_t *conference, mcu_canvas_t *canvas, int super) { if (conference->canvas_count >= MAX_CANVASES + 1) { return SWITCH_STATUS_FALSE; @@ -903,7 +903,7 @@ switch_status_t conf_video_attach_canvas(conference_obj_t *conference, mcu_canva return SWITCH_STATUS_SUCCESS; } -switch_status_t conf_video_init_canvas(conference_obj_t *conference, video_layout_t *vlayout, mcu_canvas_t **canvasP) +switch_status_t conference_video_init_canvas(conference_obj_t *conference, video_layout_t *vlayout, mcu_canvas_t **canvasP) { mcu_canvas_t *canvas; @@ -928,9 +928,9 @@ switch_status_t conf_video_init_canvas(conference_obj_t *conference, video_layou switch_assert(canvas->img); switch_mutex_lock(canvas->mutex); - conf_video_set_canvas_bgcolor(canvas, conference->video_canvas_bgcolor); - conf_video_set_canvas_letterbox_bgcolor(canvas, conference->video_letterbox_bgcolor); - conf_video_init_canvas_layers(conference, canvas, vlayout); + conference_video_set_canvas_bgcolor(canvas, conference->video_canvas_bgcolor); + conference_video_set_canvas_letterbox_bgcolor(canvas, conference->video_letterbox_bgcolor); + conference_video_init_canvas_layers(conference, canvas, vlayout); switch_mutex_unlock(canvas->mutex); canvas->canvas_id = -1; @@ -941,7 +941,7 @@ switch_status_t conf_video_init_canvas(conference_obj_t *conference, video_layou return SWITCH_STATUS_SUCCESS; } -int conf_video_flush_queue(switch_queue_t *q) +int conference_video_flush_queue(switch_queue_t *q) { switch_image_t *img; void *pop; @@ -959,12 +959,12 @@ int conf_video_flush_queue(switch_queue_t *q) } -void conf_video_destroy_canvas(mcu_canvas_t **canvasP) { +void conference_video_destroy_canvas(mcu_canvas_t **canvasP) { int i; mcu_canvas_t *canvas = *canvasP; switch_img_free(&canvas->img); - conf_video_flush_queue(canvas->video_queue); + conference_video_flush_queue(canvas->video_queue); for (i = 0; i < MCU_MAX_LAYERS; i++) { switch_img_free(&canvas->layers[i].img); @@ -973,12 +973,12 @@ void conf_video_destroy_canvas(mcu_canvas_t **canvasP) { *canvasP = NULL; } -void conf_video_write_canvas_image_to_codec_group(conference_obj_t *conference, mcu_canvas_t *canvas, codec_set_t *codec_set, +void conference_video_write_canvas_image_to_codec_group(conference_obj_t *conference, mcu_canvas_t *canvas, codec_set_t *codec_set, int codec_index, uint32_t timestamp, switch_bool_t need_refresh, switch_bool_t need_keyframe, switch_bool_t need_reset) { - conf_member_t *imember; + conference_member_t *imember; switch_frame_t write_frame = { 0 }, *frame = NULL; switch_status_t encode_status = SWITCH_STATUS_FALSE; @@ -1031,7 +1031,7 @@ void conf_video_write_canvas_image_to_codec_group(conference_obj_t *conference, continue; } - if (conf_utils_member_test_flag(imember, MFLAG_NO_MINIMIZE_ENCODING)) { + if (conference_utils_member_test_flag(imember, MFLAG_NO_MINIMIZE_ENCODING)) { continue; } @@ -1066,7 +1066,7 @@ void conf_video_write_canvas_image_to_codec_group(conference_obj_t *conference, } while(encode_status == SWITCH_STATUS_MORE_DATA); } -video_layout_t *conf_video_find_best_layout(conference_obj_t *conference, layout_group_t *lg, uint32_t count) +video_layout_t *conference_video_find_best_layout(conference_obj_t *conference, layout_group_t *lg, uint32_t count) { video_layout_node_t *vlnode = NULL, *last = NULL; @@ -1083,14 +1083,14 @@ video_layout_t *conf_video_find_best_layout(conference_obj_t *conference, layout return vlnode? vlnode->vlayout : last ? last->vlayout : NULL; } -video_layout_t *conf_video_get_layout(conference_obj_t *conference, const char *video_layout_name, const char *video_layout_group) +video_layout_t *conference_video_get_layout(conference_obj_t *conference, const char *video_layout_name, const char *video_layout_group) { layout_group_t *lg = NULL; video_layout_t *vlayout = NULL; if (video_layout_group) { lg = switch_core_hash_find(conference->layout_group_hash, video_layout_group); - vlayout = conf_video_find_best_layout(conference, lg, 0); + vlayout = conference_video_find_best_layout(conference, lg, 0); } else { vlayout = switch_core_hash_find(conference->layout_hash, video_layout_name); } @@ -1098,7 +1098,7 @@ video_layout_t *conf_video_get_layout(conference_obj_t *conference, const char * return vlayout; } -void conf_video_vmute_snap(conf_member_t *member, switch_bool_t clear) +void conference_video_vmute_snap(conference_member_t *member, switch_bool_t clear) { @@ -1123,7 +1123,7 @@ void conf_video_vmute_snap(conf_member_t *member, switch_bool_t clear) } -void conf_video_canvas_del_fnode_layer(conference_obj_t *conference, conference_file_node_t *fnode) +void conference_video_canvas_del_fnode_layer(conference_obj_t *conference, conference_file_node_t *fnode) { mcu_canvas_t *canvas = conference->canvases[fnode->canvas_id]; @@ -1134,12 +1134,12 @@ void conf_video_canvas_del_fnode_layer(conference_obj_t *conference, conference_ fnode->layer_id = -1; fnode->canvas_id = -1; xlayer->fnode = NULL; - conf_video_reset_layer(xlayer); + conference_video_reset_layer(xlayer); } switch_mutex_unlock(canvas->mutex); } -void conf_video_canvas_set_fnode_layer(mcu_canvas_t *canvas, conference_file_node_t *fnode, int idx) +void conference_video_canvas_set_fnode_layer(mcu_canvas_t *canvas, conference_file_node_t *fnode, int idx) { mcu_layer_t *layer = NULL; mcu_layer_t *xlayer = NULL; @@ -1181,10 +1181,10 @@ void conf_video_canvas_set_fnode_layer(mcu_canvas_t *canvas, conference_file_nod fnode->canvas_id = canvas->canvas_id; if (layer->member_id > -1) { - conf_member_t *member; + conference_member_t *member; - if ((member = conf_member_get(canvas->conference, layer->member_id))) { - conf_video_detach_video_layer(member); + if ((member = conference_member_get(canvas->conference, layer->member_id))) { + conference_video_detach_video_layer(member); switch_thread_rwlock_unlock(member->rwlock); } } @@ -1195,43 +1195,43 @@ void conf_video_canvas_set_fnode_layer(mcu_canvas_t *canvas, conference_file_nod } -void conf_video_launch_muxing_write_thread(conf_member_t *member) +void conference_video_launch_muxing_write_thread(conference_member_t *member) { switch_threadattr_t *thd_attr = NULL; - switch_mutex_lock(conf_globals.hash_mutex); + switch_mutex_lock(conference_globals.hash_mutex); if (!member->video_muxing_write_thread) { switch_threadattr_create(&thd_attr, member->pool); switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&member->video_muxing_write_thread, thd_attr, conf_video_muxing_write_thread_run, member, member->pool); + switch_thread_create(&member->video_muxing_write_thread, thd_attr, conference_video_muxing_write_thread_run, member, member->pool); } - switch_mutex_unlock(conf_globals.hash_mutex); + switch_mutex_unlock(conference_globals.hash_mutex); } -void conf_video_launch_muxing_thread(conference_obj_t *conference, mcu_canvas_t *canvas, int super) +void conference_video_launch_muxing_thread(conference_obj_t *conference, mcu_canvas_t *canvas, int super) { switch_threadattr_t *thd_attr = NULL; - switch_mutex_lock(conf_globals.hash_mutex); + switch_mutex_lock(conference_globals.hash_mutex); if (!canvas->video_muxing_thread) { switch_threadattr_create(&thd_attr, conference->pool); switch_threadattr_priority_set(thd_attr, SWITCH_PRI_REALTIME); switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - conf_utils_set_flag(conference, CFLAG_VIDEO_MUXING); + conference_utils_set_flag(conference, CFLAG_VIDEO_MUXING); switch_thread_create(&canvas->video_muxing_thread, thd_attr, - super ? conf_video_super_muxing_thread_run : conf_video_muxing_thread_run, canvas, conference->pool); + super ? conference_video_super_muxing_thread_run : conference_video_muxing_thread_run, canvas, conference->pool); } - switch_mutex_unlock(conf_globals.hash_mutex); + switch_mutex_unlock(conference_globals.hash_mutex); } -void *SWITCH_THREAD_FUNC conf_video_muxing_write_thread_run(switch_thread_t *thread, void *obj) +void *SWITCH_THREAD_FUNC conference_video_muxing_write_thread_run(switch_thread_t *thread, void *obj) { - conf_member_t *member = (conf_member_t *) obj; + conference_member_t *member = (conference_member_t *) obj; void *pop; int loops = 0; - while(conf_utils_member_test_flag(member, MFLAG_RUNNING) || switch_queue_size(member->mux_out_queue)) { + while(conference_utils_member_test_flag(member, MFLAG_RUNNING) || switch_queue_size(member->mux_out_queue)) { switch_frame_t *frame; - if (conf_utils_member_test_flag(member, MFLAG_RUNNING)) { + if (conference_utils_member_test_flag(member, MFLAG_RUNNING)) { if (switch_queue_pop(member->mux_out_queue, &pop) == SWITCH_STATUS_SUCCESS) { if (!pop) continue; @@ -1264,9 +1264,9 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_write_thread_run(switch_thread_t *thr return NULL; } -void conf_video_check_recording(conference_obj_t *conference, switch_frame_t *frame) +void conference_video_check_recording(conference_obj_t *conference, switch_frame_t *frame) { - conf_member_t *imember; + conference_member_t *imember; if (!conference->recording_members) { return; @@ -1287,7 +1287,7 @@ void conf_video_check_recording(conference_obj_t *conference, switch_frame_t *fr } -void conf_video_check_avatar(conf_member_t *member, switch_bool_t force) +void conference_video_check_avatar(conference_member_t *member, switch_bool_t force) { const char *avatar = NULL, *var = NULL; mcu_canvas_t *canvas; @@ -1298,7 +1298,7 @@ void conf_video_check_avatar(conf_member_t *member, switch_bool_t force) canvas = member->conference->canvases[member->canvas_id]; - if (conf_utils_test_flag(member->conference, CFLAG_VIDEO_REQUIRED_FOR_CANVAS) && + if (conference_utils_test_flag(member->conference, CFLAG_VIDEO_REQUIRED_FOR_CANVAS) && (!switch_channel_test_flag(member->channel, CF_VIDEO) || member->video_flow == SWITCH_MEDIA_FLOW_SENDONLY)) { return; } @@ -1310,7 +1310,7 @@ void conf_video_check_avatar(conf_member_t *member, switch_bool_t force) member->avatar_patched = 0; if (!force && switch_channel_test_flag(member->channel, CF_VIDEO) && member->video_flow != SWITCH_MEDIA_FLOW_SENDONLY) { - conf_utils_member_set_flag_locked(member, MFLAG_ACK_VIDEO); + conference_utils_member_set_flag_locked(member, MFLAG_ACK_VIDEO); } else { if (member->conference->no_video_avatar) { avatar = member->conference->no_video_avatar; @@ -1340,7 +1340,7 @@ void conf_video_check_avatar(conf_member_t *member, switch_bool_t force) } } -void conf_video_check_flush(conf_member_t *member) +void conference_video_check_flush(conference_member_t *member) { int flushed; @@ -1348,20 +1348,20 @@ void conf_video_check_flush(conf_member_t *member) return; } - flushed = conf_video_flush_queue(member->video_queue); + flushed = conference_video_flush_queue(member->video_queue); if (flushed && member->auto_avatar) { switch_channel_video_sync(member->channel); switch_img_free(&member->avatar_png_img); member->avatar_patched = 0; - conf_video_reset_video_bitrate_counters(member); + conference_video_reset_video_bitrate_counters(member); member->blanks = 0; member->auto_avatar = 0; } } -void conf_video_patch_fnode(mcu_canvas_t *canvas, conference_file_node_t *fnode) +void conference_video_patch_fnode(mcu_canvas_t *canvas, conference_file_node_t *fnode) { if (fnode && fnode->layer_id > -1) { mcu_layer_t *layer = &canvas->layers[fnode->layer_id]; @@ -1374,13 +1374,13 @@ void conf_video_patch_fnode(mcu_canvas_t *canvas, conference_file_node_t *fnode) layer->tagged = 1; } else if (status == SWITCH_STATUS_IGNORE) { if (canvas && fnode->layer_id > -1 ) { - conf_video_canvas_del_fnode_layer(canvas->conference, fnode); + conference_video_canvas_del_fnode_layer(canvas->conference, fnode); } } } } -void conf_video_fnode_check(conference_file_node_t *fnode) { +void conference_video_fnode_check(conference_file_node_t *fnode) { mcu_canvas_t *canvas = fnode->conference->canvases[fnode->canvas_id]; if (switch_core_file_has_video(&fnode->fh) && switch_core_file_read_video(&fnode->fh, NULL, SVR_CHECK) == SWITCH_STATUS_BREAK) { @@ -1394,13 +1394,13 @@ void conf_video_fnode_check(conference_file_node_t *fnode) { canvas->play_file = 1; canvas->conference->playing_video_file = 1; } else { - conf_video_canvas_set_fnode_layer(canvas, fnode, -1); + conference_video_canvas_set_fnode_layer(canvas, fnode, -1); } } } -switch_status_t conf_video_find_layer(conference_obj_t *conference, mcu_canvas_t *canvas, conf_member_t *member, mcu_layer_t **layerP) +switch_status_t conference_video_find_layer(conference_obj_t *conference, mcu_canvas_t *canvas, conference_member_t *member, mcu_layer_t **layerP) { uint32_t avatar_layers = 0; mcu_layer_t *layer = NULL; @@ -1418,7 +1418,7 @@ switch_status_t conf_video_find_layer(conference_obj_t *conference, mcu_canvas_t if (!layer && (canvas->layers_used < canvas->total_layers || - (avatar_layers && !member->avatar_png_img) || conf_utils_member_test_flag(member, MFLAG_MOD)) && + (avatar_layers && !member->avatar_png_img) || conference_utils_member_test_flag(member, MFLAG_MOD)) && (member->avatar_png_img || member->video_flow != SWITCH_MEDIA_FLOW_SENDONLY)) { /* find an empty layer */ for (i = 0; i < canvas->total_layers; i++) { @@ -1427,13 +1427,13 @@ switch_status_t conf_video_find_layer(conference_obj_t *conference, mcu_canvas_t if (xlayer->geometry.res_id) { if (member->video_reservation_id && !strcmp(xlayer->geometry.res_id, member->video_reservation_id)) { layer = xlayer; - conf_video_attach_video_layer(member, canvas, i); + conference_video_attach_video_layer(member, canvas, i); break; } } else if (xlayer->geometry.flooronly && !xlayer->fnode) { if (member->id == conference->video_floor_holder) { layer = xlayer; - conf_video_attach_video_layer(member, canvas, i); + conference_video_attach_video_layer(member, canvas, i); break; } } else if ((!xlayer->member_id || (!member->avatar_png_img && @@ -1442,7 +1442,7 @@ switch_status_t conf_video_find_layer(conference_obj_t *conference, mcu_canvas_t !xlayer->fnode && !xlayer->geometry.fileonly) { switch_status_t lstatus; - lstatus = conf_video_attach_video_layer(member, canvas, i); + lstatus = conference_video_attach_video_layer(member, canvas, i); if (lstatus == SWITCH_STATUS_SUCCESS || lstatus == SWITCH_STATUS_BREAK) { layer = xlayer; @@ -1463,7 +1463,7 @@ switch_status_t conf_video_find_layer(conference_obj_t *conference, mcu_canvas_t } -void conf_video_next_canvas(conf_member_t *imember) +void conference_video_next_canvas(conference_member_t *imember) { if (imember->canvas_id == imember->conference->canvas_count - 1) { imember->canvas_id = 0; @@ -1474,7 +1474,7 @@ void conf_video_next_canvas(conf_member_t *imember) imember->layer_timeout = DEFAULT_LAYER_TIMEOUT; } -void conf_video_pop_next_image(conf_member_t *member, switch_image_t **imgP) +void conference_video_pop_next_image(conference_member_t *member, switch_image_t **imgP) { switch_image_t *img = *imgP; int size = 0; @@ -1492,11 +1492,11 @@ void conf_video_pop_next_image(conf_member_t *member, switch_image_t **imgP) size = switch_queue_size(member->video_queue); } while(size > member->conference->video_fps.fps / 2); - if (conf_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN) && member->video_layer_id > -1 && member->video_flow != SWITCH_MEDIA_FLOW_SENDONLY) { + if (conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN) && member->video_layer_id > -1 && member->video_flow != SWITCH_MEDIA_FLOW_SENDONLY) { if (img) { member->good_img++; if ((member->good_img % (int)(member->conference->video_fps.fps * 10)) == 0) { - conf_video_reset_video_bitrate_counters(member); + conference_video_reset_video_bitrate_counters(member); } } else { member->blanks++; @@ -1509,7 +1509,7 @@ void conf_video_pop_next_image(conf_member_t *member, switch_image_t **imgP) if (member->blanks == member->conference->video_fps.fps * 5) { member->blackouts++; - conf_video_check_avatar(member, SWITCH_TRUE); + conference_video_check_avatar(member, SWITCH_TRUE); member->managed_kps = 0; if (member->avatar_png_img) { @@ -1523,15 +1523,15 @@ void conf_video_pop_next_image(conf_member_t *member, switch_image_t **imgP) } } } else { - conf_video_check_flush(member); + conference_video_check_flush(member); } *imgP = img; } -void conf_video_check_auto_bitrate(conf_member_t *member, mcu_layer_t *layer) +void conference_video_check_auto_bitrate(conference_member_t *member, mcu_layer_t *layer) { - if (conf_utils_test_flag(member->conference, CFLAG_MANAGE_INBOUND_VIDEO_BITRATE) && !member->managed_kps) { + if (conference_utils_test_flag(member->conference, CFLAG_MANAGE_INBOUND_VIDEO_BITRATE) && !member->managed_kps) { switch_core_session_message_t msg = { 0 }; int kps; int w = 320; @@ -1544,7 +1544,7 @@ void conf_video_check_auto_bitrate(conf_member_t *member, mcu_layer_t *layer) } } - if (!layer || !conf_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN) || member->avatar_png_img) { + if (!layer || !conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN) || member->avatar_png_img) { kps = 200; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "%s auto-setting bitrate to %dkps because user's image is not visible\n", switch_channel_get_name(member->channel), kps); @@ -1563,11 +1563,11 @@ void conf_video_check_auto_bitrate(conf_member_t *member, mcu_layer_t *layer) } } -void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, void *obj) +void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thread, void *obj) { mcu_canvas_t *canvas = (mcu_canvas_t *) obj; conference_obj_t *conference = canvas->conference; - conf_member_t *imember; + conference_member_t *imember; switch_codec_t *check_codec = NULL; codec_set_t *write_codecs[MAX_MUX_CODECS] = { 0 }; int buflen = SWITCH_RTP_MAX_BUF_LEN; @@ -1579,7 +1579,7 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v uint8_t *packet = NULL; switch_image_t *write_img = NULL, *file_img = NULL; uint32_t timestamp = 0; - //video_layout_t *vlayout = conf_video_get_layout(conference); + //video_layout_t *vlayout = conference_video_get_layout(conference); int members_with_video = 0, members_with_avatar = 0; int do_refresh = 0; int last_file_count = 0; @@ -1588,7 +1588,7 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v packet = switch_core_alloc(conference->pool, SWITCH_RTP_MAX_BUF_LEN); - while (conf_globals.running && !conf_utils_test_flag(conference, CFLAG_DESTRUCT) && conf_utils_test_flag(conference, CFLAG_VIDEO_MUXING)) { + while (conference_globals.running && !conference_utils_test_flag(conference, CFLAG_DESTRUCT) && conference_utils_test_flag(conference, CFLAG_VIDEO_MUXING)) { switch_bool_t need_refresh = SWITCH_FALSE, need_keyframe = SWITCH_FALSE, need_reset = SWITCH_FALSE; switch_time_t now; int min_members = 0; @@ -1600,7 +1600,7 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v switch_mutex_lock(canvas->mutex); if (canvas->new_vlayout) { - conf_video_init_canvas_layers(conference, canvas, NULL); + conference_video_init_canvas_layers(conference, canvas, NULL); } switch_mutex_unlock(canvas->mutex); @@ -1630,7 +1630,7 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v count_changed = 1; } - if (count_changed && !conf_utils_test_flag(conference, CFLAG_PERSONAL_CANVAS)) { + if (count_changed && !conference_utils_test_flag(conference, CFLAG_PERSONAL_CANVAS)) { layout_group_t *lg = NULL; video_layout_t *vlayout = NULL; int canvas_count = 0; @@ -1644,7 +1644,7 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v switch_mutex_unlock(conference->member_mutex); if (conference->video_layout_group && (lg = switch_core_hash_find(conference->layout_group_hash, conference->video_layout_group))) { - if ((vlayout = conf_video_find_best_layout(conference, lg, canvas_count))) { + if ((vlayout = conference_video_find_best_layout(conference, lg, canvas_count))) { switch_mutex_lock(conference->member_mutex); conference->canvas->new_vlayout = vlayout; switch_mutex_unlock(conference->member_mutex); @@ -1694,7 +1694,7 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v members_with_video = conference->members_with_video; members_with_avatar = conference->members_with_avatar; - if (conf_utils_test_flag(conference, CFLAG_VIDEO_BRIDGE_FIRST_TWO)) { + if (conference_utils_test_flag(conference, CFLAG_VIDEO_BRIDGE_FIRST_TWO)) { if (conference->members_with_video < 3) { switch_yield(20000); continue; @@ -1708,7 +1708,7 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v int i; if (!imember->session || (!switch_channel_test_flag(imember->channel, CF_VIDEO) && !imember->avatar_png_img) || - conf_utils_test_flag(conference, CFLAG_PERSONAL_CANVAS) || switch_core_session_read_lock(imember->session) != SWITCH_STATUS_SUCCESS) { + conference_utils_test_flag(conference, CFLAG_PERSONAL_CANVAS) || switch_core_session_read_lock(imember->session) != SWITCH_STATUS_SUCCESS) { continue; } @@ -1717,9 +1717,9 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v need_keyframe = SWITCH_TRUE; } - if (conf_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING) && + if (conference_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING) && imember->watching_canvas_id > -1 && imember->watching_canvas_id == canvas->canvas_id && - !conf_utils_member_test_flag(imember, MFLAG_NO_MINIMIZE_ENCODING)) { + !conference_utils_member_test_flag(imember, MFLAG_NO_MINIMIZE_ENCODING)) { min_members++; if (switch_channel_test_flag(imember->channel, CF_VIDEO)) { @@ -1775,10 +1775,10 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v //VIDFLOOR if (conference->canvas_count == 1 && canvas->layout_floor_id > -1 && imember->id == conference->video_floor_holder && imember->video_layer_id != canvas->layout_floor_id) { - conf_video_attach_video_layer(imember, canvas, canvas->layout_floor_id); + conference_video_attach_video_layer(imember, canvas, canvas->layout_floor_id); } - conf_video_pop_next_image(imember, &img); + conference_video_pop_next_image(imember, &img); layer = NULL; switch_mutex_lock(canvas->mutex); @@ -1808,16 +1808,16 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v } if (!layer) { - if (conf_video_find_layer(conference, canvas, imember, &layer) == SWITCH_STATUS_SUCCESS) { + if (conference_video_find_layer(conference, canvas, imember, &layer) == SWITCH_STATUS_SUCCESS) { imember->layer_timeout = 0; } else { if (--imember->layer_timeout <= 0) { - conf_video_next_canvas(imember); + conference_video_next_canvas(imember); } } } - conf_video_check_auto_bitrate(imember, layer); + conference_video_check_auto_bitrate(imember, layer); if (layer) { @@ -1825,7 +1825,7 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v // switch_img_free(&layer->cur_img); //} - if (conf_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN)) { + if (conference_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN)) { layer->mute_patched = 0; } else { switch_image_t *tmp; @@ -1837,7 +1837,7 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v if (!layer->mute_patched) { if (imember->video_mute_img || layer->mute_img) { - conf_video_clear_layer(layer); + conference_video_clear_layer(layer); if (!layer->mute_img && imember->video_mute_img) { //layer->mute_img = switch_img_read_png(imember->video_mute_png, SWITCH_IMG_FMT_I420); @@ -1845,7 +1845,7 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v } if (layer->mute_img) { - conf_video_scale_and_patch(layer, layer->mute_img, SWITCH_FALSE); + conference_video_scale_and_patch(layer, layer->mute_img, SWITCH_FALSE); } } @@ -1889,10 +1889,10 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v switch_mutex_unlock(conference->member_mutex); - if (conf_utils_test_flag(conference, CFLAG_PERSONAL_CANVAS)) { + if (conference_utils_test_flag(conference, CFLAG_PERSONAL_CANVAS)) { layout_group_t *lg = NULL; video_layout_t *vlayout = NULL; - conf_member_t *omember; + conference_member_t *omember; if (video_key_freq && (now - last_key_time) > video_key_freq) { need_keyframe = SWITCH_TRUE; @@ -1916,7 +1916,7 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v if (count_changed) { int total = conference->members_with_video; - if (!conf_utils_test_flag(conference, CFLAG_VIDEO_REQUIRED_FOR_CANVAS)) { + if (!conference_utils_test_flag(conference, CFLAG_VIDEO_REQUIRED_FOR_CANVAS)) { total += conference->members_with_avatar; } @@ -1927,14 +1927,14 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v if (total < 1) total = 1; if (conference->video_layout_group && (lg = switch_core_hash_find(conference->layout_group_hash, conference->video_layout_group))) { - if ((vlayout = conf_video_find_best_layout(conference, lg, total + file_count))) { - conf_video_init_canvas_layers(conference, imember->canvas, vlayout); + if ((vlayout = conference_video_find_best_layout(conference, lg, total + file_count))) { + conference_video_init_canvas_layers(conference, imember->canvas, vlayout); } } } if (imember->video_flow != SWITCH_MEDIA_FLOW_SENDONLY) { - conf_video_pop_next_image(imember, &imember->pcanvas_img); + conference_video_pop_next_image(imember, &imember->pcanvas_img); } switch_core_session_rwunlock(imember->session); @@ -1987,19 +1987,19 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v switch_img_free(&layer->logo_img); if (layer->geometry.audio_position) { - conf_api_sub_position(omember, NULL, layer->geometry.audio_position); + conference_api_sub_position(omember, NULL, layer->geometry.audio_position); } var = NULL; if (omember->video_banner_text || (var = switch_channel_get_variable_dup(omember->channel, "video_banner_text", SWITCH_FALSE, -1))) { - conf_video_layer_set_banner(omember, layer, var); + conference_video_layer_set_banner(omember, layer, var); } var = NULL; if (omember->video_logo || (var = switch_channel_get_variable_dup(omember->channel, "video_logo_path", SWITCH_FALSE, -1))) { - conf_video_layer_set_logo(omember, layer, var); + conference_video_layer_set_logo(omember, layer, var); } } @@ -2007,7 +2007,7 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v } if (!layer && omember->al) { - conf_api_sub_position(omember, NULL, "0:0:0"); + conference_api_sub_position(omember, NULL, "0:0:0"); } use_img = omember->pcanvas_img; @@ -2018,7 +2018,7 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v layer->avatar_patched = 0; } else { if (!layer->avatar_patched) { - conf_video_scale_and_patch(layer, omember->avatar_png_img, SWITCH_FALSE); + conference_video_scale_and_patch(layer, omember->avatar_png_img, SWITCH_FALSE); layer->avatar_patched = 1; } use_img = NULL; @@ -2026,12 +2026,12 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v } if (layer) { - if (conf_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN)) { + if (conference_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN)) { layer->mute_patched = 0; } else { if (!layer->mute_patched) { switch_image_t *tmp; - conf_video_scale_and_patch(layer, imember->video_mute_img ? imember->video_mute_img : omember->pcanvas_img, SWITCH_FALSE); + conference_video_scale_and_patch(layer, imember->video_mute_img ? imember->video_mute_img : omember->pcanvas_img, SWITCH_FALSE); tmp = switch_img_write_text_img(layer->screen_w, layer->screen_h, SWITCH_TRUE, "VIDEO MUTED"); switch_img_patch(imember->canvas->img, tmp, layer->x_pos, layer->y_pos); switch_img_free(&tmp); @@ -2044,11 +2044,11 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v } if (layer && use_img) { - conf_video_scale_and_patch(layer, use_img, SWITCH_FALSE); + conference_video_scale_and_patch(layer, use_img, SWITCH_FALSE); } } - conf_video_check_auto_bitrate(omember, layer); + conference_video_check_auto_bitrate(omember, layer); } for (j = 0; j < file_count; j++) { @@ -2056,7 +2056,7 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v if (i < imember->canvas->total_layers) { layer = &imember->canvas->layers[i++]; - conf_video_scale_and_patch(layer, img, SWITCH_FALSE); + conference_video_scale_and_patch(layer, img, SWITCH_FALSE); } } @@ -2104,17 +2104,17 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v if (canvas->canvas_id == 0) { if (conference->async_fnode) { if (conference->async_fnode->layer_id > -1) { - conf_video_patch_fnode(canvas, conference->async_fnode); + conference_video_patch_fnode(canvas, conference->async_fnode); } else { - conf_video_fnode_check(conference->async_fnode); + conference_video_fnode_check(conference->async_fnode); } } if (conference->fnode) { if (conference->fnode->layer_id > -1) { - conf_video_patch_fnode(canvas, conference->fnode); + conference_video_patch_fnode(canvas, conference->fnode); } else { - conf_video_fnode_check(conference->fnode); + conference_video_fnode_check(conference->fnode); } } } @@ -2130,7 +2130,7 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v } if (layer->cur_img) { - conf_video_scale_and_patch(layer, NULL, SWITCH_FALSE); + conference_video_scale_and_patch(layer, NULL, SWITCH_FALSE); } layer->tagged = 0; @@ -2184,7 +2184,7 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v write_frame.img = write_img; if (conference->canvas_count == 1) { - conf_video_check_recording(conference, &write_frame); + conference_video_check_recording(conference, &write_frame); } if (conference->canvas_count > 1) { @@ -2197,10 +2197,10 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v } } - if (min_members && conf_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING)) { + if (min_members && conference_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING)) { for (i = 0; write_codecs[i] && switch_core_codec_ready(&write_codecs[i]->codec) && i < MAX_MUX_CODECS; i++) { write_codecs[i]->frame.img = write_img; - conf_video_write_canvas_image_to_codec_group(conference, canvas, write_codecs[i], i, + conference_video_write_canvas_image_to_codec_group(conference, canvas, write_codecs[i], i, timestamp, need_refresh, need_keyframe, need_reset); if (canvas->video_write_bandwidth) { @@ -2217,7 +2217,7 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v if (imember->watching_canvas_id != canvas->canvas_id) continue; - if (conf_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING) && !conf_utils_member_test_flag(imember, MFLAG_NO_MINIMIZE_ENCODING)) { + if (conference_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING) && !conference_utils_member_test_flag(imember, MFLAG_NO_MINIMIZE_ENCODING)) { continue; } @@ -2285,12 +2285,12 @@ void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, v } switch_core_timer_destroy(&canvas->timer); - conf_video_destroy_canvas(&canvas); + conference_video_destroy_canvas(&canvas); return NULL; } -void pop_conf_video_next_canvas_image(mcu_canvas_t *canvas, switch_image_t **imgP) +void pop_conference_video_next_canvas_image(mcu_canvas_t *canvas, switch_image_t **imgP) { switch_image_t *img = *imgP; int size = 0; @@ -2311,11 +2311,11 @@ void pop_conf_video_next_canvas_image(mcu_canvas_t *canvas, switch_image_t **img *imgP = img; } -void *SWITCH_THREAD_FUNC conf_video_super_muxing_thread_run(switch_thread_t *thread, void *obj) +void *SWITCH_THREAD_FUNC conference_video_super_muxing_thread_run(switch_thread_t *thread, void *obj) { mcu_canvas_t *canvas = (mcu_canvas_t *) obj; conference_obj_t *conference = canvas->conference; - conf_member_t *imember; + conference_member_t *imember; switch_codec_t *check_codec = NULL; codec_set_t *write_codecs[MAX_MUX_CODECS] = { 0 }; int buflen = SWITCH_RTP_MAX_BUF_LEN; @@ -2334,7 +2334,7 @@ void *SWITCH_THREAD_FUNC conf_video_super_muxing_thread_run(switch_thread_t *thr packet = switch_core_alloc(conference->pool, SWITCH_RTP_MAX_BUF_LEN); - while (conf_globals.running && !conf_utils_test_flag(conference, CFLAG_DESTRUCT) && conf_utils_test_flag(conference, CFLAG_VIDEO_MUXING)) { + while (conference_globals.running && !conference_utils_test_flag(conference, CFLAG_DESTRUCT) && conference_utils_test_flag(conference, CFLAG_VIDEO_MUXING)) { switch_bool_t need_refresh = SWITCH_FALSE, need_keyframe = SWITCH_FALSE, need_reset = SWITCH_FALSE; switch_time_t now; int min_members = 0; @@ -2345,7 +2345,7 @@ void *SWITCH_THREAD_FUNC conf_video_super_muxing_thread_run(switch_thread_t *thr switch_mutex_lock(canvas->mutex); if (canvas->new_vlayout) { - conf_video_init_canvas_layers(conference, canvas, NULL); + conference_video_init_canvas_layers(conference, canvas, NULL); } switch_mutex_unlock(canvas->mutex); @@ -2401,8 +2401,8 @@ void *SWITCH_THREAD_FUNC conf_video_super_muxing_thread_run(switch_thread_t *thr if (total < 1) total = 1; if ((lg = switch_core_hash_find(conference->layout_group_hash, CONFERENCE_MUX_DEFAULT_SUPER_LAYOUT))) { - if ((vlayout = conf_video_find_best_layout(conference, lg, total))) { - conf_video_init_canvas_layers(conference, canvas, vlayout); + if ((vlayout = conference_video_find_best_layout(conference, lg, total))) { + conference_video_init_canvas_layers(conference, canvas, vlayout); } } } @@ -2413,7 +2413,7 @@ void *SWITCH_THREAD_FUNC conf_video_super_muxing_thread_run(switch_thread_t *thr int i; if (!imember->session || (!switch_channel_test_flag(imember->channel, CF_VIDEO) && !imember->avatar_png_img) || - conf_utils_test_flag(conference, CFLAG_PERSONAL_CANVAS) || switch_core_session_read_lock(imember->session) != SWITCH_STATUS_SUCCESS) { + conference_utils_test_flag(conference, CFLAG_PERSONAL_CANVAS) || switch_core_session_read_lock(imember->session) != SWITCH_STATUS_SUCCESS) { continue; } @@ -2422,9 +2422,9 @@ void *SWITCH_THREAD_FUNC conf_video_super_muxing_thread_run(switch_thread_t *thr need_keyframe = SWITCH_TRUE; } - if (conf_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING) && + if (conference_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING) && imember->watching_canvas_id > -1 && imember->watching_canvas_id == canvas->canvas_id && - !conf_utils_member_test_flag(imember, MFLAG_NO_MINIMIZE_ENCODING)) { + !conference_utils_member_test_flag(imember, MFLAG_NO_MINIMIZE_ENCODING)) { min_members++; if (switch_channel_test_flag(imember->channel, CF_VIDEO)) { @@ -2477,7 +2477,7 @@ void *SWITCH_THREAD_FUNC conf_video_super_muxing_thread_run(switch_thread_t *thr for (j = 0; j < conference->canvas_count; j++) { mcu_canvas_t *jcanvas = (mcu_canvas_t *) conference->canvases[j]; - pop_conf_video_next_canvas_image(jcanvas, &img); + pop_conference_video_next_canvas_image(jcanvas, &img); if (!jcanvas->layers_used && !conference->super_canvas_show_all_layers) { switch_img_free(&img); @@ -2515,7 +2515,7 @@ void *SWITCH_THREAD_FUNC conf_video_super_muxing_thread_run(switch_thread_t *thr img = NULL; } - conf_video_scale_and_patch(layer, NULL, SWITCH_FALSE); + conference_video_scale_and_patch(layer, NULL, SWITCH_FALSE); } switch_img_free(&img); @@ -2531,12 +2531,12 @@ void *SWITCH_THREAD_FUNC conf_video_super_muxing_thread_run(switch_thread_t *thr if (!write_img) continue; write_frame.img = write_img; - conf_video_check_recording(conference, &write_frame); + conference_video_check_recording(conference, &write_frame); - if (min_members && conf_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING)) { + if (min_members && conference_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING)) { for (i = 0; write_codecs[i] && switch_core_codec_ready(&write_codecs[i]->codec) && i < MAX_MUX_CODECS; i++) { write_codecs[i]->frame.img = write_img; - conf_video_write_canvas_image_to_codec_group(conference, canvas, write_codecs[i], i, timestamp, need_refresh, need_keyframe, need_reset); + conference_video_write_canvas_image_to_codec_group(conference, canvas, write_codecs[i], i, timestamp, need_refresh, need_keyframe, need_reset); if (canvas->video_write_bandwidth) { switch_core_codec_control(&write_codecs[i]->codec, SCC_VIDEO_BANDWIDTH, SCCT_INT, &canvas->video_write_bandwidth, NULL, NULL); @@ -2551,7 +2551,7 @@ void *SWITCH_THREAD_FUNC conf_video_super_muxing_thread_run(switch_thread_t *thr if (imember->watching_canvas_id != canvas->canvas_id) continue; - if (conf_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING) && !conf_utils_member_test_flag(imember, MFLAG_NO_MINIMIZE_ENCODING)) { + if (conference_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING) && !conference_utils_member_test_flag(imember, MFLAG_NO_MINIMIZE_ENCODING)) { continue; } @@ -2616,20 +2616,20 @@ void *SWITCH_THREAD_FUNC conf_video_super_muxing_thread_run(switch_thread_t *thr } switch_core_timer_destroy(&canvas->timer); - conf_video_destroy_canvas(&canvas); + conference_video_destroy_canvas(&canvas); return NULL; } -void conf_video_find_floor(conf_member_t *member, switch_bool_t entering) +void conference_video_find_floor(conference_member_t *member, switch_bool_t entering) { - conf_member_t *imember; + conference_member_t *imember; conference_obj_t *conference = member->conference; if (!entering) { if (member->id == conference->video_floor_holder) { - conf_video_set_floor_holder(conference, NULL, SWITCH_FALSE); + conference_video_set_floor_holder(conference, NULL, SWITCH_FALSE); } else if (member->id == conference->last_video_floor_holder) { conference->last_video_floor_holder = 0; } @@ -2655,12 +2655,12 @@ void conf_video_find_floor(conf_member_t *member, switch_bool_t entering) } if (conference->floor_holder && imember == conference->floor_holder) { - conf_video_set_floor_holder(conference, imember, 0); + conference_video_set_floor_holder(conference, imember, 0); continue; } if (!conference->video_floor_holder) { - conf_video_set_floor_holder(conference, imember, 0); + conference_video_set_floor_holder(conference, imember, 0); continue; } @@ -2678,23 +2678,23 @@ void conf_video_find_floor(conf_member_t *member, switch_bool_t entering) } } -void conf_video_reset_member_codec_index(conf_member_t *member) +void conference_video_reset_member_codec_index(conference_member_t *member) { member->video_codec_index = -1; } -void conf_video_set_floor_holder(conference_obj_t *conference, conf_member_t *member, switch_bool_t force) +void conference_video_set_floor_holder(conference_obj_t *conference, conference_member_t *member, switch_bool_t force) { switch_event_t *event; - conf_member_t *imember = NULL; + conference_member_t *imember = NULL; int old_id = 0; uint32_t old_member = 0; if (!member) { - conf_utils_clear_flag(conference, CFLAG_VID_FLOOR_LOCK); + conference_utils_clear_flag(conference, CFLAG_VID_FLOOR_LOCK); } - if ((!force && conf_utils_test_flag(conference, CFLAG_VID_FLOOR_LOCK))) { + if ((!force && conference_utils_test_flag(conference, CFLAG_VID_FLOOR_LOCK))) { return; } @@ -2710,11 +2710,11 @@ void conf_video_set_floor_holder(conference_obj_t *conference, conf_member_t *me conference->last_video_floor_holder = conference->video_floor_holder; } - if (conference->last_video_floor_holder && (imember = conf_member_get(conference, conference->last_video_floor_holder))) { + if (conference->last_video_floor_holder && (imember = conference_member_get(conference, conference->last_video_floor_holder))) { switch_core_session_request_video_refresh(imember->session); - if (conf_utils_member_test_flag(imember, MFLAG_VIDEO_BRIDGE)) { - conf_utils_set_flag(conference, CFLAG_VID_FLOOR_LOCK); + if (conference_utils_member_test_flag(imember, MFLAG_VIDEO_BRIDGE)) { + conference_utils_set_flag(conference, CFLAG_VID_FLOOR_LOCK); } switch_thread_rwlock_unlock(imember->rwlock); imember = NULL; @@ -2739,28 +2739,28 @@ void conf_video_set_floor_holder(conference_obj_t *conference, conf_member_t *me //VIDFLOOR if (conference->canvas_count == 1 && member && conference->canvas && conference->canvas->layout_floor_id > -1) { - conf_video_attach_video_layer(member, conference->canvas, conference->canvas->layout_floor_id); + conference_video_attach_video_layer(member, conference->canvas, conference->canvas->layout_floor_id); } if (member) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Adding video floor %s\n", switch_channel_get_name(member->channel)); - conf_video_check_flush(member); + conference_video_check_flush(member); switch_core_session_video_reinit(member->session); conference->video_floor_holder = member->id; - conf_member_update_status_field(member); + conference_member_update_status_field(member); } else { conference->video_floor_holder = 0; } if (old_member) { - conf_member_t *old_member_p = NULL; + conference_member_t *old_member_p = NULL; old_id = old_member; - if ((old_member_p = conf_member_get(conference, old_id))) { - conf_member_update_status_field(old_member_p); + if ((old_member_p = conference_member_get(conference, old_id))) { + conference_member_update_status_field(old_member_p); switch_thread_rwlock_unlock(old_member_p->rwlock); } } @@ -2777,11 +2777,11 @@ void conf_video_set_floor_holder(conference_obj_t *conference, conf_member_t *me } switch_mutex_unlock(conference->member_mutex); - conf_utils_set_flag(conference, CFLAG_FLOOR_CHANGE); + conference_utils_set_flag(conference, CFLAG_FLOOR_CHANGE); if (test_eflag(conference, EFLAG_FLOOR_CHANGE)) { switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT); - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "video-floor-change"); if (old_id) { switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Old-ID", "%d", old_id); @@ -2799,9 +2799,9 @@ void conf_video_set_floor_holder(conference_obj_t *conference, conf_member_t *me } -void conf_video_write_frame(conference_obj_t *conference, conf_member_t *floor_holder, switch_frame_t *vid_frame) +void conference_video_write_frame(conference_obj_t *conference, conference_member_t *floor_holder, switch_frame_t *vid_frame) { - conf_member_t *imember; + conference_member_t *imember; int want_refresh = 0; unsigned char buf[SWITCH_RTP_MAX_BUF_LEN] = ""; switch_frame_t tmp_frame = { 0 }; @@ -2810,8 +2810,8 @@ void conf_video_write_frame(conference_obj_t *conference, conf_member_t *floor_h return; } - if (conf_utils_test_flag(conference, CFLAG_FLOOR_CHANGE)) { - conf_utils_clear_flag(conference, CFLAG_FLOOR_CHANGE); + if (conference_utils_test_flag(conference, CFLAG_FLOOR_CHANGE)) { + conference_utils_clear_flag(conference, CFLAG_FLOOR_CHANGE); } if (vid_frame->img && conference->canvas) { @@ -2821,7 +2821,7 @@ void conf_video_write_frame(conference_obj_t *conference, conf_member_t *floor_h switch_img_copy(vid_frame->img, &tmp_img); switch_img_fit(&tmp_img, conference->canvas->width, conference->canvas->height); frame_img = switch_img_alloc(NULL, SWITCH_IMG_FMT_I420, conference->canvas->width, conference->canvas->height, 1); - conf_video_reset_image(frame_img, &conference->canvas->bgcolor); + conference_video_reset_image(frame_img, &conference->canvas->bgcolor); switch_img_find_position(POS_CENTER_MID, frame_img->d_w, frame_img->d_h, tmp_img->d_w, tmp_img->d_h, &x, &y); switch_img_patch(frame_img, tmp_img, x, y); tmp_frame.packet = buf; @@ -2847,12 +2847,12 @@ void conf_video_write_frame(conference_obj_t *conference, conf_member_t *floor_h if (isession && switch_channel_test_flag(imember->channel, CF_VIDEO)) { int send_frame = 0; - if (conference->canvas && conf_utils_test_flag(imember->conference, CFLAG_VIDEO_BRIDGE_FIRST_TWO)) { + if (conference->canvas && conference_utils_test_flag(imember->conference, CFLAG_VIDEO_BRIDGE_FIRST_TWO)) { if (switch_channel_test_flag(imember->channel, CF_VIDEO) && (conference->members_with_video == 1 || imember != floor_holder)) { send_frame = 1; } - } else if (!conf_utils_member_test_flag(imember, MFLAG_RECEIVING_VIDEO) && - (conf_utils_test_flag(conference, CFLAG_VID_FLOOR_LOCK) || + } else if (!conference_utils_member_test_flag(imember, MFLAG_RECEIVING_VIDEO) && + (conference_utils_test_flag(conference, CFLAG_VID_FLOOR_LOCK) || !(imember->id == imember->conference->video_floor_holder && imember->conference->last_video_floor_holder))) { send_frame = 1; } @@ -2891,11 +2891,11 @@ void conf_video_write_frame(conference_obj_t *conference, conf_member_t *floor_h } } -switch_status_t conf_video_thread_callback(switch_core_session_t *session, switch_frame_t *frame, void *user_data) +switch_status_t conference_video_thread_callback(switch_core_session_t *session, switch_frame_t *frame, void *user_data) { //switch_channel_t *channel = switch_core_session_get_channel(session); //char *name = switch_channel_get_name(channel); - conf_member_t *member = (conf_member_t *)user_data; + conference_member_t *member = (conference_member_t *)user_data; conference_relationship_t *rel = NULL, *last = NULL; switch_assert(member); @@ -2910,20 +2910,20 @@ switch_status_t conf_video_thread_callback(switch_core_session_t *session, switc } - if (conf_utils_test_flag(member->conference, CFLAG_VIDEO_BRIDGE_FIRST_TWO)) { + if (conference_utils_test_flag(member->conference, CFLAG_VIDEO_BRIDGE_FIRST_TWO)) { if (member->conference->members_with_video < 3) { - conf_video_write_frame(member->conference, member, frame); - conf_video_check_recording(member->conference, frame); + conference_video_write_frame(member->conference, member, frame); + conference_video_check_recording(member->conference, frame); switch_thread_rwlock_unlock(member->conference->rwlock); return SWITCH_STATUS_SUCCESS; } } - if (conf_utils_test_flag(member->conference, CFLAG_VIDEO_MUXING)) { + if (conference_utils_test_flag(member->conference, CFLAG_VIDEO_MUXING)) { switch_image_t *img_copy = NULL; - if (frame->img && (member->video_layer_id > -1 || member->canvas) && conf_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN) && + if (frame->img && (member->video_layer_id > -1 || member->canvas) && conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN) && !member->conference->playing_video_file && switch_queue_size(member->video_queue) < member->conference->video_fps.fps) { switch_img_copy(frame->img, &img_copy); switch_queue_push(member->video_queue, img_copy); @@ -2934,10 +2934,10 @@ switch_status_t conf_video_thread_callback(switch_core_session_t *session, switc } for (rel = member->relationships; rel; rel = rel->next) { - conf_member_t *imember; + conference_member_t *imember; if (!(rel->flags & RFLAG_CAN_SEND_VIDEO)) continue; - if ((imember = conf_member_get(member->conference, rel->id)) && conf_utils_member_test_flag(imember, MFLAG_RECEIVING_VIDEO)) { + if ((imember = conference_member_get(member->conference, rel->id)) && conference_utils_member_test_flag(imember, MFLAG_RECEIVING_VIDEO)) { //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s %d->%d %d\n", name, member->id, imember->id, frame->datalen); switch_core_session_write_video_frame(imember->session, frame, SWITCH_IO_FLAG_NONE, 0); switch_thread_rwlock_unlock(imember->rwlock); @@ -2961,12 +2961,12 @@ switch_status_t conf_video_thread_callback(switch_core_session_t *session, switc if (member) { if (member->id == member->conference->video_floor_holder) { - conf_video_write_frame(member->conference, member, frame); - conf_video_check_recording(member->conference, frame); - } else if (!conf_utils_test_flag(member->conference, CFLAG_VID_FLOOR_LOCK) && member->id == member->conference->last_video_floor_holder) { - conf_member_t *fmember; + conference_video_write_frame(member->conference, member, frame); + conference_video_check_recording(member->conference, frame); + } else if (!conference_utils_test_flag(member->conference, CFLAG_VID_FLOOR_LOCK) && member->id == member->conference->last_video_floor_holder) { + conference_member_t *fmember; - if ((fmember = conf_member_get(member->conference, member->conference->video_floor_holder))) { + if ((fmember = conference_member_get(member->conference, member->conference->video_floor_holder))) { switch_core_session_write_video_frame(fmember->session, frame, SWITCH_IO_FLAG_NONE, 0); switch_thread_rwlock_unlock(fmember->rwlock); } diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index dc40ac872f..92b652bd30 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -48,12 +48,12 @@ SWITCH_STANDARD_APP(conference_function); const char *mod_conference_app_name = "conference"; char *mod_conference_cf_name = "conference.conf"; -conf_globals_t conf_globals = {0}; +conference_globals_t conference_globals = {0}; int EC = 0; char *api_syntax = NULL; -SWITCH_STANDARD_API(conf_api_main){ - return conf_api_main_real(cmd, session, stream); +SWITCH_STANDARD_API(conference_api_main){ + return conference_api_main_real(cmd, session, stream); } /* Return a Distinct ID # */ @@ -61,16 +61,16 @@ uint32_t next_member_id(void) { uint32_t id; - switch_mutex_lock(conf_globals.id_mutex); - id = ++conf_globals.id_pool; - switch_mutex_unlock(conf_globals.id_mutex); + switch_mutex_lock(conference_globals.id_mutex); + id = ++conference_globals.id_pool; + switch_mutex_unlock(conference_globals.id_mutex); return id; } void conference_list(conference_obj_t *conference, switch_stream_handle_t *stream, char *delim) { - conf_member_t *member = NULL; + conference_member_t *member = NULL; switch_assert(conference != NULL); switch_assert(stream != NULL); @@ -85,7 +85,7 @@ void conference_list(conference_obj_t *conference, switch_stream_handle_t *strea char *name; uint32_t count = 0; - if (conf_utils_member_test_flag(member, MFLAG_NOCHANNEL)) { + if (conference_utils_member_test_flag(member, MFLAG_NOCHANNEL)) { continue; } @@ -97,17 +97,17 @@ void conference_list(conference_obj_t *conference, switch_stream_handle_t *strea stream->write_function(stream, "%u%s%s%s%s%s%s%s%s%s", member->id, delim, name, delim, uuid, delim, profile->caller_id_name, delim, profile->caller_id_number, delim); - if (conf_utils_member_test_flag(member, MFLAG_CAN_HEAR)) { + if (conference_utils_member_test_flag(member, MFLAG_CAN_HEAR)) { stream->write_function(stream, "hear"); count++; } - if (conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { + if (conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { stream->write_function(stream, "%s%s", count ? "|" : "", "speak"); count++; } - if (conf_utils_member_test_flag(member, MFLAG_TALKING)) { + if (conference_utils_member_test_flag(member, MFLAG_TALKING)) { stream->write_function(stream, "%s%s", count ? "|" : "", "talking"); count++; } @@ -127,12 +127,12 @@ void conference_list(conference_obj_t *conference, switch_stream_handle_t *strea count++; } - if (conf_utils_member_test_flag(member, MFLAG_MOD)) { + if (conference_utils_member_test_flag(member, MFLAG_MOD)) { stream->write_function(stream, "%s%s", count ? "|" : "", "moderator"); count++; } - if (conf_utils_member_test_flag(member, MFLAG_GHOST)) { + if (conference_utils_member_test_flag(member, MFLAG_GHOST)) { stream->write_function(stream, "%s%s", count ? "|" : "", "ghost"); count++; } @@ -147,12 +147,12 @@ void conference_list(conference_obj_t *conference, switch_stream_handle_t *strea switch_mutex_unlock(conference->member_mutex); } -void conf_send_notify(conference_obj_t *conference, const char *status, const char *call_id, switch_bool_t final) +void conference_send_notify(conference_obj_t *conference, const char *status, const char *call_id, switch_bool_t final) { switch_event_t *event; char *name = NULL, *domain = NULL, *dup_domain = NULL; - if (!conf_utils_test_flag(conference, CFLAG_RFC4579)) { + if (!conference_utils_test_flag(conference, CFLAG_RFC4579)) { return; } @@ -191,10 +191,10 @@ void conf_send_notify(conference_obj_t *conference, const char *status, const ch /* Main monitor thread (1 per distinct conference room) */ -void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) +void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *obj) { conference_obj_t *conference = (conference_obj_t *) obj; - conf_member_t *imember, *omember; + conference_member_t *imember, *omember; uint32_t samples = switch_samples_per_packet(conference->rate, conference->interval); uint32_t bytes = samples * 2 * conference->channels; uint8_t ready = 0, total = 0; @@ -207,7 +207,7 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) int32_t z = 0; int member_score_sum = 0; int divisor = 0; - conf_cdr_node_t *np; + conference_cdr_node_t *np; if (!(divisor = conference->rate / 8000)) { divisor = 1; @@ -223,9 +223,9 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) return NULL; } - switch_mutex_lock(conf_globals.hash_mutex); - conf_globals.threads++; - switch_mutex_unlock(conf_globals.hash_mutex); + switch_mutex_lock(conference_globals.hash_mutex); + conference_globals.threads++; + switch_mutex_unlock(conference_globals.hash_mutex); conference->auto_recording = 0; conference->record_count = 0; @@ -233,11 +233,11 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT); - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "conference-create"); switch_event_fire(&event); - if (conf_utils_test_flag(conference, CFLAG_LIVEARRAY_SYNC)) { + if (conference_utils_test_flag(conference, CFLAG_LIVEARRAY_SYNC)) { char *p; if (strchr(conference->name, '@')) { @@ -253,23 +253,23 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) *p = '\0'; } - switch_live_array_create(conference->la_event_channel, conference->la_name, conf_globals.event_channel_id, &conference->la); + switch_live_array_create(conference->la_event_channel, conference->la_name, conference_globals.event_channel_id, &conference->la); switch_live_array_set_user_data(conference->la, conference); - switch_live_array_set_command_handler(conference->la, conf_event_la_command_handler); + switch_live_array_set_command_handler(conference->la, conference_event_la_command_handler); } - while (conf_globals.running && !conf_utils_test_flag(conference, CFLAG_DESTRUCT)) { + while (conference_globals.running && !conference_utils_test_flag(conference, CFLAG_DESTRUCT)) { switch_size_t file_sample_len = samples; switch_size_t file_data_len = samples * 2 * conference->channels; int has_file_data = 0, members_with_video = 0, members_with_avatar = 0; - uint32_t conf_energy = 0; + uint32_t conference_energy = 0; int nomoh = 0; - conf_member_t *floor_holder; + conference_member_t *floor_holder; /* Sync the conference to a single timing source */ if (switch_core_timer_next(&timer) != SWITCH_STATUS_SUCCESS) { - conf_utils_set_flag(conference, CFLAG_DESTRUCT); + conference_utils_set_flag(conference, CFLAG_DESTRUCT); break; } @@ -284,11 +284,11 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) total++; imember->read = 0; - if (conf_utils_member_test_flag(imember, MFLAG_RUNNING) && imember->session) { + if (conference_utils_member_test_flag(imember, MFLAG_RUNNING) && imember->session) { switch_channel_t *channel = switch_core_session_get_channel(imember->session); if ((!floor_holder || (imember->score_iir > SCORE_IIR_SPEAKING_MAX && (floor_holder->score_iir < SCORE_IIR_SPEAKING_MIN)))) {// && - //(!conf_utils_test_flag(conference, CFLAG_VID_FLOOR) || switch_channel_test_flag(channel, CF_VIDEO))) { + //(!conference_utils_test_flag(conference, CFLAG_VID_FLOOR) || switch_channel_test_flag(channel, CF_VIDEO))) { floor_holder = imember; } @@ -300,18 +300,18 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) members_with_avatar++; } - if (conf_utils_member_test_flag(imember, MFLAG_NOMOH)) { + if (conference_utils_member_test_flag(imember, MFLAG_NOMOH)) { nomoh++; } } - conf_utils_member_clear_flag_locked(imember, MFLAG_HAS_AUDIO); + conference_utils_member_clear_flag_locked(imember, MFLAG_HAS_AUDIO); switch_mutex_lock(imember->audio_in_mutex); if (switch_buffer_inuse(imember->audio_buffer) >= bytes && (buf_read = (uint32_t) switch_buffer_read(imember->audio_buffer, imember->frame, bytes))) { imember->read = buf_read; - conf_utils_member_set_flag_locked(imember, MFLAG_HAS_AUDIO); + conference_utils_member_set_flag_locked(imember, MFLAG_HAS_AUDIO); ready++; } switch_mutex_unlock(imember->audio_in_mutex); @@ -321,13 +321,13 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) conference->members_with_avatar = members_with_avatar; if (floor_holder != conference->floor_holder) { - conf_member_set_floor_holder(conference, floor_holder); + conference_member_set_floor_holder(conference, floor_holder); } if (conference->perpetual_sound && !conference->async_fnode) { conference_file_play(conference, conference->perpetual_sound, CONF_DEFAULT_LEADIN, NULL, 1); } else if (conference->moh_sound && ((nomoh == 0 && conference->count == 1) - || conf_utils_test_flag(conference, CFLAG_WAIT_MOD)) && !conference->async_fnode && !conference->fnode) { + || conference_utils_test_flag(conference, CFLAG_WAIT_MOD)) && !conference->async_fnode && !conference->fnode) { conference_file_play(conference, conference->moh_sound, CONF_DEFAULT_LEADIN, NULL, 1); } @@ -345,7 +345,7 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) } if (is_talking == 0) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Conference has been idle for over %d seconds, terminating\n", conference->terminate_on_silence); - conf_utils_set_flag(conference, CFLAG_DESTRUCT); + conference_utils_set_flag(conference, CFLAG_DESTRUCT); } } @@ -358,7 +358,7 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) switch_channel_t *channel = switch_core_session_get_channel(imember->session); char *rfile = switch_channel_expand_variables(channel, conference->auto_record); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Auto recording file: %s\n", rfile); - conf_record_launch_thread(conference, rfile, SWITCH_TRUE); + conference_record_launch_thread(conference, rfile, SWITCH_TRUE); if (rfile != conference->auto_record) { conference->record_filename = switch_core_strdup(conference->pool, rfile); @@ -396,7 +396,7 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) if (switch_core_speech_read_tts(conference->fnode->sh, file_frame, &speech_len, &flags) == SWITCH_STATUS_SUCCESS) { if (conference->fnode->al) { - conf_al_process(conference->fnode->al, file_frame, speech_len, conference->rate); + conference_al_process(conference->fnode->al, file_frame, speech_len, conference->rate); } file_sample_len = file_data_len / 2 / conference->fnode->sh->channels; @@ -412,7 +412,7 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) conference->fnode->fh.vol); } if (conference->fnode->al) { - conf_al_process(conference->fnode->al, file_frame, file_sample_len * 2, conference->fnode->fh.samplerate); + conference_al_process(conference->fnode->al, file_frame, file_sample_len * 2, conference->fnode->fh.samplerate); } } @@ -432,7 +432,7 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) file_sample_len = samples; switch_core_file_read(&conference->async_fnode->fh, async_file_frame, &file_sample_len); if (conference->async_fnode->al) { - conf_al_process(conference->async_fnode->al, file_frame, file_sample_len * 2, conference->async_fnode->fh.samplerate); + conference_al_process(conference->async_fnode->al, file_frame, file_sample_len * 2, conference->async_fnode->fh.samplerate); } if (file_sample_len <= 0) { conference->async_fnode->done++; @@ -485,12 +485,12 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) for (omember = conference->members; omember; omember = omember->next) { conference->member_loop_count++; - if (!(conf_utils_member_test_flag(omember, MFLAG_RUNNING) && conf_utils_member_test_flag(omember, MFLAG_HAS_AUDIO))) { + if (!(conference_utils_member_test_flag(omember, MFLAG_RUNNING) && conference_utils_member_test_flag(omember, MFLAG_HAS_AUDIO))) { continue; } if (conference->agc_level) { - if (conf_utils_member_test_flag(omember, MFLAG_TALKING) && conf_utils_member_test_flag(omember, MFLAG_CAN_SPEAK)) { + if (conference_utils_member_test_flag(omember, MFLAG_TALKING) && conference_utils_member_test_flag(omember, MFLAG_CAN_SPEAK)) { member_score_sum += omember->score; conference->mux_loop_count++; } @@ -503,15 +503,15 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) } if (conference->agc_level && conference->member_loop_count) { - conf_energy = 0; + conference_energy = 0; for (x = 0; x < bytes / 2; x++) { z = abs(main_frame[x]); switch_normalize_to_16bit(z); - conf_energy += (int16_t) z; + conference_energy += (int16_t) z; } - conference->score = conf_energy / ((bytes / 2) / divisor) / conference->member_loop_count; + conference->score = conference_energy / ((bytes / 2) / divisor) / conference->member_loop_count; conference->avg_tally += conference->score; conference->avg_score = conference->avg_tally / ++conference->avg_itt; if (!conference->avg_itt) conference->avg_tally = conference->score; @@ -525,11 +525,11 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) for (omember = conference->members; omember; omember = omember->next) { switch_size_t ok = 1; - if (!conf_utils_member_test_flag(omember, MFLAG_RUNNING)) { + if (!conference_utils_member_test_flag(omember, MFLAG_RUNNING)) { continue; } - if (!conf_utils_member_test_flag(omember, MFLAG_CAN_HEAR)) { + if (!conference_utils_member_test_flag(omember, MFLAG_CAN_HEAR)) { switch_mutex_lock(omember->audio_out_mutex); memset(write_frame, 255, bytes); ok = switch_buffer_write(omember->mux_buffer, write_frame, bytes); @@ -543,7 +543,7 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) z = main_frame[x]; /* bptr[x] represents my own contribution to this audio sample */ - if (conf_utils_member_test_flag(omember, MFLAG_HAS_AUDIO) && x <= omember->read / 2) { + if (conference_utils_member_test_flag(omember, MFLAG_HAS_AUDIO) && x <= omember->read / 2) { z -= (int32_t) bptr[x]; } @@ -552,7 +552,7 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) */ if (conference->relationship_total) { for (imember = conference->members; imember; imember = imember->next) { - if (imember != omember && conf_utils_member_test_flag(imember, MFLAG_HAS_AUDIO)) { + if (imember != omember && conference_utils_member_test_flag(imember, MFLAG_HAS_AUDIO)) { conference_relationship_t *rel; switch_size_t found = 0; int16_t *rptr = (int16_t *) imember->frame; @@ -602,7 +602,7 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) for (omember = conference->members; omember; omember = omember->next) { switch_size_t ok = 1; - if (!conf_utils_member_test_flag(omember, MFLAG_RUNNING)) { + if (!conference_utils_member_test_flag(omember, MFLAG_RUNNING)) { continue; } @@ -621,7 +621,7 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) switch_memory_pool_t *pool; if (conference->canvas && conference->async_fnode->layer_id > -1 ) { - conf_video_canvas_del_fnode_layer(conference, conference->async_fnode); + conference_video_canvas_del_fnode_layer(conference, conference->async_fnode); } conference_file_close(conference, conference->async_fnode); @@ -635,7 +635,7 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) switch_memory_pool_t *pool; if (conference->canvas && conference->fnode->layer_id > -1 ) { - conf_video_canvas_del_fnode_layer(conference, conference->fnode); + conference_video_canvas_del_fnode_layer(conference, conference->fnode); } if (conference->fnode->type != NODE_TYPE_SPEECH) { @@ -646,7 +646,7 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) conference->fnode = conference->fnode->next; if (conference->fnode) { - conf_video_fnode_check(conference->fnode); + conference_video_fnode_check(conference->fnode); } @@ -655,11 +655,11 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) switch_core_destroy_memory_pool(&pool); } - if (!conference->end_count && conference->endconf_time && - switch_epoch_time_now(NULL) - conference->endconf_time > conference->endconf_grace_time) { + if (!conference->end_count && conference->endconference_time && + switch_epoch_time_now(NULL) - conference->endconference_time > conference->endconference_grace_time) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Conference %s: endconf grace time exceeded (%u)\n", - conference->name, conference->endconf_grace_time); - conf_utils_set_flag(conference, CFLAG_DESTRUCT | CFLAG_ENDCONF_FORCED); + conference->name, conference->endconference_grace_time); + conference_utils_set_flag(conference, CFLAG_DESTRUCT | CFLAG_ENDCONF_FORCED); } switch_mutex_unlock(conference->mutex); @@ -667,7 +667,7 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) /* Rinse ... Repeat */ end: - if (conf_utils_test_flag(conference, CFLAG_OUTCALL)) { + if (conference_utils_test_flag(conference, CFLAG_OUTCALL)) { conference->cancel_cause = SWITCH_CAUSE_ORIGINATOR_CANCEL; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Ending pending outcall channels for Conference: '%s'\n", conference->name); while(conference->originating) { @@ -675,7 +675,7 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) } } - conf_send_presence(conference); + conference_send_presence(conference); switch_mutex_lock(conference->mutex); conference_file_stop(conference, FILE_STOP_ASYNC); @@ -720,13 +720,13 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) for (imember = conference->members; imember; imember = imember->next) { switch_channel_t *channel; - if (!conf_utils_member_test_flag(imember, MFLAG_NOCHANNEL)) { + if (!conference_utils_member_test_flag(imember, MFLAG_NOCHANNEL)) { channel = switch_core_session_get_channel(imember->session); if (!switch_false(switch_channel_get_variable(channel, "hangup_after_conference"))) { /* add this little bit to preserve the bridge cause code in case of an early media call that */ /* never answers */ - if (conf_utils_test_flag(conference, CFLAG_ANSWERED)) { + if (conference_utils_test_flag(conference, CFLAG_ANSWERED)) { switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); } else { /* put actual cause code from outbound channel hangup here */ @@ -735,7 +735,7 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) } } - conf_utils_member_clear_flag_locked(imember, MFLAG_RUNNING); + conference_utils_member_clear_flag_locked(imember, MFLAG_RUNNING); } switch_mutex_unlock(conference->member_mutex); switch_mutex_unlock(conference->mutex); @@ -753,19 +753,19 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) } switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT); - conf_event_add_data(conference, event); + conference_event_add_data(conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "conference-destroy"); switch_event_fire(&event); switch_core_timer_destroy(&timer); - switch_mutex_lock(conf_globals.hash_mutex); - if (conf_utils_test_flag(conference, CFLAG_INHASH)) { - switch_core_hash_delete(conf_globals.conference_hash, conference->name); + switch_mutex_lock(conference_globals.hash_mutex); + if (conference_utils_test_flag(conference, CFLAG_INHASH)) { + switch_core_hash_delete(conference_globals.conference_hash, conference->name); } - switch_mutex_unlock(conf_globals.hash_mutex); + switch_mutex_unlock(conference_globals.hash_mutex); - conf_utils_clear_flag(conference, CFLAG_VIDEO_MUXING); + conference_utils_clear_flag(conference, CFLAG_VIDEO_MUXING); for (x = 0; x <= conference->canvas_count; x++) { if (conference->canvases[x] && conference->canvases[x]->video_muxing_thread) { @@ -776,7 +776,7 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) } /* Wait till everybody is out */ - conf_utils_clear_flag_locked(conference, CFLAG_RUNNING); + conference_utils_clear_flag_locked(conference, CFLAG_RUNNING); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Write Lock ON\n"); switch_thread_rwlock_wrlock(conference->rwlock); switch_thread_rwlock_unlock(conference->rwlock); @@ -793,13 +793,13 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) } conference->end_time = switch_epoch_time_now(NULL); - conf_cdr_render(conference); + conference_cdr_render(conference); - switch_mutex_lock(conf_globals.setup_mutex); + switch_mutex_lock(conference_globals.setup_mutex); if (conference->layout_hash) { switch_core_hash_destroy(&conference->layout_hash); } - switch_mutex_unlock(conf_globals.setup_mutex); + switch_mutex_unlock(conference_globals.setup_mutex); if (conference->layout_group_hash) { switch_core_hash_destroy(&conference->layout_group_hash); @@ -811,9 +811,9 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) switch_core_destroy_memory_pool(&pool); } - switch_mutex_lock(conf_globals.hash_mutex); - conf_globals.threads--; - switch_mutex_unlock(conf_globals.hash_mutex); + switch_mutex_lock(conference_globals.hash_mutex); + conference_globals.threads--; + switch_mutex_unlock(conference_globals.hash_mutex); return NULL; } @@ -821,7 +821,7 @@ void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj) /* Say some thing with TTS in the conference room */ -switch_status_t conf_say(conference_obj_t *conference, const char *text, uint32_t leadin) +switch_status_t conference_say(conference_obj_t *conference, const char *text, uint32_t leadin) { switch_status_t status = SWITCH_STATUS_FALSE; conference_file_node_t *fnode, *nptr; @@ -893,8 +893,8 @@ switch_status_t conf_say(conference_obj_t *conference, const char *text, uint32_ position = NULL; } else { channels = 1; - fnode->al = conf_al_create(pool); - if (conf_al_parse_position(fnode->al, position) != SWITCH_STATUS_SUCCESS) { + fnode->al = conference_al_create(pool); + if (conference_al_parse_position(fnode->al, position) != SWITCH_STATUS_SUCCESS) { fnode->al = NULL; channels = conference->channels; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Position Data.\n"); @@ -961,7 +961,7 @@ switch_status_t conf_say(conference_obj_t *conference, const char *text, uint32_ } -switch_status_t conf_list_conferences(const char *line, const char *cursor, switch_console_callback_match_t **matches) +switch_status_t conference_list_conferences(const char *line, const char *cursor, switch_console_callback_match_t **matches) { switch_console_callback_match_t *my_matches = NULL; switch_status_t status = SWITCH_STATUS_FALSE; @@ -969,12 +969,12 @@ switch_status_t conf_list_conferences(const char *line, const char *cursor, swit void *val; const void *vvar; - switch_mutex_lock(conf_globals.hash_mutex); - for (hi = switch_core_hash_first(conf_globals.conference_hash); hi; hi = switch_core_hash_next(&hi)) { + switch_mutex_lock(conference_globals.hash_mutex); + for (hi = switch_core_hash_first(conference_globals.conference_hash); hi; hi = switch_core_hash_next(&hi)) { switch_core_hash_this(hi, &vvar, NULL, &val); switch_console_push_match(&my_matches, (const char *) vvar); } - switch_mutex_unlock(conf_globals.hash_mutex); + switch_mutex_unlock(conference_globals.hash_mutex); if (my_matches) { *matches = my_matches; @@ -984,9 +984,9 @@ switch_status_t conf_list_conferences(const char *line, const char *cursor, swit return status; } -void conf_list_pretty(conference_obj_t *conference, switch_stream_handle_t *stream) +void conference_list_pretty(conference_obj_t *conference, switch_stream_handle_t *stream) { - conf_member_t *member = NULL; + conference_member_t *member = NULL; switch_assert(conference != NULL); switch_assert(stream != NULL); @@ -997,7 +997,7 @@ void conf_list_pretty(conference_obj_t *conference, switch_stream_handle_t *stre switch_channel_t *channel; switch_caller_profile_t *profile; - if (conf_utils_member_test_flag(member, MFLAG_NOCHANNEL)) { + if (conference_utils_member_test_flag(member, MFLAG_NOCHANNEL)) { continue; } channel = switch_core_session_get_channel(member->session); @@ -1010,7 +1010,7 @@ void conf_list_pretty(conference_obj_t *conference, switch_stream_handle_t *stre } -void conf_list_count_only(conference_obj_t *conference, switch_stream_handle_t *stream) +void conference_list_count_only(conference_obj_t *conference, switch_stream_handle_t *stream) { switch_assert(conference != NULL); switch_assert(stream != NULL); @@ -1043,9 +1043,9 @@ switch_xml_t add_x_tag(switch_xml_t x_member, const char *name, const char *valu return x_tag; } -void conf_xlist(conference_obj_t *conference, switch_xml_t x_conference, int off) +void conference_xlist(conference_obj_t *conference, switch_xml_t x_conference, int off) { - conf_member_t *member = NULL; + conference_member_t *member = NULL; switch_xml_t x_member = NULL, x_members = NULL, x_flags; int moff = 0; char i[30] = ""; @@ -1062,47 +1062,47 @@ void conf_xlist(conference_obj_t *conference, switch_xml_t x_conference, int off switch_xml_set_attr_d(x_conference, "rate", ival); switch_xml_set_attr_d(x_conference, "uuid", conference->uuid_str); - if (conf_utils_test_flag(conference, CFLAG_LOCKED)) { + if (conference_utils_test_flag(conference, CFLAG_LOCKED)) { switch_xml_set_attr_d(x_conference, "locked", "true"); } - if (conf_utils_test_flag(conference, CFLAG_DESTRUCT)) { + if (conference_utils_test_flag(conference, CFLAG_DESTRUCT)) { switch_xml_set_attr_d(x_conference, "destruct", "true"); } - if (conf_utils_test_flag(conference, CFLAG_WAIT_MOD)) { + if (conference_utils_test_flag(conference, CFLAG_WAIT_MOD)) { switch_xml_set_attr_d(x_conference, "wait_mod", "true"); } - if (conf_utils_test_flag(conference, CFLAG_AUDIO_ALWAYS)) { + if (conference_utils_test_flag(conference, CFLAG_AUDIO_ALWAYS)) { switch_xml_set_attr_d(x_conference, "audio_always", "true"); } - if (conf_utils_test_flag(conference, CFLAG_RUNNING)) { + if (conference_utils_test_flag(conference, CFLAG_RUNNING)) { switch_xml_set_attr_d(x_conference, "running", "true"); } - if (conf_utils_test_flag(conference, CFLAG_ANSWERED)) { + if (conference_utils_test_flag(conference, CFLAG_ANSWERED)) { switch_xml_set_attr_d(x_conference, "answered", "true"); } - if (conf_utils_test_flag(conference, CFLAG_ENFORCE_MIN)) { + if (conference_utils_test_flag(conference, CFLAG_ENFORCE_MIN)) { switch_xml_set_attr_d(x_conference, "enforce_min", "true"); } - if (conf_utils_test_flag(conference, CFLAG_BRIDGE_TO)) { + if (conference_utils_test_flag(conference, CFLAG_BRIDGE_TO)) { switch_xml_set_attr_d(x_conference, "bridge_to", "true"); } - if (conf_utils_test_flag(conference, CFLAG_DYNAMIC)) { + if (conference_utils_test_flag(conference, CFLAG_DYNAMIC)) { switch_xml_set_attr_d(x_conference, "dynamic", "true"); } - if (conf_utils_test_flag(conference, CFLAG_EXIT_SOUND)) { + if (conference_utils_test_flag(conference, CFLAG_EXIT_SOUND)) { switch_xml_set_attr_d(x_conference, "exit_sound", "true"); } - if (conf_utils_test_flag(conference, CFLAG_ENTER_SOUND)) { + if (conference_utils_test_flag(conference, CFLAG_ENTER_SOUND)) { switch_xml_set_attr_d(x_conference, "enter_sound", "true"); } @@ -1115,16 +1115,16 @@ void conf_xlist(conference_obj_t *conference, switch_xml_t x_conference, int off switch_xml_set_attr_d(x_conference, "recording", "true"); } - if (conference->endconf_grace_time > 0) { - switch_snprintf(i, sizeof(i), "%u", conference->endconf_grace_time); - switch_xml_set_attr_d(x_conference, "endconf_grace_time", ival); + if (conference->endconference_grace_time > 0) { + switch_snprintf(i, sizeof(i), "%u", conference->endconference_grace_time); + switch_xml_set_attr_d(x_conference, "endconference_grace_time", ival); } - if (conf_utils_test_flag(conference, CFLAG_VID_FLOOR)) { + if (conference_utils_test_flag(conference, CFLAG_VID_FLOOR)) { switch_xml_set_attr_d(x_conference, "video_floor_only", "true"); } - if (conf_utils_test_flag(conference, CFLAG_RFC4579)) { + if (conference_utils_test_flag(conference, CFLAG_RFC4579)) { switch_xml_set_attr_d(x_conference, "video_rfc4579", "true"); } @@ -1152,7 +1152,7 @@ void conf_xlist(conference_obj_t *conference, switch_xml_t x_conference, int off int toff = 0; char tmp[50] = ""; - if (conf_utils_member_test_flag(member, MFLAG_NOCHANNEL)) { + if (conference_utils_member_test_flag(member, MFLAG_NOCHANNEL)) { if (member->rec_path) { x_member = switch_xml_add_child_d(x_members, "member", moff++); switch_assert(x_member); @@ -1162,7 +1162,7 @@ void conf_xlist(conference_obj_t *conference, switch_xml_t x_conference, int off */ x_tag = switch_xml_add_child_d(x_member, "record_path", count++); - if (conf_utils_member_test_flag(member, MFLAG_PAUSE_RECORDING)) { + if (conference_utils_member_test_flag(member, MFLAG_PAUSE_RECORDING)) { switch_xml_set_attr_d(x_tag, "status", "paused"); } switch_xml_set_txt_d(x_tag, member->rec_path); @@ -1212,34 +1212,34 @@ void conf_xlist(conference_obj_t *conference, switch_xml_t x_conference, int off switch_assert(x_flags); x_tag = switch_xml_add_child_d(x_flags, "can_hear", count++); - switch_xml_set_txt_d(x_tag, conf_utils_member_test_flag(member, MFLAG_CAN_HEAR) ? "true" : "false"); + switch_xml_set_txt_d(x_tag, conference_utils_member_test_flag(member, MFLAG_CAN_HEAR) ? "true" : "false"); x_tag = switch_xml_add_child_d(x_flags, "can_speak", count++); - switch_xml_set_txt_d(x_tag, conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK) ? "true" : "false"); + switch_xml_set_txt_d(x_tag, conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) ? "true" : "false"); x_tag = switch_xml_add_child_d(x_flags, "mute_detect", count++); - switch_xml_set_txt_d(x_tag, conf_utils_member_test_flag(member, MFLAG_MUTE_DETECT) ? "true" : "false"); + switch_xml_set_txt_d(x_tag, conference_utils_member_test_flag(member, MFLAG_MUTE_DETECT) ? "true" : "false"); x_tag = switch_xml_add_child_d(x_flags, "talking", count++); - switch_xml_set_txt_d(x_tag, conf_utils_member_test_flag(member, MFLAG_TALKING) ? "true" : "false"); + switch_xml_set_txt_d(x_tag, conference_utils_member_test_flag(member, MFLAG_TALKING) ? "true" : "false"); x_tag = switch_xml_add_child_d(x_flags, "has_video", count++); switch_xml_set_txt_d(x_tag, switch_channel_test_flag(switch_core_session_get_channel(member->session), CF_VIDEO) ? "true" : "false"); x_tag = switch_xml_add_child_d(x_flags, "video_bridge", count++); - switch_xml_set_txt_d(x_tag, conf_utils_member_test_flag(member, MFLAG_VIDEO_BRIDGE) ? "true" : "false"); + switch_xml_set_txt_d(x_tag, conference_utils_member_test_flag(member, MFLAG_VIDEO_BRIDGE) ? "true" : "false"); x_tag = switch_xml_add_child_d(x_flags, "has_floor", count++); switch_xml_set_txt_d(x_tag, (member == member->conference->floor_holder) ? "true" : "false"); x_tag = switch_xml_add_child_d(x_flags, "is_moderator", count++); - switch_xml_set_txt_d(x_tag, conf_utils_member_test_flag(member, MFLAG_MOD) ? "true" : "false"); + switch_xml_set_txt_d(x_tag, conference_utils_member_test_flag(member, MFLAG_MOD) ? "true" : "false"); x_tag = switch_xml_add_child_d(x_flags, "end_conference", count++); - switch_xml_set_txt_d(x_tag, conf_utils_member_test_flag(member, MFLAG_ENDCONF) ? "true" : "false"); + switch_xml_set_txt_d(x_tag, conference_utils_member_test_flag(member, MFLAG_ENDCONF) ? "true" : "false"); x_tag = switch_xml_add_child_d(x_flags, "is_ghost", count++); - switch_xml_set_txt_d(x_tag, conf_utils_member_test_flag(member, MFLAG_GHOST) ? "true" : "false"); + switch_xml_set_txt_d(x_tag, conference_utils_member_test_flag(member, MFLAG_GHOST) ? "true" : "false"); switch_snprintf(tmp, sizeof(tmp), "%d", member->volume_out_level); add_x_tag(x_member, "output-volume", tmp, toff++); @@ -1255,7 +1255,7 @@ void conf_xlist(conference_obj_t *conference, switch_xml_t x_conference, int off switch_mutex_unlock(conference->member_mutex); } -void conf_fnode_toggle_pause(conference_file_node_t *fnode, switch_stream_handle_t *stream) +void conference_fnode_toggle_pause(conference_file_node_t *fnode, switch_stream_handle_t *stream) { if (fnode) { if (switch_test_flag(fnode, NFLAG_PAUSE)) { @@ -1269,7 +1269,7 @@ void conf_fnode_toggle_pause(conference_file_node_t *fnode, switch_stream_handle } -void conf_fnode_seek(conference_file_node_t *fnode, switch_stream_handle_t *stream, char *arg) +void conference_fnode_seek(conference_file_node_t *fnode, switch_stream_handle_t *stream, char *arg) { if (fnode && fnode->type == NODE_TYPE_FILE) { unsigned int samps = 0; @@ -1302,7 +1302,7 @@ void conf_fnode_seek(conference_file_node_t *fnode, switch_stream_handle_t *stre /* generate an outbound call from the conference */ -switch_status_t conf_outcall(conference_obj_t *conference, +switch_status_t conference_outcall(conference_obj_t *conference, char *conference_name, switch_core_session_t *session, char *bridgeto, uint32_t timeout, @@ -1370,7 +1370,7 @@ switch_status_t conf_outcall(conference_obj_t *conference, switch_mutex_unlock(conference->mutex); if (track) { - conf_send_notify(conference, "SIP/2.0 100 Trying\r\n", call_id, SWITCH_FALSE); + conference_send_notify(conference, "SIP/2.0 100 Trying\r\n", call_id, SWITCH_FALSE); } @@ -1387,21 +1387,21 @@ switch_status_t conf_outcall(conference_obj_t *conference, } if (track) { - conf_send_notify(conference, "SIP/2.0 481 Failure\r\n", call_id, SWITCH_TRUE); + conference_send_notify(conference, "SIP/2.0 481 Failure\r\n", call_id, SWITCH_TRUE); } goto done; } if (track) { - conf_send_notify(conference, "SIP/2.0 200 OK\r\n", call_id, SWITCH_TRUE); + conference_send_notify(conference, "SIP/2.0 200 OK\r\n", call_id, SWITCH_TRUE); } rdlock = 1; peer_channel = switch_core_session_get_channel(peer_session); /* make sure the conference still exists */ - if (!conf_utils_test_flag(conference, CFLAG_RUNNING)) { + if (!conference_utils_test_flag(conference, CFLAG_RUNNING)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Conference is gone now, nevermind..\n"); if (caller_channel) { switch_channel_hangup(caller_channel, SWITCH_CAUSE_NO_ROUTE_DESTINATION); @@ -1463,7 +1463,7 @@ switch_status_t conf_outcall(conference_obj_t *conference, return status; } -void *SWITCH_THREAD_FUNC conf_outcall_run(switch_thread_t *thread, void *obj) +void *SWITCH_THREAD_FUNC conference_outcall_run(switch_thread_t *thread, void *obj) { struct bg_call *call = (struct bg_call *) obj; @@ -1472,13 +1472,13 @@ void *SWITCH_THREAD_FUNC conf_outcall_run(switch_thread_t *thread, void *obj) switch_event_t *event; - conf_outcall(call->conference, call->conference_name, + conference_outcall(call->conference, call->conference_name, call->session, call->bridgeto, call->timeout, call->flags, call->cid_name, call->cid_num, call->profile, &cause, call->cancel_cause, call->var_event); if (call->conference && test_eflag(call->conference, EFLAG_BGDIAL_RESULT) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { - conf_event_add_data(call->conference, event); + conference_event_add_data(call->conference, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "bgdial-result"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Result", switch_channel_cause2str(cause)); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Job-UUID", call->uuid); @@ -1505,7 +1505,7 @@ void *SWITCH_THREAD_FUNC conf_outcall_run(switch_thread_t *thread, void *obj) return NULL; } -switch_status_t conf_outcall_bg(conference_obj_t *conference, +switch_status_t conference_outcall_bg(conference_obj_t *conference, char *conference_name, switch_core_session_t *session, char *bridgeto, uint32_t timeout, const char *flags, const char *cid_name, const char *cid_num, const char *call_uuid, const char *profile, switch_call_cause_t *cancel_cause, switch_event_t **var_event) @@ -1564,7 +1564,7 @@ switch_status_t conf_outcall_bg(conference_obj_t *conference, switch_threadattr_create(&thd_attr, pool); switch_threadattr_detach_set(thd_attr, 1); switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&thread, thd_attr, conf_outcall_run, call, pool); + switch_thread_create(&thread, thd_attr, conference_outcall_run, call, pool); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Launching BG Thread for outcall\n"); return SWITCH_STATUS_SUCCESS; @@ -1572,7 +1572,7 @@ switch_status_t conf_outcall_bg(conference_obj_t *conference, -SWITCH_STANDARD_APP(conf_auto_function) +SWITCH_STANDARD_APP(conference_auto_function) { switch_channel_t *channel = switch_core_session_get_channel(session); call_list_t *call_list, *np; @@ -1603,11 +1603,11 @@ SWITCH_STANDARD_APP(conference_function) { switch_codec_t *read_codec = NULL; //uint32_t flags = 0; - conf_member_t member = { 0 }; + conference_member_t member = { 0 }; conference_obj_t *conference = NULL; switch_channel_t *channel = switch_core_session_get_channel(session); char *mydata = NULL; - char *conf_name = NULL; + char *conference_name = NULL; char *bridge_prefix = "bridge:"; char *flags_prefix = "+flags{"; char *bridgeto = NULL; @@ -1620,15 +1620,15 @@ SWITCH_STANDARD_APP(conference_function) uint8_t rl = 0, isbr = 0; char *dpin = ""; const char *mdpin = ""; - conf_xml_cfg_t xml_cfg = { 0 }; + conference_xml_cfg_t xml_cfg = { 0 }; switch_event_t *params = NULL; int locked = 0; int mpin_matched = 0; uint32_t *mid; - if (!switch_channel_test_app_flag_key("conf_silent", channel, CONF_SILENT_DONE) && + if (!switch_channel_test_app_flag_key("conference_silent", channel, CONF_SILENT_DONE) && (switch_channel_test_flag(channel, CF_RECOVERED) || switch_true(switch_channel_get_variable(channel, "conference_silent_entry")))) { - switch_channel_set_app_flag_key("conf_silent", channel, CONF_SILENT_REQ); + switch_channel_set_app_flag_key("conference_silent", channel, CONF_SILENT_REQ); } switch_core_session_video_reset(session); @@ -1668,8 +1668,8 @@ SWITCH_STANDARD_APP(conference_function) } } - //if ((v_flags_str = switch_channel_get_variable(channel, "conf_member_flags"))) { - if ((v_flags_str = conf_utils_combine_flag_var(session, "conf_member_flags"))) { + //if ((v_flags_str = switch_channel_get_variable(channel, "conference_member_flags"))) { + if ((v_flags_str = conference_utils_combine_flag_var(session, "conference_member_flags"))) { if (zstr(flags_str)) { flags_str = v_flags_str; } else { @@ -1680,7 +1680,7 @@ SWITCH_STANDARD_APP(conference_function) cflags_str = flags_str; //if ((v_cflags_str = switch_channel_get_variable(channel, "conference_flags"))) { - if ((v_cflags_str = conf_utils_combine_flag_var(session, "conference_flags"))) { + if ((v_cflags_str = conference_utils_combine_flag_var(session, "conference_flags"))) { if (zstr(cflags_str)) { cflags_str = v_cflags_str; } else { @@ -1700,20 +1700,20 @@ SWITCH_STANDARD_APP(conference_function) } } - conf_name = mydata; + conference_name = mydata; /* eat all leading spaces on conference name, which can cause problems */ - while (*conf_name == ' ') { - conf_name++; + while (*conference_name == ' ') { + conference_name++; } /* is there a conference pin ? */ - if ((dpin = strchr(conf_name, '+'))) { + if ((dpin = strchr(conference_name, '+'))) { *dpin++ = '\0'; } else dpin = ""; /* is there profile specification ? */ - if ((profile_name = strrchr(conf_name, '@'))) { + if ((profile_name = strrchr(conference_name, '@'))) { *profile_name++ = '\0'; } else { profile_name = "default"; @@ -1731,13 +1731,13 @@ SWITCH_STANDARD_APP(conference_function) const char *check = switch_channel_get_variable(channel, "last_transfered_conference"); if (!zstr(check)) { - conf_name = (char *) check; + conference_name = (char *) check; } } switch_event_create(¶ms, SWITCH_EVENT_COMMAND); switch_assert(params); - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "conf_name", conf_name); + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "conference_name", conference_name); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "profile_name", profile_name); /* Open the config from the xml registry */ @@ -1754,34 +1754,34 @@ SWITCH_STANDARD_APP(conference_function) /* conference object, and skip pin handling, and locked checking */ if (!locked) { - switch_mutex_lock(conf_globals.setup_mutex); + switch_mutex_lock(conference_globals.setup_mutex); locked = 1; } if (isbr) { char *uuid = switch_core_session_get_uuid(session); - if (!strcmp(conf_name, "_uuid_")) { - conf_name = uuid; + if (!strcmp(conference_name, "_uuid_")) { + conference_name = uuid; } - if ((conference = conf_find(conf_name, NULL))) { + if ((conference = conference_find(conference_name, NULL))) { switch_thread_rwlock_unlock(conference->rwlock); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Conference %s already exists!\n", conf_name); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Conference %s already exists!\n", conference_name); goto done; } /* Create the conference object. */ - conference = conf_new(conf_name, xml_cfg, session, NULL); + conference = conference_new(conference_name, xml_cfg, session, NULL); if (!conference) { goto done; } - conf_utils_set_cflags(cflags_str, conference->flags); + conference_utils_set_cflags(cflags_str, conference->flags); if (locked) { - switch_mutex_unlock(conf_globals.setup_mutex); + switch_mutex_unlock(conference_globals.setup_mutex); locked = 0; } @@ -1791,13 +1791,13 @@ SWITCH_STANDARD_APP(conference_function) conference->min = 2; /* Indicate the conference is dynamic */ - conf_utils_set_flag_locked(conference, CFLAG_DYNAMIC); + conference_utils_set_flag_locked(conference, CFLAG_DYNAMIC); /* Indicate the conference has a bridgeto party */ - conf_utils_set_flag_locked(conference, CFLAG_BRIDGE_TO); + conference_utils_set_flag_locked(conference, CFLAG_BRIDGE_TO); /* Start the conference thread for this conference */ - conf_launch_thread(conference); + conference_launch_thread(conference); } else { int enforce_security = switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_INBOUND; @@ -1807,9 +1807,9 @@ SWITCH_STANDARD_APP(conference_function) enforce_security = switch_true(pvar); } - if ((conference = conf_find(conf_name, NULL))) { + if ((conference = conference_find(conference_name, NULL))) { if (locked) { - switch_mutex_unlock(conf_globals.setup_mutex); + switch_mutex_unlock(conference_globals.setup_mutex); locked = 0; } } @@ -1817,12 +1817,12 @@ SWITCH_STANDARD_APP(conference_function) /* if the conference exists, get the pointer to it */ if (!conference) { const char *max_members_str; - const char *endconf_grace_time_str; + const char *endconference_grace_time_str; const char *auto_record_str; /* no conference yet, so check for join-only flag */ if (flags_str) { - conf_utils_set_mflags(flags_str, mflags); + conference_utils_set_mflags(flags_str, mflags); if (!(mflags[MFLAG_CAN_SPEAK])) { if (!(mflags[MFLAG_MUTE_DETECT])) { @@ -1837,7 +1837,7 @@ SWITCH_STANDARD_APP(conference_function) /* send event */ switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT); switch_channel_event_set_basic_data(channel, event); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Conference-Name", conf_name); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Conference-Name", conference_name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Conference-Profile-Name", profile_name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "rejected-join-only"); switch_event_fire(&event); @@ -1856,16 +1856,16 @@ SWITCH_STANDARD_APP(conference_function) } /* couldn't find the conference, create one */ - conference = conf_new(conf_name, xml_cfg, session, NULL); + conference = conference_new(conference_name, xml_cfg, session, NULL); if (!conference) { goto done; } - conf_utils_set_cflags(cflags_str, conference->flags); + conference_utils_set_cflags(cflags_str, conference->flags); if (locked) { - switch_mutex_unlock(conf_globals.setup_mutex); + switch_mutex_unlock(conference_globals.setup_mutex); locked = 0; } @@ -1904,23 +1904,23 @@ SWITCH_STANDARD_APP(conference_function) } } - /* check for variable to override endconf_grace_time profile value */ - if (!zstr(endconf_grace_time_str = switch_channel_get_variable(channel, "conference_endconf_grace_time"))) { + /* check for variable to override endconference_grace_time profile value */ + if (!zstr(endconference_grace_time_str = switch_channel_get_variable(channel, "conference_endconference_grace_time"))) { uint32_t grace_time_val; errno = 0; /* sanity first */ - grace_time_val = strtol(endconf_grace_time_str, NULL, 0); /* base 0 lets 0x... for hex 0... for octal and base 10 otherwise through */ + grace_time_val = strtol(endconference_grace_time_str, NULL, 0); /* base 0 lets 0x... for hex 0... for octal and base 10 otherwise through */ if (errno == ERANGE || errno == EINVAL || (int32_t) grace_time_val < 0) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, - "conference_endconf_grace_time variable %s is invalid, not setting a time limit\n", endconf_grace_time_str); + "conference_endconference_grace_time variable %s is invalid, not setting a time limit\n", endconference_grace_time_str); } else { - conference->endconf_grace_time = grace_time_val; + conference->endconference_grace_time = grace_time_val; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, - "conference endconf_grace_time set from variable to %d\n", grace_time_val); + "conference endconference_grace_time set from variable to %d\n", grace_time_val); } } /* Indicate the conference is dynamic */ - conf_utils_set_flag_locked(conference, CFLAG_DYNAMIC); + conference_utils_set_flag_locked(conference, CFLAG_DYNAMIC); /* acquire a read lock on the thread so it can't leave without us */ if (switch_thread_rwlock_tryrdlock(conference->rwlock) != SWITCH_STATUS_SUCCESS) { @@ -1931,7 +1931,7 @@ SWITCH_STANDARD_APP(conference_function) rl++; /* Start the conference thread for this conference */ - conf_launch_thread(conference); + conference_launch_thread(conference); } else { /* setup user variable */ switch_channel_set_variable(channel, "conference_name", conference->name); rl++; @@ -2037,19 +2037,19 @@ SWITCH_STANDARD_APP(conference_function) } if (!pin_valid) { - conf_cdr_rejected(conference, channel, CDRR_PIN); + conference_cdr_rejected(conference, channel, CDRR_PIN); goto done; } } - if (conference->special_announce && !switch_channel_test_app_flag_key("conf_silent", channel, CONF_SILENT_REQ)) { + if (conference->special_announce && !switch_channel_test_app_flag_key("conference_silent", channel, CONF_SILENT_REQ)) { conference_file_local_play(conference, session, conference->special_announce, CONF_DEFAULT_LEADIN, NULL, 0); } /* don't allow more callers if the conference is locked, unless we invited them */ - if (conf_utils_test_flag(conference, CFLAG_LOCKED) && enforce_security) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Conference %s is locked.\n", conf_name); - conf_cdr_rejected(conference, channel, CDRR_LOCKED); + if (conference_utils_test_flag(conference, CFLAG_LOCKED) && enforce_security) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Conference %s is locked.\n", conference_name); + conference_cdr_rejected(conference, channel, CDRR_LOCKED); if (conference->locked_sound) { /* Answer the channel */ switch_channel_answer(channel); @@ -2063,8 +2063,8 @@ SWITCH_STANDARD_APP(conference_function) * max_members limit */ if ((conference->max_members > 0) && (conference->count >= conference->max_members)) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Conference %s is full.\n", conf_name); - conf_cdr_rejected(conference, channel, CDRR_MAXMEMBERS); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Conference %s is full.\n", conference_name); + conference_cdr_rejected(conference, channel, CDRR_MAXMEMBERS); if (conference->maxmember_sound) { /* Answer the channel */ switch_channel_answer(channel); @@ -2084,14 +2084,14 @@ SWITCH_STANDARD_APP(conference_function) /* if we're using "bridge:" make an outbound call and bridge it in */ if (!zstr(bridgeto) && strcasecmp(bridgeto, "none")) { switch_call_cause_t cause; - if (conf_outcall(conference, NULL, session, bridgeto, 60, NULL, NULL, NULL, NULL, &cause, NULL, NULL) != SWITCH_STATUS_SUCCESS) { + if (conference_outcall(conference, NULL, session, bridgeto, 60, NULL, NULL, NULL, NULL, &cause, NULL, NULL) != SWITCH_STATUS_SUCCESS) { goto done; } } else { /* if we're not using "bridge:" set the conference answered flag */ /* and this isn't an outbound channel, answer the call */ if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_INBOUND) - conf_utils_set_flag(conference, CFLAG_ANSWERED); + conference_utils_set_flag(conference, CFLAG_ANSWERED); } member.session = session; @@ -2107,7 +2107,7 @@ SWITCH_STANDARD_APP(conference_function) switch_mutex_init(&member.audio_out_mutex, SWITCH_MUTEX_NESTED, member.pool); switch_thread_rwlock_create(&member.rwlock, member.pool); - if (conf_member_setup_media(&member, conference)) { + if (conference_member_setup_media(&member, conference)) { //flags = 0; goto done; } @@ -2119,7 +2119,7 @@ SWITCH_STANDARD_APP(conference_function) switch_channel_set_private(channel, "__confmid", mid); } - switch_channel_set_variable_printf(channel, "conf_member_id", "%u", *mid); + switch_channel_set_variable_printf(channel, "conference_member_id", "%u", *mid); member.id = *mid; @@ -2129,7 +2129,7 @@ SWITCH_STANDARD_APP(conference_function) memcpy(mflags, conference->mflags, sizeof(mflags)); - conf_utils_set_mflags(flags_str, mflags); + conference_utils_set_mflags(flags_str, mflags); mflags[MFLAG_RUNNING] = 1; if (!(mflags[MFLAG_CAN_SPEAK])) { @@ -2142,7 +2142,7 @@ SWITCH_STANDARD_APP(conference_function) mflags[MFLAG_MOD] = 1; } - conf_utils_merge_mflags(member.flags, mflags); + conference_utils_merge_mflags(member.flags, mflags); if (mflags[MFLAG_MINTWO]) { @@ -2150,20 +2150,20 @@ SWITCH_STANDARD_APP(conference_function) } - if (conference->conf_video_mode == CONF_VIDEO_MODE_MUX) { + if (conference->conference_video_mode == CONF_VIDEO_MODE_MUX) { switch_queue_create(&member.video_queue, 200, member.pool); switch_queue_create(&member.mux_out_queue, 200, member.pool); switch_frame_buffer_create(&member.fb); } /* Add the caller to the conference */ - if (conf_member_add(conference, &member) != SWITCH_STATUS_SUCCESS) { + if (conference_member_add(conference, &member) != SWITCH_STATUS_SUCCESS) { switch_core_codec_destroy(&member.read_codec); goto done; } - if (conference->conf_video_mode == CONF_VIDEO_MODE_MUX) { - conf_video_launch_muxing_write_thread(&member); + if (conference->conference_video_mode == CONF_VIDEO_MODE_MUX) { + conference_video_launch_muxing_write_thread(&member); } msg.from = __FILE__; @@ -2172,23 +2172,23 @@ SWITCH_STANDARD_APP(conference_function) msg.message_id = SWITCH_MESSAGE_INDICATE_BRIDGE; switch_core_session_receive_message(session, &msg); - if (conf_utils_test_flag(conference, CFLAG_TRANSCODE_VIDEO)) { + if (conference_utils_test_flag(conference, CFLAG_TRANSCODE_VIDEO)) { switch_channel_set_flag(channel, CF_VIDEO_DECODED_READ); switch_core_media_gen_key_frame(session); } /* Chime in the core video thread */ - switch_core_session_set_video_read_callback(session, conf_video_thread_callback, (void *)&member); + switch_core_session_set_video_read_callback(session, conference_video_thread_callback, (void *)&member); if (switch_channel_test_flag(channel, CF_VIDEO_ONLY)) { - while(conf_utils_member_test_flag((&member), MFLAG_RUNNING) && switch_channel_ready(channel)) { + while(conference_utils_member_test_flag((&member), MFLAG_RUNNING) && switch_channel_ready(channel)) { switch_yield(100000); } } else { /* Run the conference loop */ do { - conf_loop_output(&member); + conference_loop_output(&member); } while (member.loop_loop); } @@ -2201,7 +2201,7 @@ SWITCH_STANDARD_APP(conference_function) switch_core_session_receive_message(session, &msg); /* Remove the caller from the conference */ - conf_member_del(member.conference, &member); + conference_member_del(member.conference, &member); /* Put the original codec back */ switch_core_session_set_read_codec(member.session, NULL); @@ -2219,7 +2219,7 @@ SWITCH_STANDARD_APP(conference_function) if (locked) { - switch_mutex_unlock(conf_globals.setup_mutex); + switch_mutex_unlock(conference_globals.setup_mutex); } if (member.read_resampler) { @@ -2237,8 +2237,8 @@ SWITCH_STANDARD_APP(conference_function) if (conference) { switch_mutex_lock(conference->mutex); - if (conf_utils_test_flag(conference, CFLAG_DYNAMIC) && conference->count == 0) { - conf_utils_set_flag_locked(conference, CFLAG_DESTRUCT); + if (conference_utils_test_flag(conference, CFLAG_DYNAMIC) && conference->count == 0) { + conference_utils_set_flag_locked(conference, CFLAG_DESTRUCT); } switch_mutex_unlock(conference->mutex); } @@ -2248,7 +2248,7 @@ SWITCH_STANDARD_APP(conference_function) switch_xml_free(cxml); } - if (conference && conf_utils_member_test_flag(&member, MFLAG_KICKED) && conference->kicked_sound) { + if (conference && conference_utils_member_test_flag(&member, MFLAG_KICKED) && conference->kicked_sound) { char *toplay = NULL; char *dfile = NULL; char *expanded = NULL; @@ -2298,30 +2298,30 @@ SWITCH_STANDARD_APP(conference_function) /* Create a thread for the conference and launch it */ -void conf_launch_thread(conference_obj_t *conference) +void conference_launch_thread(conference_obj_t *conference) { switch_thread_t *thread; switch_threadattr_t *thd_attr = NULL; - conf_utils_set_flag_locked(conference, CFLAG_RUNNING); + conference_utils_set_flag_locked(conference, CFLAG_RUNNING); switch_threadattr_create(&thd_attr, conference->pool); switch_threadattr_detach_set(thd_attr, 1); switch_threadattr_priority_set(thd_attr, SWITCH_PRI_REALTIME); switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_mutex_lock(conf_globals.hash_mutex); - switch_mutex_unlock(conf_globals.hash_mutex); - switch_thread_create(&thread, thd_attr, conf_thread_run, conference, conference->pool); + switch_mutex_lock(conference_globals.hash_mutex); + switch_mutex_unlock(conference_globals.hash_mutex); + switch_thread_create(&thread, thd_attr, conference_thread_run, conference, conference->pool); } -conference_obj_t *conf_find(char *name, char *domain) +conference_obj_t *conference_find(char *name, char *domain) { conference_obj_t *conference; - switch_mutex_lock(conf_globals.hash_mutex); - if ((conference = switch_core_hash_find(conf_globals.conference_hash, name))) { - if (conf_utils_test_flag(conference, CFLAG_DESTRUCT)) { - switch_core_hash_delete(conf_globals.conference_hash, conference->name); - conf_utils_clear_flag(conference, CFLAG_INHASH); + switch_mutex_lock(conference_globals.hash_mutex); + if ((conference = switch_core_hash_find(conference_globals.conference_hash, name))) { + if (conference_utils_test_flag(conference, CFLAG_DESTRUCT)) { + switch_core_hash_delete(conference_globals.conference_hash, conference->name); + conference_utils_clear_flag(conference, CFLAG_INHASH); conference = NULL; } else if (!zstr(domain) && conference->domain && strcasecmp(domain, conference->domain)) { conference = NULL; @@ -2333,13 +2333,13 @@ conference_obj_t *conf_find(char *name, char *domain) conference = NULL; } } - switch_mutex_unlock(conf_globals.hash_mutex); + switch_mutex_unlock(conference_globals.hash_mutex); return conference; } /* create a new conferene with a specific profile */ -conference_obj_t *conf_new(char *name, conf_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) { conference_obj_t *conference; switch_xml_t xml_kvp; @@ -2384,7 +2384,7 @@ conference_obj_t *conf_new(char *name, conf_xml_cfg_t cfg, switch_core_session_t char *video_letterbox_bgcolor = NULL; char *video_codec_bandwidth = NULL; char *no_video_avatar = NULL; - conf_video_mode_t conf_video_mode = CONF_VIDEO_MODE_PASSTHROUGH; + conference_video_mode_t conference_video_mode = CONF_VIDEO_MODE_PASSTHROUGH; float fps = 15.0f; uint32_t max_members = 0; uint32_t announce_count = 0; @@ -2406,7 +2406,7 @@ conference_obj_t *conf_new(char *name, conf_xml_cfg_t cfg, switch_core_session_t char *conference_log_dir = NULL; char *cdr_event_mode = NULL; char *terminate_on_silence = NULL; - char *endconf_grace_time = NULL; + char *endconference_grace_time = NULL; char uuid_str[SWITCH_UUID_FORMATTED_LENGTH+1]; switch_uuid_t uuid; switch_codec_implementation_t read_impl = { 0 }; @@ -2465,7 +2465,7 @@ conference_obj_t *conf_new(char *name, conf_xml_cfg_t cfg, switch_core_session_t } } - switch_mutex_lock(conf_globals.hash_mutex); + switch_mutex_lock(conference_globals.hash_mutex); /* parse the profile tree for param values */ if (cfg.profile) @@ -2683,14 +2683,14 @@ conference_obj_t *conf_new(char *name, conf_xml_cfg_t cfg, switch_core_session_t } else if (!strcasecmp(var, "terminate-on-silence") && !zstr(val)) { terminate_on_silence = val; } else if (!strcasecmp(var, "endconf-grace-time") && !zstr(val)) { - endconf_grace_time = val; + endconference_grace_time = val; } else if (!strcasecmp(var, "video-mode") && !zstr(val)) { if (!strcasecmp(val, "passthrough")) { - conf_video_mode = CONF_VIDEO_MODE_PASSTHROUGH; + conference_video_mode = CONF_VIDEO_MODE_PASSTHROUGH; } else if (!strcasecmp(val, "transcode")) { - conf_video_mode = CONF_VIDEO_MODE_TRANSCODE; + conference_video_mode = CONF_VIDEO_MODE_TRANSCODE; } else if (!strcasecmp(val, "mux")) { - conf_video_mode = CONF_VIDEO_MODE_MUX; + conference_video_mode = CONF_VIDEO_MODE_MUX; } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "video-mode invalid, valid settings are 'passthrough', 'transcode' and 'mux'\n"); } @@ -2754,14 +2754,14 @@ conference_obj_t *conf_new(char *name, conf_xml_cfg_t cfg, switch_core_session_t conference->broadcast_chat_messages = broadcast_chat_messages; - conference->conf_video_mode = conf_video_mode; + conference->conference_video_mode = conference_video_mode; - if (!switch_core_has_video() && (conference->conf_video_mode == CONF_VIDEO_MODE_MUX || conference->conf_video_mode == CONF_VIDEO_MODE_TRANSCODE)) { - conference->conf_video_mode = CONF_VIDEO_MODE_PASSTHROUGH; + if (!switch_core_has_video() && (conference->conference_video_mode == CONF_VIDEO_MODE_MUX || conference->conference_video_mode == CONF_VIDEO_MODE_TRANSCODE)) { + conference->conference_video_mode = CONF_VIDEO_MODE_PASSTHROUGH; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "video-mode invalid, only valid setting is 'passthrough' due to no video capabilities\n"); } - if (conference->conf_video_mode == CONF_VIDEO_MODE_MUX) { + if (conference->conference_video_mode == CONF_VIDEO_MODE_MUX) { int canvas_w = 0, canvas_h = 0; if (video_canvas_size) { char *p; @@ -2784,7 +2784,7 @@ conference_obj_t *conf_new(char *name, conf_xml_cfg_t cfg, switch_core_session_t } - conf_video_parse_layouts(conference, canvas_w, canvas_h); + conference_video_parse_layouts(conference, canvas_w, canvas_h); if (!video_canvas_bgcolor) { video_canvas_bgcolor = "#333333"; @@ -2807,11 +2807,11 @@ conference_obj_t *conf_new(char *name, conf_xml_cfg_t cfg, switch_core_session_t conference->video_letterbox_bgcolor = switch_core_strdup(conference->pool, video_letterbox_bgcolor); if (fps) { - conf_video_set_fps(conference, fps); + conference_video_set_fps(conference, fps); } if (!conference->video_fps.ms) { - conf_video_set_fps(conference, 30); + conference_video_set_fps(conference, 30); } if (video_codec_bandwidth) { @@ -2838,7 +2838,7 @@ conference_obj_t *conf_new(char *name, conf_xml_cfg_t cfg, switch_core_session_t conference->video_layout_group = switch_core_strdup(conference->pool, video_layout_group); } - if (!conf_video_get_layout(conference, video_layout_name, video_layout_group)) { + if (!conference_video_get_layout(conference, video_layout_name, video_layout_group)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid video-layout-name specified, using " CONFERENCE_MUX_DEFAULT_LAYOUT "\n"); video_layout_name = CONFERENCE_MUX_DEFAULT_LAYOUT; video_layout_group = video_layout_name + 6; @@ -2846,9 +2846,9 @@ conference_obj_t *conf_new(char *name, conf_xml_cfg_t cfg, switch_core_session_t conference->video_layout_group = switch_core_strdup(conference->pool, video_layout_group); } - if (!conf_video_get_layout(conference, video_layout_name, video_layout_group)) { + if (!conference_video_get_layout(conference, video_layout_name, video_layout_group)) { conference->video_layout_name = conference->video_layout_group = video_layout_group = video_layout_name = NULL; - conference->conf_video_mode = CONF_VIDEO_MODE_TRANSCODE; + conference->conference_video_mode = CONF_VIDEO_MODE_TRANSCODE; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid conference layout settings, falling back to transcode mode\n"); } else { conference->canvas_width = canvas_w; @@ -2856,8 +2856,8 @@ conference_obj_t *conf_new(char *name, conf_xml_cfg_t cfg, switch_core_session_t } } - if (conference->conf_video_mode == CONF_VIDEO_MODE_TRANSCODE || conference->conf_video_mode == CONF_VIDEO_MODE_MUX) { - conf_utils_set_flag(conference, CFLAG_TRANSCODE_VIDEO); + if (conference->conference_video_mode == CONF_VIDEO_MODE_TRANSCODE || conference->conference_video_mode == CONF_VIDEO_MODE_MUX) { + conference_utils_set_flag(conference, CFLAG_TRANSCODE_VIDEO); } if (outcall_templ) { @@ -2907,11 +2907,11 @@ conference_obj_t *conf_new(char *name, conf_xml_cfg_t cfg, switch_core_session_t } if (member_flags) { - conf_utils_set_mflags(member_flags, conference->mflags); + conference_utils_set_mflags(member_flags, conference->mflags); } if (conference_flags) { - conf_utils_set_cflags(conference_flags, conference->flags); + conference_utils_set_cflags(conference_flags, conference->flags); } if (!zstr(sound_prefix)) { @@ -3046,7 +3046,7 @@ conference_obj_t *conf_new(char *name, conf_xml_cfg_t cfg, switch_core_session_t conference->eflags = 0xFFFFFFFF; if (!zstr(suppress_events)) { - conf_utils_clear_eflags(suppress_events, &conference->eflags); + conference_utils_clear_eflags(suppress_events, &conference->eflags); } if (!zstr(auto_record)) { @@ -3062,8 +3062,8 @@ conference_obj_t *conf_new(char *name, conf_xml_cfg_t cfg, switch_core_session_t if (!zstr(terminate_on_silence)) { conference->terminate_on_silence = atoi(terminate_on_silence); } - if (!zstr(endconf_grace_time)) { - conference->endconf_grace_time = atoi(endconf_grace_time); + if (!zstr(endconference_grace_time)) { + conference->endconference_grace_time = atoi(endconference_grace_time); } if (!zstr(verbose_events) && switch_true(verbose_events)) { @@ -3076,8 +3076,8 @@ conference_obj_t *conf_new(char *name, conf_xml_cfg_t cfg, switch_core_session_t conference->uuid_str = switch_core_strdup(conference->pool, uuid_str); /* Set enter sound and exit sound flags so that default is on */ - conf_utils_set_flag(conference, CFLAG_ENTER_SOUND); - conf_utils_set_flag(conference, CFLAG_EXIT_SOUND); + conference_utils_set_flag(conference, CFLAG_ENTER_SOUND); + conference_utils_set_flag(conference, CFLAG_EXIT_SOUND); /* Activate the conference mutex for exclusivity */ switch_mutex_init(&conference->mutex, SWITCH_MUTEX_NESTED, conference->pool); @@ -3086,23 +3086,23 @@ conference_obj_t *conf_new(char *name, conf_xml_cfg_t cfg, switch_core_session_t switch_mutex_init(&conference->member_mutex, SWITCH_MUTEX_NESTED, conference->pool); switch_mutex_init(&conference->canvas_mutex, SWITCH_MUTEX_NESTED, conference->pool); - switch_mutex_lock(conf_globals.hash_mutex); - conf_utils_set_flag(conference, CFLAG_INHASH); - switch_core_hash_insert(conf_globals.conference_hash, conference->name, conference); - switch_mutex_unlock(conf_globals.hash_mutex); + switch_mutex_lock(conference_globals.hash_mutex); + conference_utils_set_flag(conference, CFLAG_INHASH); + switch_core_hash_insert(conference_globals.conference_hash, conference->name, conference); + switch_mutex_unlock(conference_globals.hash_mutex); conference->super_canvas_label_layers = video_super_canvas_label_layers; conference->super_canvas_show_all_layers = video_super_canvas_show_all_layers; if (video_canvas_count < 1) video_canvas_count = 1; - if (conference->conf_video_mode == CONF_VIDEO_MODE_MUX) { - video_layout_t *vlayout = conf_video_get_layout(conference, conference->video_layout_name, conference->video_layout_group); + if (conference->conference_video_mode == CONF_VIDEO_MODE_MUX) { + video_layout_t *vlayout = conference_video_get_layout(conference, conference->video_layout_name, conference->video_layout_group); if (!vlayout) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot find layout\n"); conference->video_layout_name = conference->video_layout_group = NULL; - conf_utils_clear_flag(conference, CFLAG_VIDEO_MUXING); + conference_utils_clear_flag(conference, CFLAG_VIDEO_MUXING); } else { int j; @@ -3110,22 +3110,22 @@ conference_obj_t *conf_new(char *name, conf_xml_cfg_t cfg, switch_core_session_t mcu_canvas_t *canvas = NULL; switch_mutex_lock(conference->canvas_mutex); - conf_video_init_canvas(conference, vlayout, &canvas); - conf_video_attach_canvas(conference, canvas, 0); - conf_video_launch_muxing_thread(conference, canvas, 0); + conference_video_init_canvas(conference, vlayout, &canvas); + conference_video_attach_canvas(conference, canvas, 0); + conference_video_launch_muxing_thread(conference, canvas, 0); switch_mutex_unlock(conference->canvas_mutex); } if (conference->canvas_count > 1) { - video_layout_t *svlayout = conf_video_get_layout(conference, NULL, CONFERENCE_MUX_DEFAULT_SUPER_LAYOUT); + video_layout_t *svlayout = conference_video_get_layout(conference, NULL, CONFERENCE_MUX_DEFAULT_SUPER_LAYOUT); mcu_canvas_t *canvas = NULL; if (svlayout) { switch_mutex_lock(conference->canvas_mutex); - conf_video_init_canvas(conference, svlayout, &canvas); - conf_video_set_canvas_bgcolor(canvas, conference->video_super_canvas_bgcolor); - conf_video_attach_canvas(conference, canvas, 1); - conf_video_launch_muxing_thread(conference, canvas, 1); + conference_video_init_canvas(conference, svlayout, &canvas); + conference_video_set_canvas_bgcolor(canvas, conference->video_super_canvas_bgcolor); + conference_video_attach_canvas(conference, canvas, 1); + conference_video_launch_muxing_thread(conference, canvas, 1); switch_mutex_unlock(conference->canvas_mutex); } } @@ -3134,12 +3134,12 @@ conference_obj_t *conf_new(char *name, conf_xml_cfg_t cfg, switch_core_session_t end: - switch_mutex_unlock(conf_globals.hash_mutex); + switch_mutex_unlock(conference_globals.hash_mutex); return conference; } -void conf_send_presence(conference_obj_t *conference) +void conference_send_presence(conference_obj_t *conference) { switch_event_t *event; @@ -3176,9 +3176,9 @@ void conf_send_presence(conference_obj_t *conference) } #if 0 -uint32_t conf_kickall_matching_var(conference_obj_t *conference, const char *var, const char *val) +uint32_t conference_kickall_matching_var(conference_obj_t *conference, const char *var, const char *val) { - conf_member_t *member = NULL; + conference_member_t *member = NULL; const char *vval = NULL; uint32_t r = 0; @@ -3188,7 +3188,7 @@ uint32_t conf_kickall_matching_var(conference_obj_t *conference, const char *var for (member = conference->members; member; member = member->next) { switch_channel_t *channel = NULL; - if (conf_utils_member_test_flag(member, MFLAG_NOCHANNEL)) { + if (conference_utils_member_test_flag(member, MFLAG_NOCHANNEL)) { continue; } @@ -3196,8 +3196,8 @@ uint32_t conf_kickall_matching_var(conference_obj_t *conference, const char *var vval = switch_channel_get_variable(channel, var); if (vval && !strcmp(vval, val)) { - conf_utils_member_set_flag_locked(member, MFLAG_KICKED); - conf_utils_member_clear_flag_locked(member, MFLAG_RUNNING); + conference_utils_member_set_flag_locked(member, MFLAG_KICKED); + conference_utils_member_clear_flag_locked(member, MFLAG_RUNNING); switch_core_session_kill_channel(member->session, SWITCH_SIG_BREAK); r++; } @@ -3264,19 +3264,19 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_conference_load) switch_application_interface_t *app_interface; switch_status_t status = SWITCH_STATUS_SUCCESS; - memset(&conf_globals, 0, sizeof(conf_globals)); + memset(&conference_globals, 0, sizeof(conference_globals)); /* Connect my internal structure to the blank pointer passed to me */ *module_interface = switch_loadable_module_create_module_interface(pool, modname); - switch_console_add_complete_func("::conference::conf_list_conferences", conf_list_conferences); + switch_console_add_complete_func("::conference::conference_list_conferences", conference_list_conferences); - switch_event_channel_bind("conference", conf_event_channel_handler, &conf_globals.event_channel_id); - switch_event_channel_bind("conference-liveArray", conf_event_la_channel_handler, &conf_globals.event_channel_id); - switch_event_channel_bind("conference-mod", conf_event_mod_channel_handler, &conf_globals.event_channel_id); + switch_event_channel_bind("conference", conference_event_channel_handler, &conference_globals.event_channel_id); + switch_event_channel_bind("conference-liveArray", conference_event_la_channel_handler, &conference_globals.event_channel_id); + switch_event_channel_bind("conference-mod", conference_event_mod_channel_handler, &conference_globals.event_channel_id); - if ( conf_api_sub_syntax(&api_syntax) != SWITCH_STATUS_SUCCESS) { + if ( conference_api_sub_syntax(&api_syntax) != SWITCH_STATUS_SUCCESS) { return SWITCH_STATUS_TERM; } @@ -3287,67 +3287,67 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_conference_load) } /* Setup the pool */ - conf_globals.conference_pool = pool; + conference_globals.conference_pool = pool; /* Setup a hash to store conferences by name */ - switch_core_hash_init(&conf_globals.conference_hash); - switch_mutex_init(&conf_globals.conference_mutex, SWITCH_MUTEX_NESTED, conf_globals.conference_pool); - switch_mutex_init(&conf_globals.id_mutex, SWITCH_MUTEX_NESTED, conf_globals.conference_pool); - switch_mutex_init(&conf_globals.hash_mutex, SWITCH_MUTEX_NESTED, conf_globals.conference_pool); - switch_mutex_init(&conf_globals.setup_mutex, SWITCH_MUTEX_NESTED, conf_globals.conference_pool); + switch_core_hash_init(&conference_globals.conference_hash); + switch_mutex_init(&conference_globals.conference_mutex, SWITCH_MUTEX_NESTED, conference_globals.conference_pool); + switch_mutex_init(&conference_globals.id_mutex, SWITCH_MUTEX_NESTED, conference_globals.conference_pool); + switch_mutex_init(&conference_globals.hash_mutex, SWITCH_MUTEX_NESTED, conference_globals.conference_pool); + switch_mutex_init(&conference_globals.setup_mutex, SWITCH_MUTEX_NESTED, conference_globals.conference_pool); /* Subscribe to presence request events */ - if (switch_event_bind(modname, SWITCH_EVENT_PRESENCE_PROBE, SWITCH_EVENT_SUBCLASS_ANY, conf_event_pres_handler, NULL) != SWITCH_STATUS_SUCCESS) { + if (switch_event_bind(modname, SWITCH_EVENT_PRESENCE_PROBE, SWITCH_EVENT_SUBCLASS_ANY, conference_event_pres_handler, NULL) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't subscribe to presence request events!\n"); } - if (switch_event_bind(modname, SWITCH_EVENT_CONFERENCE_DATA_QUERY, SWITCH_EVENT_SUBCLASS_ANY, conf_data_event_handler, NULL) != SWITCH_STATUS_SUCCESS) { + if (switch_event_bind(modname, SWITCH_EVENT_CONFERENCE_DATA_QUERY, SWITCH_EVENT_SUBCLASS_ANY, conference_data_event_handler, NULL) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't subscribe to conference data query events!\n"); } - if (switch_event_bind(modname, SWITCH_EVENT_CALL_SETUP_REQ, SWITCH_EVENT_SUBCLASS_ANY, conf_event_call_setup_handler, NULL) != SWITCH_STATUS_SUCCESS) { + if (switch_event_bind(modname, SWITCH_EVENT_CALL_SETUP_REQ, SWITCH_EVENT_SUBCLASS_ANY, conference_event_call_setup_handler, NULL) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't subscribe to conference data query events!\n"); } - SWITCH_ADD_API(api_interface, "conference", "Conference module commands", conf_api_main, p); + SWITCH_ADD_API(api_interface, "conference", "Conference module commands", conference_api_main, p); SWITCH_ADD_APP(app_interface, mod_conference_app_name, mod_conference_app_name, NULL, conference_function, NULL, SAF_NONE); - SWITCH_ADD_APP(app_interface, "conference_set_auto_outcall", "conference_set_auto_outcall", NULL, conf_auto_function, NULL, SAF_NONE); + SWITCH_ADD_APP(app_interface, "conference_set_auto_outcall", "conference_set_auto_outcall", NULL, conference_auto_function, NULL, SAF_NONE); SWITCH_ADD_CHAT(chat_interface, CONF_CHAT_PROTO, chat_send); send_presence(SWITCH_EVENT_PRESENCE_IN); - conf_globals.running = 1; + conference_globals.running = 1; /* indicate that the module should continue to be loaded */ return status; } SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_conference_shutdown) { - if (conf_globals.running) { + if (conference_globals.running) { /* signal all threads to shutdown */ - conf_globals.running = 0; + conference_globals.running = 0; - switch_event_channel_unbind(NULL, conf_event_channel_handler); - switch_event_channel_unbind(NULL, conf_event_la_channel_handler); + switch_event_channel_unbind(NULL, conference_event_channel_handler); + switch_event_channel_unbind(NULL, conference_event_la_channel_handler); - switch_console_del_complete_func("::conference::conf_list_conferences"); + switch_console_del_complete_func("::conference::conference_list_conferences"); /* wait for all threads */ - while (conf_globals.threads) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Waiting for %d threads\n", conf_globals.threads); + while (conference_globals.threads) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Waiting for %d threads\n", conference_globals.threads); switch_yield(100000); } - switch_event_unbind_callback(conf_event_pres_handler); - switch_event_unbind_callback(conf_data_event_handler); - switch_event_unbind_callback(conf_event_call_setup_handler); + switch_event_unbind_callback(conference_event_pres_handler); + switch_event_unbind_callback(conference_data_event_handler); + switch_event_unbind_callback(conference_event_call_setup_handler); switch_event_free_subclass(CONF_EVENT_MAINT); /* free api interface help ".syntax" field string */ switch_safe_free(api_syntax); } - switch_core_hash_destroy(&conf_globals.conference_hash); + switch_core_hash_destroy(&conference_globals.conference_hash); return SWITCH_STATUS_SUCCESS; } diff --git a/src/mod/applications/mod_conference/mod_conference.h b/src/mod/applications/mod_conference/mod_conference.h index 7d88746b98..2c633545a2 100644 --- a/src/mod/applications/mod_conference/mod_conference.h +++ b/src/mod/applications/mod_conference/mod_conference.h @@ -103,7 +103,7 @@ //#define lock_member(_member) switch_mutex_lock(_member->write_mutex) //#define unlock_member(_member) switch_mutex_unlock(_member->write_mutex) -#define CONFFUNCAPISIZE (sizeof(conf_api_sub_commands)/sizeof(conf_api_sub_commands[0])) +#define CONFFUNCAPISIZE (sizeof(conference_api_sub_commands)/sizeof(conference_api_sub_commands[0])) #define MAX_MUX_CODECS 10 @@ -119,7 +119,7 @@ /* STRUCTS */ -struct conf_fps { +struct conference_fps { float fps; int ms; int samples; @@ -129,7 +129,7 @@ struct conf_fps { typedef enum { CONF_SILENT_REQ = (1 << 0), CONF_SILENT_DONE = (1 << 1) -} conf_app_flag_t; +} conference_app_flag_t; extern char *mod_conference_cf_name; extern char *api_syntax; @@ -142,7 +142,7 @@ typedef enum { } file_stop_t; /* Global Values */ -typedef struct conf_globals_s { +typedef struct conference_globals_s { switch_memory_pool_t *conference_pool; switch_mutex_t *conference_mutex; switch_hash_t *conference_hash; @@ -153,13 +153,13 @@ typedef struct conf_globals_s { int32_t running; uint32_t threads; switch_event_channel_id_t event_channel_id; -} conf_globals_t; +} conference_globals_t; -extern conf_globals_t conf_globals; +extern conference_globals_t conference_globals; /* forward declaration for conference_obj and caller_control */ struct conference_member; -typedef struct conference_member conf_member_t; +typedef struct conference_member conference_member_t; struct caller_control_actions; @@ -249,17 +249,17 @@ typedef enum { CFLAG_MAX } conference_flag_t; -typedef struct conf_cdr_node_s { +typedef struct conference_cdr_node_s { switch_caller_profile_t *cp; char *record_path; switch_time_t join_time; switch_time_t leave_time; member_flag_t mflags[MFLAG_MAX]; uint32_t id; - conf_member_t *member; + conference_member_t *member; switch_event_t *var_event; - struct conf_cdr_node_s *next; -} conf_cdr_node_t; + struct conference_cdr_node_s *next; +} conference_cdr_node_t; typedef enum { CDRR_LOCKED = 1, @@ -267,12 +267,12 @@ typedef enum { CDRR_MAXMEMBERS } cdr_reject_reason_t; -typedef struct conf_cdr_reject_s { +typedef struct conference_cdr_reject_s { switch_caller_profile_t *cp; switch_time_t reject_time; cdr_reject_reason_t reason; - struct conf_cdr_reject_s *next; -} conf_cdr_reject_t; + struct conference_cdr_reject_s *next; +} conference_cdr_reject_t; typedef enum { CDRE_NONE, @@ -353,7 +353,7 @@ typedef struct al_handle_s { ALfloat pos_z; } al_handle_t; -void conf_al_close(al_handle_t *al); +void conference_al_close(al_handle_t *al); #else typedef struct al_handle_s { int unsupported; @@ -388,14 +388,14 @@ typedef enum { } recording_action_type_t; /* conference xml config sections */ -typedef struct conf_xml_cfg { +typedef struct conference_xml_cfg { switch_xml_t profile; switch_xml_t controls; -} conf_xml_cfg_t; +} conference_xml_cfg_t; struct vid_helper { - conf_member_t *member_a; - conf_member_t *member_b; + conference_member_t *member_a; + conference_member_t *member_b; int up; }; @@ -496,13 +496,13 @@ typedef struct conference_record { switch_bool_t autorec; struct conference_record *next; switch_file_handle_t fh; -} conf_record_t; +} conference_record_t; typedef enum { CONF_VIDEO_MODE_PASSTHROUGH, CONF_VIDEO_MODE_TRANSCODE, CONF_VIDEO_MODE_MUX -} conf_video_mode_t; +} conference_video_mode_t; /* Conference Object */ typedef struct conference_obj { @@ -540,7 +540,7 @@ typedef struct conference_obj { char *video_super_canvas_bgcolor; char *video_letterbox_bgcolor; char *no_video_avatar; - conf_video_mode_t conf_video_mode; + conference_video_mode_t conference_video_mode; int members_with_video; int members_with_avatar; switch_codec_settings_t video_codec_settings; @@ -569,8 +569,8 @@ typedef struct conference_obj { uint32_t interval; uint32_t channels; switch_mutex_t *mutex; - conf_member_t *members; - conf_member_t *floor_holder; + conference_member_t *members; + conference_member_t *floor_holder; uint32_t video_floor_holder; uint32_t last_video_floor_holder; switch_mutex_t *member_mutex; @@ -598,8 +598,8 @@ typedef struct conference_obj { int end_count; uint32_t count_ghosts; /* allow extra time after 'endconf' member leaves */ - switch_time_t endconf_time; - int endconf_grace_time; + switch_time_t endconference_time; + int endconference_grace_time; uint32_t relationship_total; uint32_t score; @@ -614,15 +614,15 @@ typedef struct conference_obj { char *uuid_str; uint32_t originating; switch_call_cause_t cancel_cause; - conf_cdr_node_t *cdr_nodes; - conf_cdr_reject_t *cdr_rejected; + conference_cdr_node_t *cdr_nodes; + conference_cdr_reject_t *cdr_rejected; switch_time_t start_time; switch_time_t end_time; char *log_dir; cdr_event_mode_t cdr_event_mode; struct vid_helper vh[2]; struct vid_helper mh; - conf_record_t *rec_node_head; + conference_record_t *rec_node_head; int last_speech_channels; mcu_canvas_t *canvas; mcu_canvas_t *canvases[MAX_CANVASES+1]; @@ -633,7 +633,7 @@ typedef struct conference_obj { switch_mutex_t *canvas_mutex; switch_hash_t *layout_hash; switch_hash_t *layout_group_hash; - struct conf_fps video_fps; + struct conference_fps video_fps; int playing_video_file; int recording_members; uint32_t video_floor_packets; @@ -673,7 +673,7 @@ struct conference_member { switch_codec_t write_codec; char *rec_path; switch_time_t rec_time; - conf_record_t *rec; + conference_record_t *rec; uint8_t *frame; uint8_t *last_frame; uint32_t frame_size; @@ -702,7 +702,7 @@ struct conference_member { uint32_t avg_tally; struct conference_member *next; switch_ivr_dmachine_t *dmachine; - conf_cdr_node_t *cdr_node; + conference_cdr_node_t *cdr_node; char *kicked_sound; switch_queue_t *dtmf_queue; switch_queue_t *video_queue; @@ -762,17 +762,17 @@ typedef struct codec_set_s { uint8_t *packet; } codec_set_t; -typedef void (*conf_key_callback_t) (conf_member_t *, struct caller_control_actions *); +typedef void (*conference_key_callback_t) (conference_member_t *, struct caller_control_actions *); typedef struct { - conf_member_t *member; + conference_member_t *member; caller_control_action_t action; - conf_key_callback_t handler; + conference_key_callback_t handler; } key_binding_t; struct _mapping { const char *name; - conf_key_callback_t handler; + conference_key_callback_t handler; }; typedef enum { @@ -825,126 +825,126 @@ struct bg_call { /* FUNCTION DEFINITIONS */ -switch_bool_t conf_utils_test_flag(conference_obj_t *conference, conference_flag_t flag); -conference_relationship_t *conf_member_get_relationship(conf_member_t *member, conf_member_t *other_member); +switch_bool_t conference_utils_test_flag(conference_obj_t *conference, conference_flag_t flag); +conference_relationship_t *conference_member_get_relationship(conference_member_t *member, conference_member_t *other_member); uint32_t next_member_id(void); -void conf_utils_set_cflags(const char *flags, conference_flag_t *f); -void conf_utils_set_mflags(const char *flags, member_flag_t *f); -void conf_utils_merge_mflags(member_flag_t *a, member_flag_t *b); -void conf_utils_clear_eflags(char *events, uint32_t *f); -void conf_event_pres_handler(switch_event_t *event); -void conf_data_event_handler(switch_event_t *event); -void conf_event_call_setup_handler(switch_event_t *event); -void conf_member_add_file_data(conf_member_t *member, int16_t *data, switch_size_t file_data_len); -void conf_send_notify(conference_obj_t *conference, const char *status, const char *call_id, switch_bool_t final); +void conference_utils_set_cflags(const char *flags, conference_flag_t *f); +void conference_utils_set_mflags(const char *flags, member_flag_t *f); +void conference_utils_merge_mflags(member_flag_t *a, member_flag_t *b); +void conference_utils_clear_eflags(char *events, uint32_t *f); +void conference_event_pres_handler(switch_event_t *event); +void conference_data_event_handler(switch_event_t *event); +void conference_event_call_setup_handler(switch_event_t *event); +void conference_member_add_file_data(conference_member_t *member, int16_t *data, switch_size_t file_data_len); +void conference_send_notify(conference_obj_t *conference, const char *status, const char *call_id, switch_bool_t final); switch_status_t conference_file_close(conference_obj_t *conference, conference_file_node_t *node); -void *SWITCH_THREAD_FUNC conf_record_thread_run(switch_thread_t *thread, void *obj); +void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, void *obj); -void conf_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t *stream); -void conf_al_process(al_handle_t *al, void *data, switch_size_t datalen, int rate); +void conference_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t *stream); +void conference_al_process(al_handle_t *al, void *data, switch_size_t datalen, int rate); -void conf_utils_member_set_flag_locked(conf_member_t *member, member_flag_t flag); -void conf_utils_member_set_flag(conf_member_t *member, member_flag_t flag); +void conference_utils_member_set_flag_locked(conference_member_t *member, member_flag_t flag); +void conference_utils_member_set_flag(conference_member_t *member, member_flag_t flag); -void conf_member_update_status_field(conf_member_t *member); -void conf_video_vmute_snap(conf_member_t *member, switch_bool_t clear); -void conf_video_reset_video_bitrate_counters(conf_member_t *member); -void conf_video_clear_layer(mcu_layer_t *layer); -int conf_member_get_canvas_id(conf_member_t *member, const char *val, switch_bool_t watching); -void conf_video_reset_member_codec_index(conf_member_t *member); -void conf_video_detach_video_layer(conf_member_t *member); -void conf_utils_set_flag(conference_obj_t *conference, conference_flag_t flag); -void conf_utils_set_flag_locked(conference_obj_t *conference, conference_flag_t flag); -void conf_utils_clear_flag(conference_obj_t *conference, conference_flag_t flag); -void conf_utils_clear_flag_locked(conference_obj_t *conference, conference_flag_t flag); -switch_status_t conf_loop_dmachine_dispatcher(switch_ivr_dmachine_match_t *match); +void conference_member_update_status_field(conference_member_t *member); +void conference_video_vmute_snap(conference_member_t *member, switch_bool_t clear); +void conference_video_reset_video_bitrate_counters(conference_member_t *member); +void conference_video_clear_layer(mcu_layer_t *layer); +int conference_member_get_canvas_id(conference_member_t *member, const char *val, switch_bool_t watching); +void conference_video_reset_member_codec_index(conference_member_t *member); +void conference_video_detach_video_layer(conference_member_t *member); +void conference_utils_set_flag(conference_obj_t *conference, conference_flag_t flag); +void conference_utils_set_flag_locked(conference_obj_t *conference, conference_flag_t flag); +void conference_utils_clear_flag(conference_obj_t *conference, conference_flag_t flag); +void conference_utils_clear_flag_locked(conference_obj_t *conference, conference_flag_t flag); +switch_status_t conference_loop_dmachine_dispatcher(switch_ivr_dmachine_match_t *match); -int conf_member_setup_media(conf_member_t *member, conference_obj_t *conference); +int conference_member_setup_media(conference_member_t *member, conference_obj_t *conference); -al_handle_t *conf_al_create(switch_memory_pool_t *pool); -switch_status_t conf_member_parse_position(conf_member_t *member, const char *data); -video_layout_t *conf_video_find_best_layout(conference_obj_t *conference, layout_group_t *lg, uint32_t count); -void conf_list_count_only(conference_obj_t *conference, switch_stream_handle_t *stream); -void conf_member_set_floor_holder(conference_obj_t *conference, conf_member_t *member); -void conf_utils_member_clear_flag(conf_member_t *member, member_flag_t flag); -void conf_utils_member_clear_flag_locked(conf_member_t *member, member_flag_t flag); -switch_status_t conf_video_attach_video_layer(conf_member_t *member, mcu_canvas_t *canvas, int idx); -int conf_video_set_fps(conference_obj_t *conference, float fps); -void conf_video_layer_set_logo(conf_member_t *member, mcu_layer_t *layer, const char *path); -void conf_video_layer_set_banner(conf_member_t *member, mcu_layer_t *layer, const char *text); -void conf_fnode_seek(conference_file_node_t *fnode, switch_stream_handle_t *stream, char *arg); -uint32_t conf_member_stop_file(conf_member_t *member, file_stop_t stop); -switch_bool_t conf_utils_member_test_flag(conf_member_t *member, member_flag_t flag); -void conf_list_pretty(conference_obj_t *conference, switch_stream_handle_t *stream); -switch_status_t conf_record_stop(conference_obj_t *conference, switch_stream_handle_t *stream, char *path); -switch_status_t conf_record_action(conference_obj_t *conference, char *path, recording_action_type_t action); -void conf_xlist(conference_obj_t *conference, switch_xml_t x_conference, int off); -void conf_event_send_json(conference_obj_t *conference); -void conf_event_send_rfc(conference_obj_t *conference); -void conf_member_update_status_field(conf_member_t *member); -void conf_event_la_command_handler(switch_live_array_t *la, const char *cmd, const char *sessid, cJSON *jla, void *user_data); -void conf_event_adv_la(conference_obj_t *conference, conf_member_t *member, switch_bool_t join); -switch_status_t conf_video_init_canvas(conference_obj_t *conference, video_layout_t *vlayout, mcu_canvas_t **canvasP); -switch_status_t conf_video_attach_canvas(conference_obj_t *conference, mcu_canvas_t *canvas, int super); -void conf_video_init_canvas_layers(conference_obj_t *conference, mcu_canvas_t *canvas, video_layout_t *vlayout); -switch_status_t conf_video_attach_video_layer(conf_member_t *member, mcu_canvas_t *canvas, int idx); -void conf_video_reset_video_bitrate_counters(conf_member_t *member); -void conf_video_layer_set_banner(conf_member_t *member, mcu_layer_t *layer, const char *text); -void conf_video_layer_set_logo(conf_member_t *member, mcu_layer_t *layer, const char *path); -void conf_video_detach_video_layer(conf_member_t *member); -void conf_video_check_used_layers(mcu_canvas_t *canvas); -void conf_video_set_canvas_letterbox_bgcolor(mcu_canvas_t *canvas, char *color); -void conf_video_set_canvas_bgcolor(mcu_canvas_t *canvas, char *color); -void conf_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg, switch_bool_t freeze); -void conf_video_reset_layer(mcu_layer_t *layer); -void conf_video_clear_layer(mcu_layer_t *layer); -void conf_video_reset_image(switch_image_t *img, switch_rgb_color_t *color); -void conf_video_parse_layouts(conference_obj_t *conference, int WIDTH, int HEIGHT); -int conf_video_set_fps(conference_obj_t *conference, float fps); -video_layout_t *conf_video_get_layout(conference_obj_t *conference, const char *video_layout_name, const char *video_layout_group); -void conf_video_check_avatar(conf_member_t *member, switch_bool_t force); -void conf_video_find_floor(conf_member_t *member, switch_bool_t entering); -void conf_video_destroy_canvas(mcu_canvas_t **canvasP); -void conf_video_fnode_check(conference_file_node_t *fnode); -switch_status_t conf_al_parse_position(al_handle_t *al, const char *data); -switch_status_t conf_video_thread_callback(switch_core_session_t *session, switch_frame_t *frame, void *user_data); -void *SWITCH_THREAD_FUNC conf_video_muxing_write_thread_run(switch_thread_t *thread, void *obj); -void conf_member_check_agc_levels(conf_member_t *member); -void conf_member_clear_avg(conf_member_t *member); -int conf_member_noise_gate_check(conf_member_t *member); -void conf_member_check_channels(switch_frame_t *frame, conf_member_t *member, switch_bool_t in); +al_handle_t *conference_al_create(switch_memory_pool_t *pool); +switch_status_t conference_member_parse_position(conference_member_t *member, const char *data); +video_layout_t *conference_video_find_best_layout(conference_obj_t *conference, layout_group_t *lg, uint32_t count); +void conference_list_count_only(conference_obj_t *conference, switch_stream_handle_t *stream); +void conference_member_set_floor_holder(conference_obj_t *conference, conference_member_t *member); +void conference_utils_member_clear_flag(conference_member_t *member, member_flag_t flag); +void conference_utils_member_clear_flag_locked(conference_member_t *member, member_flag_t flag); +switch_status_t conference_video_attach_video_layer(conference_member_t *member, mcu_canvas_t *canvas, int idx); +int conference_video_set_fps(conference_obj_t *conference, float fps); +void conference_video_layer_set_logo(conference_member_t *member, mcu_layer_t *layer, const char *path); +void conference_video_layer_set_banner(conference_member_t *member, mcu_layer_t *layer, const char *text); +void conference_fnode_seek(conference_file_node_t *fnode, switch_stream_handle_t *stream, char *arg); +uint32_t conference_member_stop_file(conference_member_t *member, file_stop_t stop); +switch_bool_t conference_utils_member_test_flag(conference_member_t *member, member_flag_t flag); +void conference_list_pretty(conference_obj_t *conference, switch_stream_handle_t *stream); +switch_status_t conference_record_stop(conference_obj_t *conference, switch_stream_handle_t *stream, char *path); +switch_status_t conference_record_action(conference_obj_t *conference, char *path, recording_action_type_t action); +void conference_xlist(conference_obj_t *conference, switch_xml_t x_conference, int off); +void conference_event_send_json(conference_obj_t *conference); +void conference_event_send_rfc(conference_obj_t *conference); +void conference_member_update_status_field(conference_member_t *member); +void conference_event_la_command_handler(switch_live_array_t *la, const char *cmd, const char *sessid, cJSON *jla, void *user_data); +void conference_event_adv_la(conference_obj_t *conference, conference_member_t *member, switch_bool_t join); +switch_status_t conference_video_init_canvas(conference_obj_t *conference, video_layout_t *vlayout, mcu_canvas_t **canvasP); +switch_status_t conference_video_attach_canvas(conference_obj_t *conference, mcu_canvas_t *canvas, int super); +void conference_video_init_canvas_layers(conference_obj_t *conference, mcu_canvas_t *canvas, video_layout_t *vlayout); +switch_status_t conference_video_attach_video_layer(conference_member_t *member, mcu_canvas_t *canvas, int idx); +void conference_video_reset_video_bitrate_counters(conference_member_t *member); +void conference_video_layer_set_banner(conference_member_t *member, mcu_layer_t *layer, const char *text); +void conference_video_layer_set_logo(conference_member_t *member, mcu_layer_t *layer, const char *path); +void conference_video_detach_video_layer(conference_member_t *member); +void conference_video_check_used_layers(mcu_canvas_t *canvas); +void conference_video_set_canvas_letterbox_bgcolor(mcu_canvas_t *canvas, char *color); +void conference_video_set_canvas_bgcolor(mcu_canvas_t *canvas, char *color); +void conference_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg, switch_bool_t freeze); +void conference_video_reset_layer(mcu_layer_t *layer); +void conference_video_clear_layer(mcu_layer_t *layer); +void conference_video_reset_image(switch_image_t *img, switch_rgb_color_t *color); +void conference_video_parse_layouts(conference_obj_t *conference, int WIDTH, int HEIGHT); +int conference_video_set_fps(conference_obj_t *conference, float fps); +video_layout_t *conference_video_get_layout(conference_obj_t *conference, const char *video_layout_name, const char *video_layout_group); +void conference_video_check_avatar(conference_member_t *member, switch_bool_t force); +void conference_video_find_floor(conference_member_t *member, switch_bool_t entering); +void conference_video_destroy_canvas(mcu_canvas_t **canvasP); +void conference_video_fnode_check(conference_file_node_t *fnode); +switch_status_t conference_al_parse_position(al_handle_t *al, const char *data); +switch_status_t conference_video_thread_callback(switch_core_session_t *session, switch_frame_t *frame, void *user_data); +void *SWITCH_THREAD_FUNC conference_video_muxing_write_thread_run(switch_thread_t *thread, void *obj); +void conference_member_check_agc_levels(conference_member_t *member); +void conference_member_clear_avg(conference_member_t *member); +int conference_member_noise_gate_check(conference_member_t *member); +void conference_member_check_channels(switch_frame_t *frame, conference_member_t *member, switch_bool_t in); -void conf_fnode_toggle_pause(conference_file_node_t *fnode, switch_stream_handle_t *stream); +void conference_fnode_toggle_pause(conference_file_node_t *fnode, switch_stream_handle_t *stream); -// static conference_relationship_t *conf_member_get_relationship(conf_member_t *member, conf_member_t *other_member); +// static conference_relationship_t *conference_member_get_relationship(conference_member_t *member, conference_member_t *other_member); // static void conference_list(conference_obj_t *conference, switch_stream_handle_t *stream, char *delim); -conference_relationship_t *conf_member_add_relationship(conf_member_t *member, uint32_t id); -conf_member_t *conf_member_get(conference_obj_t *conference, uint32_t id); +conference_relationship_t *conference_member_add_relationship(conference_member_t *member, uint32_t id); +conference_member_t *conference_member_get(conference_obj_t *conference, uint32_t id); -switch_status_t conf_member_del_relationship(conf_member_t *member, uint32_t id); -switch_status_t conf_member_add(conference_obj_t *conference, conf_member_t *member); -switch_status_t conf_member_del(conference_obj_t *conference, conf_member_t *member); -void *SWITCH_THREAD_FUNC conf_thread_run(switch_thread_t *thread, void *obj); -void *SWITCH_THREAD_FUNC conf_video_muxing_thread_run(switch_thread_t *thread, void *obj); -void *SWITCH_THREAD_FUNC conf_video_super_muxing_thread_run(switch_thread_t *thread, void *obj); -void conf_loop_output(conf_member_t *member); +switch_status_t conference_member_del_relationship(conference_member_t *member, uint32_t id); +switch_status_t conference_member_add(conference_obj_t *conference, conference_member_t *member); +switch_status_t conference_member_del(conference_obj_t *conference, conference_member_t *member); +void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *obj); +void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thread, void *obj); +void *SWITCH_THREAD_FUNC conference_video_super_muxing_thread_run(switch_thread_t *thread, void *obj); +void conference_loop_output(conference_member_t *member); uint32_t conference_file_stop(conference_obj_t *conference, file_stop_t stop); switch_status_t conference_file_play(conference_obj_t *conference, char *file, uint32_t leadin, switch_channel_t *channel, uint8_t async); -void conf_member_send_all_dtmf(conf_member_t *member, conference_obj_t *conference, const char *dtmf); -switch_status_t conf_say(conference_obj_t *conference, const char *text, uint32_t leadin); -conference_obj_t *conf_find(char *name, char *domain); -void conf_member_bind_controls(conf_member_t *member, const char *controls); -void conf_send_presence(conference_obj_t *conference); -void conf_video_set_floor_holder(conference_obj_t *conference, conf_member_t *member, switch_bool_t force); -void conf_video_canvas_del_fnode_layer(conference_obj_t *conference, conference_file_node_t *fnode); -void conf_video_canvas_set_fnode_layer(mcu_canvas_t *canvas, conference_file_node_t *fnode, int idx); +void conference_member_send_all_dtmf(conference_member_t *member, conference_obj_t *conference, const char *dtmf); +switch_status_t conference_say(conference_obj_t *conference, const char *text, uint32_t leadin); +conference_obj_t *conference_find(char *name, char *domain); +void conference_member_bind_controls(conference_member_t *member, const char *controls); +void conference_send_presence(conference_obj_t *conference); +void conference_video_set_floor_holder(conference_obj_t *conference, conference_member_t *member, switch_bool_t force); +void conference_video_canvas_del_fnode_layer(conference_obj_t *conference, conference_file_node_t *fnode); +void conference_video_canvas_set_fnode_layer(mcu_canvas_t *canvas, conference_file_node_t *fnode, int idx); void conference_list(conference_obj_t *conference, switch_stream_handle_t *stream, char *delim); -const char *conf_utils_combine_flag_var(switch_core_session_t *session, const char *var_name); -int conf_loop_mapping_len(); +const char *conference_utils_combine_flag_var(switch_core_session_t *session, const char *var_name); +int conference_loop_mapping_len(); -switch_status_t conf_outcall(conference_obj_t *conference, +switch_status_t conference_outcall(conference_obj_t *conference, char *conference_name, switch_core_session_t *session, char *bridgeto, uint32_t timeout, @@ -954,139 +954,139 @@ switch_status_t conf_outcall(conference_obj_t *conference, char *profile, switch_call_cause_t *cause, switch_call_cause_t *cancel_cause, switch_event_t *var_event); -switch_status_t conf_outcall_bg(conference_obj_t *conference, +switch_status_t conference_outcall_bg(conference_obj_t *conference, char *conference_name, switch_core_session_t *session, char *bridgeto, uint32_t timeout, const char *flags, const char *cid_name, const char *cid_num, const char *call_uuid, const char *profile, switch_call_cause_t *cancel_cause, switch_event_t **var_event); -void conf_video_launch_muxing_thread(conference_obj_t *conference, mcu_canvas_t *canvas, int super); -void conf_launch_thread(conference_obj_t *conference); -void conf_video_launch_muxing_write_thread(conf_member_t *member); -void *SWITCH_THREAD_FUNC conf_loop_input(switch_thread_t *thread, void *obj); +void conference_video_launch_muxing_thread(conference_obj_t *conference, mcu_canvas_t *canvas, int super); +void conference_launch_thread(conference_obj_t *conference); +void conference_video_launch_muxing_write_thread(conference_member_t *member); +void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *obj); 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); -switch_status_t conf_member_play_file(conf_member_t *member, char *file, uint32_t leadin, switch_bool_t mux); -switch_status_t conf_member_say(conf_member_t *member, char *text, uint32_t leadin); -uint32_t conf_member_stop_file(conf_member_t *member, file_stop_t stop); -conference_obj_t *conf_new(char *name, conf_xml_cfg_t cfg, switch_core_session_t *session, switch_memory_pool_t *pool); +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_say(conference_member_t *member, char *text, uint32_t leadin); +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); switch_status_t chat_send(switch_event_t *message_event); -void conf_record_launch_thread(conference_obj_t *conference, char *path, switch_bool_t autorec); +void conference_record_launch_thread(conference_obj_t *conference, char *path, switch_bool_t autorec); -typedef switch_status_t (*conf_api_args_cmd_t) (conference_obj_t *, switch_stream_handle_t *, int, char **); -typedef switch_status_t (*conf_api_member_cmd_t) (conf_member_t *, switch_stream_handle_t *, void *); -typedef switch_status_t (*conf_api_text_cmd_t) (conference_obj_t *, switch_stream_handle_t *, const char *); +typedef switch_status_t (*conference_api_args_cmd_t) (conference_obj_t *, switch_stream_handle_t *, int, char **); +typedef switch_status_t (*conference_api_member_cmd_t) (conference_member_t *, switch_stream_handle_t *, void *); +typedef switch_status_t (*conference_api_text_cmd_t) (conference_obj_t *, switch_stream_handle_t *, const char *); -switch_status_t conf_event_add_data(conference_obj_t *conference, switch_event_t *event); -switch_status_t conf_member_add_event_data(conf_member_t *member, switch_event_t *event); +switch_status_t conference_event_add_data(conference_obj_t *conference, switch_event_t *event); +switch_status_t conference_member_add_event_data(conference_member_t *member, switch_event_t *event); -cJSON *conf_cdr_json_render(conference_obj_t *conference, cJSON *req); -char *conf_cdr_rfc4579_render(conference_obj_t *conference, switch_event_t *event, switch_event_t *revent); -void conf_cdr_del(conf_member_t *member); -void conf_cdr_add(conf_member_t *member); -void conf_cdr_rejected(conference_obj_t *conference, switch_channel_t *channel, cdr_reject_reason_t reason); -void conf_cdr_render(conference_obj_t *conference); -void conf_event_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id); -void conf_event_la_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id); -void conf_event_mod_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id); +cJSON *conference_cdr_json_render(conference_obj_t *conference, cJSON *req); +char *conference_cdr_rfc4579_render(conference_obj_t *conference, switch_event_t *event, switch_event_t *revent); +void conference_cdr_del(conference_member_t *member); +void conference_cdr_add(conference_member_t *member); +void conference_cdr_rejected(conference_obj_t *conference, switch_channel_t *channel, cdr_reject_reason_t reason); +void conference_cdr_render(conference_obj_t *conference); +void conference_event_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id); +void conference_event_la_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id); +void conference_event_mod_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id); -void conf_member_itterator(conference_obj_t *conference, switch_stream_handle_t *stream, uint8_t non_mod, conf_api_member_cmd_t pfncallback, void *data); +void conference_member_itterator(conference_obj_t *conference, switch_stream_handle_t *stream, uint8_t non_mod, conference_api_member_cmd_t pfncallback, void *data); -switch_status_t conf_api_sub_mute(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_tmute(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_unmute(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_vmute(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_tvmute(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_unvmute(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_deaf(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_undeaf(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_floor(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_vid_floor(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_clear_vid_floor(conference_obj_t *conference, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_position(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_conf_video_vmute_snap(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_dtmf(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_pause_play(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_play(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_say(conference_obj_t *conference, switch_stream_handle_t *stream, const char *text); -switch_status_t conf_api_sub_dial(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_agc(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_bgdial(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_auto_position(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_saymember(conference_obj_t *conference, switch_stream_handle_t *stream, const char *text); -switch_status_t conf_api_sub_check_record(conference_obj_t *conference, switch_stream_handle_t *stream, int arc, char **argv); -switch_status_t conf_api_sub_check_record(conference_obj_t *conference, switch_stream_handle_t *stream, int arc, char **argv); -switch_status_t conf_api_sub_volume_in(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_file_seek(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_stop(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_hup(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_pauserec(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_volume_out(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_lock(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_unlock(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_relate(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_pin(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_exit_sound(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_vid_banner(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_enter_sound(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_set(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_vid_res_id(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_get(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_vid_mute_img(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_vid_logo_img(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_vid_fps(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_write_png(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_file_vol(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_recording(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_vid_layout(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_list(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_xml_list(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_energy(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_watching_canvas(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_canvas(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_layer(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_kick(conf_member_t *member, switch_stream_handle_t *stream, void *data); -switch_status_t conf_api_sub_transfer(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_record(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_norecord(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_sub_vid_bandwidth(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); -switch_status_t conf_api_dispatch(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv, const char *cmdline, int argn); -switch_status_t conf_api_sub_syntax(char **syntax); -switch_status_t conf_api_main_real(const char *cmd, switch_core_session_t *session, switch_stream_handle_t *stream); +switch_status_t conference_api_sub_mute(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_tmute(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_unmute(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_vmute(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_tvmute(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_unvmute(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_deaf(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_undeaf(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_floor(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_vid_floor(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_clear_vid_floor(conference_obj_t *conference, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_position(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_conference_video_vmute_snap(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_dtmf(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_pause_play(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_play(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_say(conference_obj_t *conference, switch_stream_handle_t *stream, const char *text); +switch_status_t conference_api_sub_dial(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_agc(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_bgdial(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_auto_position(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_saymember(conference_obj_t *conference, switch_stream_handle_t *stream, const char *text); +switch_status_t conference_api_sub_check_record(conference_obj_t *conference, switch_stream_handle_t *stream, int arc, char **argv); +switch_status_t conference_api_sub_check_record(conference_obj_t *conference, switch_stream_handle_t *stream, int arc, char **argv); +switch_status_t conference_api_sub_volume_in(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_file_seek(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_stop(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_hup(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_pauserec(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_volume_out(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_lock(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_unlock(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_relate(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_pin(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_exit_sound(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_vid_banner(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_enter_sound(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_set(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_vid_res_id(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_get(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_vid_mute_img(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_vid_logo_img(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_vid_fps(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_write_png(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_file_vol(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_recording(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_vid_layout(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_list(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_xml_list(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_energy(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_watching_canvas(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_canvas(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_layer(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_kick(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_transfer(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_record(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_norecord(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_dispatch(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv, const char *cmdline, int argn); +switch_status_t conference_api_sub_syntax(char **syntax); +switch_status_t conference_api_main_real(const char *cmd, switch_core_session_t *session, switch_stream_handle_t *stream); -void conf_loop_mute_on(conf_member_t *member, caller_control_action_t *action); -void conf_loop_mute_toggle(conf_member_t *member, caller_control_action_t *action); -void conf_loop_energy_dn(conf_member_t *member, caller_control_action_t *action); -void conf_loop_energy_equ_conf(conf_member_t *member, caller_control_action_t *action); -void conf_loop_volume_talk_zero(conf_member_t *member, caller_control_action_t *action); -void conf_loop_volume_talk_up(conf_member_t *member, caller_control_action_t *action); -void conf_loop_volume_listen_dn(conf_member_t *member, caller_control_action_t *action); -void conf_loop_lock_toggle(conf_member_t *member, caller_control_action_t *action); -void conf_loop_volume_listen_up(conf_member_t *member, caller_control_action_t *action); -void conf_loop_volume_listen_zero(conf_member_t *member, caller_control_action_t *action); -void conf_loop_volume_talk_dn(conf_member_t *member, caller_control_action_t *action); -void conf_loop_energy_up(conf_member_t *member, caller_control_action_t *action); -void conf_loop_floor_toggle(conf_member_t *member, caller_control_action_t *action); -void conf_loop_vid_floor_toggle(conf_member_t *member, caller_control_action_t *action); -void conf_loop_energy_up(conf_member_t *member, caller_control_action_t *action); -void conf_loop_floor_toggle(conf_member_t *member, caller_control_action_t *action); -void conf_loop_vid_floor_force(conf_member_t *member, caller_control_action_t *action); -void conf_loop_vmute_off(conf_member_t *member, caller_control_action_t *action); -void conf_loop_conf_video_vmute_snap(conf_member_t *member, caller_control_action_t *action); -void conf_loop_conf_video_vmute_snapoff(conf_member_t *member, caller_control_action_t *action); -void conf_loop_vmute_toggle(conf_member_t *member, caller_control_action_t *action); -void conf_loop_vmute_on(conf_member_t *member, caller_control_action_t *action); -void conf_loop_deafmute_toggle(conf_member_t *member, caller_control_action_t *action); -void conf_loop_hangup(conf_member_t *member, caller_control_action_t *action); -void conf_loop_transfer(conf_member_t *member, caller_control_action_t *action); -void conf_loop_mute_off(conf_member_t *member, caller_control_action_t *action); -void conf_loop_event(conf_member_t *member, caller_control_action_t *action); -void conf_loop_transfer(conf_member_t *member, caller_control_action_t *action); -void conf_loop_exec_app(conf_member_t *member, caller_control_action_t *action); +void conference_loop_mute_on(conference_member_t *member, caller_control_action_t *action); +void conference_loop_mute_toggle(conference_member_t *member, caller_control_action_t *action); +void conference_loop_energy_dn(conference_member_t *member, caller_control_action_t *action); +void conference_loop_energy_equ_conf(conference_member_t *member, caller_control_action_t *action); +void conference_loop_volume_talk_zero(conference_member_t *member, caller_control_action_t *action); +void conference_loop_volume_talk_up(conference_member_t *member, caller_control_action_t *action); +void conference_loop_volume_listen_dn(conference_member_t *member, caller_control_action_t *action); +void conference_loop_lock_toggle(conference_member_t *member, caller_control_action_t *action); +void conference_loop_volume_listen_up(conference_member_t *member, caller_control_action_t *action); +void conference_loop_volume_listen_zero(conference_member_t *member, caller_control_action_t *action); +void conference_loop_volume_talk_dn(conference_member_t *member, caller_control_action_t *action); +void conference_loop_energy_up(conference_member_t *member, caller_control_action_t *action); +void conference_loop_floor_toggle(conference_member_t *member, caller_control_action_t *action); +void conference_loop_vid_floor_toggle(conference_member_t *member, caller_control_action_t *action); +void conference_loop_energy_up(conference_member_t *member, caller_control_action_t *action); +void conference_loop_floor_toggle(conference_member_t *member, caller_control_action_t *action); +void conference_loop_vid_floor_force(conference_member_t *member, caller_control_action_t *action); +void conference_loop_vmute_off(conference_member_t *member, caller_control_action_t *action); +void conference_loop_conference_video_vmute_snap(conference_member_t *member, caller_control_action_t *action); +void conference_loop_conference_video_vmute_snapoff(conference_member_t *member, caller_control_action_t *action); +void conference_loop_vmute_toggle(conference_member_t *member, caller_control_action_t *action); +void conference_loop_vmute_on(conference_member_t *member, caller_control_action_t *action); +void conference_loop_deafmute_toggle(conference_member_t *member, caller_control_action_t *action); +void conference_loop_hangup(conference_member_t *member, caller_control_action_t *action); +void conference_loop_transfer(conference_member_t *member, caller_control_action_t *action); +void conference_loop_mute_off(conference_member_t *member, caller_control_action_t *action); +void conference_loop_event(conference_member_t *member, caller_control_action_t *action); +void conference_loop_transfer(conference_member_t *member, caller_control_action_t *action); +void conference_loop_exec_app(conference_member_t *member, caller_control_action_t *action); @@ -1095,7 +1095,7 @@ void conf_loop_exec_app(conf_member_t *member, caller_control_action_t *action); /* API Interface Function sub-commands */ /* Entries in this list should be kept in sync with the enum above */ -extern api_command_t conf_api_sub_commands[]; +extern api_command_t conference_api_sub_commands[]; extern struct _mapping control_mappings[];