FS-7845 Rename functions so that they relate to the file that they are

located in.
This commit is contained in:
William King 2015-07-16 09:01:20 -07:00
parent 756ef77b7b
commit 14aa720512
12 changed files with 1865 additions and 1862 deletions

File diff suppressed because it is too large Load Diff

View File

@ -131,7 +131,6 @@ typedef enum {
CONF_SILENT_DONE = (1 << 1)
} conf_app_flag_t;
extern char *mod_conference_cf_name;
extern char *mod_conference_cf_name;
extern char *api_syntax;
extern int EC;
@ -143,7 +142,7 @@ typedef enum {
} file_stop_t;
/* Global Values */
typedef struct mod_conference_globals_s {
typedef struct conf_globals_s {
switch_memory_pool_t *conference_pool;
switch_mutex_t *conference_mutex;
switch_hash_t *conference_hash;
@ -154,13 +153,13 @@ typedef struct mod_conference_globals_s {
int32_t running;
uint32_t threads;
switch_event_channel_id_t event_channel_id;
} mod_conference_globals_t;
} conf_globals_t;
extern mod_conference_globals_t mod_conference_globals;
extern conf_globals_t conf_globals;
/* forward declaration for conference_obj and caller_control */
struct conference_member;
typedef struct conference_member conference_member_t;
typedef struct conference_member conf_member_t;
struct caller_control_actions;
@ -250,17 +249,17 @@ typedef enum {
CFLAG_MAX
} conference_flag_t;
typedef struct conference_cdr_node_s {
typedef struct conf_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;
conference_member_t *member;
conf_member_t *member;
switch_event_t *var_event;
struct conference_cdr_node_s *next;
} conference_cdr_node_t;
struct conf_cdr_node_s *next;
} conf_cdr_node_t;
typedef enum {
CDRR_LOCKED = 1,
@ -268,12 +267,12 @@ typedef enum {
CDRR_MAXMEMBERS
} cdr_reject_reason_t;
typedef struct conference_cdr_reject_s {
typedef struct conf_cdr_reject_s {
switch_caller_profile_t *cp;
switch_time_t reject_time;
cdr_reject_reason_t reason;
struct conference_cdr_reject_s *next;
} conference_cdr_reject_t;
struct conf_cdr_reject_s *next;
} conf_cdr_reject_t;
typedef enum {
CDRE_NONE,
@ -354,7 +353,7 @@ typedef struct al_handle_s {
ALfloat pos_z;
} al_handle_t;
void close_al(al_handle_t *al);
void conf_al_close(al_handle_t *al);
#else
typedef struct al_handle_s {
int unsupported;
@ -395,8 +394,8 @@ typedef struct conf_xml_cfg {
} conf_xml_cfg_t;
struct vid_helper {
conference_member_t *member_a;
conference_member_t *member_b;
conf_member_t *member_a;
conf_member_t *member_b;
int up;
};
@ -497,7 +496,7 @@ typedef struct conference_record {
switch_bool_t autorec;
struct conference_record *next;
switch_file_handle_t fh;
} conference_record_t;
} conf_record_t;
typedef enum {
CONF_VIDEO_MODE_PASSTHROUGH,
@ -570,8 +569,8 @@ typedef struct conference_obj {
uint32_t interval;
uint32_t channels;
switch_mutex_t *mutex;
conference_member_t *members;
conference_member_t *floor_holder;
conf_member_t *members;
conf_member_t *floor_holder;
uint32_t video_floor_holder;
uint32_t last_video_floor_holder;
switch_mutex_t *member_mutex;
@ -615,15 +614,15 @@ typedef struct conference_obj {
char *uuid_str;
uint32_t originating;
switch_call_cause_t cancel_cause;
conference_cdr_node_t *cdr_nodes;
conference_cdr_reject_t *cdr_rejected;
conf_cdr_node_t *cdr_nodes;
conf_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;
conference_record_t *rec_node_head;
conf_record_t *rec_node_head;
int last_speech_channels;
mcu_canvas_t *canvas;
mcu_canvas_t *canvases[MAX_CANVASES+1];
@ -674,7 +673,7 @@ struct conference_member {
switch_codec_t write_codec;
char *rec_path;
switch_time_t rec_time;
conference_record_t *rec;
conf_record_t *rec;
uint8_t *frame;
uint8_t *last_frame;
uint32_t frame_size;
@ -703,7 +702,7 @@ struct conference_member {
uint32_t avg_tally;
struct conference_member *next;
switch_ivr_dmachine_t *dmachine;
conference_cdr_node_t *cdr_node;
conf_cdr_node_t *cdr_node;
char *kicked_sound;
switch_queue_t *dtmf_queue;
switch_queue_t *video_queue;
@ -763,10 +762,10 @@ typedef struct codec_set_s {
uint8_t *packet;
} codec_set_t;
typedef void (*conf_key_callback_t) (conference_member_t *, struct caller_control_actions *);
typedef void (*conf_key_callback_t) (conf_member_t *, struct caller_control_actions *);
typedef struct {
conference_member_t *member;
conf_member_t *member;
caller_control_action_t action;
conf_key_callback_t handler;
} key_binding_t;
@ -826,121 +825,126 @@ struct bg_call {
/* FUNCTION DEFINITIONS */
switch_bool_t conference_test_flag(conference_obj_t *conference, conference_flag_t flag);
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);
uint32_t next_member_id(void);
void set_cflags(const char *flags, conference_flag_t *f);
void set_mflags(const char *flags, member_flag_t *f);
void merge_mflags(member_flag_t *a, member_flag_t *b);
void clear_eflags(char *events, uint32_t *f);
void pres_event_handler(switch_event_t *event);
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 call_setup_event_handler(switch_event_t *event);
void member_add_file_data(conference_member_t *member, int16_t *data, switch_size_t file_data_len);
void send_conference_notify(conference_obj_t *conference, const char *status, const char *call_id, switch_bool_t final);
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);
switch_status_t conference_file_close(conference_obj_t *conference, conference_file_node_t *node);
void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, void *obj);
void *SWITCH_THREAD_FUNC conf_record_thread_run(switch_thread_t *thread, void *obj);
void gen_arc(conference_obj_t *conference, switch_stream_handle_t *stream);
void process_al(al_handle_t *al, void *data, switch_size_t datalen, int rate);
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 member_set_flag_locked(conference_member_t *member, member_flag_t flag);
void member_set_flag(conference_member_t *member, member_flag_t flag);
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 member_update_status_field(conference_member_t *member);
void vmute_snap(conference_member_t *member, switch_bool_t clear);
void reset_video_bitrate_counters(conference_member_t *member);
void clear_layer(mcu_layer_t *layer);
int get_canvas_id(conference_member_t *member, const char *val, switch_bool_t watching);
void reset_member_codec_index(conference_member_t *member);
void detach_video_layer(conference_member_t *member);
void conference_set_flag(conference_obj_t *conference, conference_flag_t flag);
void conference_set_flag_locked(conference_obj_t *conference, conference_flag_t flag);
void conference_clear_flag(conference_obj_t *conference, conference_flag_t flag);
void conference_clear_flag_locked(conference_obj_t *conference, conference_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);
int setup_media(conference_member_t *member, conference_obj_t *conference);
int conf_member_setup_media(conf_member_t *member, conference_obj_t *conference);
al_handle_t *create_al(switch_memory_pool_t *pool);
switch_status_t member_parse_position(conference_member_t *member, const char *data);
video_layout_t *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_set_floor_holder(conference_obj_t *conference, conference_member_t *member);
void member_clear_flag(conference_member_t *member, member_flag_t flag);
void member_clear_flag_locked(conference_member_t *member, member_flag_t flag);
switch_status_t attach_video_layer(conference_member_t *member, mcu_canvas_t *canvas, int idx);
int conference_set_fps(conference_obj_t *conference, float fps);
void layer_set_logo(conference_member_t *member, mcu_layer_t *layer, const char *path);
void layer_set_banner(conference_member_t *member, mcu_layer_t *layer, const char *text);
void switch_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 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 send_json_event(conference_obj_t *conference);
void send_rfc_event(conference_obj_t *conference);
void member_update_status_field(conference_member_t *member);
void conference_command_handler(switch_live_array_t *la, const char *cmd, const char *sessid, cJSON *jla, void *user_data);
void adv_la(conference_obj_t *conference, conference_member_t *member, switch_bool_t join);
switch_status_t init_canvas(conference_obj_t *conference, video_layout_t *vlayout, mcu_canvas_t **canvasP);
switch_status_t attach_canvas(conference_obj_t *conference, mcu_canvas_t *canvas, int super);
void init_canvas_layers(conference_obj_t *conference, mcu_canvas_t *canvas, video_layout_t *vlayout);
switch_status_t attach_video_layer(conference_member_t *member, mcu_canvas_t *canvas, int idx);
void reset_video_bitrate_counters(conference_member_t *member);
void layer_set_banner(conference_member_t *member, mcu_layer_t *layer, const char *text);
void layer_set_logo(conference_member_t *member, mcu_layer_t *layer, const char *path);
void detach_video_layer(conference_member_t *member);
void check_used_layers(mcu_canvas_t *canvas);
void set_canvas_letterbox_bgcolor(mcu_canvas_t *canvas, char *color);
void set_canvas_bgcolor(mcu_canvas_t *canvas, char *color);
void scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg, switch_bool_t freeze);
void reset_layer(mcu_layer_t *layer);
void clear_layer(mcu_layer_t *layer);
void reset_image(switch_image_t *img, switch_rgb_color_t *color);
void conference_parse_layouts(conference_obj_t *conference, int WIDTH, int HEIGHT);
int conference_set_fps(conference_obj_t *conference, float fps);
video_layout_t *get_layout(conference_obj_t *conference, const char *video_layout_name, const char *video_layout_group);
void check_avatar(conference_member_t *member, switch_bool_t force);
void find_video_floor(conference_member_t *member, switch_bool_t entering);
void destroy_canvas(mcu_canvas_t **canvasP);
void fnode_check_video(conference_file_node_t *fnode);
switch_status_t parse_position(al_handle_t *al, const char *data);
switch_status_t 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 check_agc_levels(conference_member_t *member);
void clear_avg(conference_member_t *member);
int noise_gate_check(conference_member_t *member);
void member_check_channels(switch_frame_t *frame, conference_member_t *member, switch_bool_t in);
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);
void switch_fnode_toggle_pause(conference_file_node_t *fnode, switch_stream_handle_t *stream);
void conf_fnode_toggle_pause(conference_file_node_t *fnode, switch_stream_handle_t *stream);
// static conference_relationship_t *member_get_relationship(conference_member_t *member, conference_member_t *other_member);
// static conference_relationship_t *conf_member_get_relationship(conf_member_t *member, conf_member_t *other_member);
// static void conference_list(conference_obj_t *conference, switch_stream_handle_t *stream, char *delim);
conference_relationship_t *member_add_relationship(conference_member_t *member, uint32_t id);
conference_member_t *conference_member_get(conference_obj_t *conference, uint32_t id);
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);
switch_status_t member_del_relationship(conference_member_t *member, uint32_t id);
switch_status_t conference_add_member(conference_obj_t *conference, conference_member_t *member);
switch_status_t conference_del_member(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_super_video_muxing_thread_run(switch_thread_t *thread, void *obj);
void conference_loop_output(conference_member_t *member);
uint32_t conference_stop_file(conference_obj_t *conference, file_stop_t stop);
switch_status_t conference_play_file(conference_obj_t *conference, char *file, uint32_t leadin, switch_channel_t *channel, uint8_t async);
void conference_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 member_bind_controls(conference_member_t *member, const char *controls);
void conference_send_presence(conference_obj_t *conference);
void conference_set_video_floor_holder(conference_obj_t *conference, conference_member_t *member, switch_bool_t force);
void canvas_del_fnode_layer(conference_obj_t *conference, conference_file_node_t *fnode);
void canvas_set_fnode_layer(mcu_canvas_t *canvas, conference_file_node_t *fnode, int idx);
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);
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_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();
switch_status_t conference_outcall(conference_obj_t *conference,
switch_status_t conf_outcall(conference_obj_t *conference,
char *conference_name,
switch_core_session_t *session,
char *bridgeto, uint32_t timeout,
@ -950,61 +954,61 @@ switch_status_t conference_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 conference_outcall_bg(conference_obj_t *conference,
switch_status_t conf_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 launch_conference_video_muxing_thread(conference_obj_t *conference, mcu_canvas_t *canvas, int super);
void launch_conference_thread(conference_obj_t *conference);
void launch_conference_video_muxing_write_thread(conference_member_t *member);
void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *obj);
switch_status_t conference_local_play_file(conference_obj_t *conference, switch_core_session_t *session, char *path, uint32_t leadin, void *buf,
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);
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 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, conf_xml_cfg_t cfg, switch_core_session_t *session, switch_memory_pool_t *pool);
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 chat_send(switch_event_t *message_event);
void launch_conference_record_thread(conference_obj_t *conference, char *path, switch_bool_t autorec);
void conf_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) (conference_member_t *, switch_stream_handle_t *, void *);
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 *);
switch_status_t conference_add_event_data(conference_obj_t *conference, switch_event_t *event);
switch_status_t conference_add_event_member_data(conference_member_t *member, switch_event_t *event);
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);
cJSON *conference_json_render(conference_obj_t *conference, cJSON *req);
char *conference_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_la_event_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id);
void conference_mod_event_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id);
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);
void conference_member_itterator(conference_obj_t *conference, switch_stream_handle_t *stream, uint8_t non_mod, conf_api_member_cmd_t pfncallback, void *data);
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);
switch_status_t conf_api_sub_mute(conference_member_t *member, switch_stream_handle_t *stream, void *data);
switch_status_t conf_api_sub_tmute(conference_member_t *member, switch_stream_handle_t *stream, void *data);
switch_status_t conf_api_sub_unmute(conference_member_t *member, switch_stream_handle_t *stream, void *data);
switch_status_t conf_api_sub_vmute(conference_member_t *member, switch_stream_handle_t *stream, void *data);
switch_status_t conf_api_sub_tvmute(conference_member_t *member, switch_stream_handle_t *stream, void *data);
switch_status_t conf_api_sub_unvmute(conference_member_t *member, switch_stream_handle_t *stream, void *data);
switch_status_t conf_api_sub_deaf(conference_member_t *member, switch_stream_handle_t *stream, void *data);
switch_status_t conf_api_sub_undeaf(conference_member_t *member, switch_stream_handle_t *stream, void *data);
switch_status_t conf_api_sub_floor(conference_member_t *member, switch_stream_handle_t *stream, void *data);
switch_status_t conf_api_sub_vid_floor(conference_member_t *member, switch_stream_handle_t *stream, 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(conference_member_t *member, switch_stream_handle_t *stream, void *data);
switch_status_t conf_api_sub_vmute_snap(conference_member_t *member, switch_stream_handle_t *stream, void *data);
switch_status_t conf_api_sub_dtmf(conference_member_t *member, 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);
@ -1015,24 +1019,24 @@ switch_status_t conf_api_sub_auto_position(conference_obj_t *conference, switch_
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(conference_member_t *member, switch_stream_handle_t *stream, void *data);
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(conference_member_t *member, switch_stream_handle_t *stream, void *data);
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(conference_member_t *member, switch_stream_handle_t *stream, void *data);
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(conference_member_t *member, switch_stream_handle_t *stream, void *data);
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(conference_member_t *member, switch_stream_handle_t *stream, void *data);
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(conference_member_t *member, switch_stream_handle_t *stream, void *data);
switch_status_t conf_api_sub_vid_logo_img(conference_member_t *member, switch_stream_handle_t *stream, void *data);
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);
@ -1040,11 +1044,11 @@ switch_status_t conf_api_sub_recording(conference_obj_t *conference, switch_stre
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(conference_member_t *member, switch_stream_handle_t *stream, void *data);
switch_status_t conf_api_sub_watching_canvas(conference_member_t *member, switch_stream_handle_t *stream, void *data);
switch_status_t conf_api_sub_canvas(conference_member_t *member, switch_stream_handle_t *stream, void *data);
switch_status_t conf_api_sub_layer(conference_member_t *member, switch_stream_handle_t *stream, void *data);
switch_status_t conf_api_sub_kick(conference_member_t *member, switch_stream_handle_t *stream, void *data);
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);
@ -1054,35 +1058,35 @@ 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);
void conference_loop_fn_mute_on(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_mute_toggle(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_energy_dn(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_energy_equ_conf(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_volume_talk_zero(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_volume_talk_up(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_volume_listen_dn(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_lock_toggle(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_volume_listen_up(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_volume_listen_zero(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_volume_talk_dn(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_energy_up(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_floor_toggle(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_vid_floor_toggle(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_energy_up(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_floor_toggle(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_vid_floor_force(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_vmute_off(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_vmute_snap(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_vmute_snapoff(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_vmute_toggle(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_vmute_on(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_deafmute_toggle(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_hangup(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_transfer(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_mute_off(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_event(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_transfer(conference_member_t *member, caller_control_action_t *action);
void conference_loop_fn_exec_app(conference_member_t *member, caller_control_action_t *action);
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);

View File

@ -43,7 +43,7 @@
al_handle_t *create_al(switch_memory_pool_t *pool)
al_handle_t *conf_al_create(switch_memory_pool_t *pool)
{
al_handle_t *al;
@ -54,22 +54,22 @@ al_handle_t *create_al(switch_memory_pool_t *pool)
}
#ifndef OPENAL_POSITIONING
void gen_arc(conference_obj_t *conference, switch_stream_handle_t *stream)
void conf_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t *stream)
{
}
void process_al(al_handle_t *al, void *data, switch_size_t datalen, int rate)
void conf_al_process(al_handle_t *al, void *data, switch_size_t datalen, int rate)
{
}
#else
void gen_arc(conference_obj_t *conference, switch_stream_handle_t *stream)
void conf_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;
conference_member_t *member;
conf_member_t *member;
uint32_t count = 0;
if (!conference->count) {
@ -78,14 +78,14 @@ void gen_arc(conference_obj_t *conference, switch_stream_handle_t *stream)
switch_mutex_lock(conference->member_mutex);
for (member = conference->members; member; member = member->next) {
if (member->channel && member_test_flag(member, MFLAG_CAN_SPEAK) && !member_test_flag(member, MFLAG_NO_POSITIONAL)) {
if (member->channel && conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK) && !conf_utils_member_test_flag(member, MFLAG_NO_POSITIONAL)) {
count++;
}
}
if (count < 3) {
for (member = conference->members; member; member = member->next) {
if (member->channel && !member_test_flag(member, MFLAG_NO_POSITIONAL) && member->al) {
if (member->channel && !conf_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 gen_arc(conference_obj_t *conference, switch_stream_handle_t *stream)
for (member = conference->members; member; member = member->next) {
if (!member->channel || member_test_flag(member, MFLAG_NO_POSITIONAL) || !member_test_flag(member, MFLAG_CAN_SPEAK)) {
if (!member->channel || conf_utils_member_test_flag(member, MFLAG_NO_POSITIONAL) || !conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) {
continue;
}
if (!member->al) {
member->al = create_al(member->pool);
member->al = conf_al_create(member->pool);
}
member_set_flag(member, MFLAG_POSITIONAL);
conf_utils_member_set_flag(member, MFLAG_POSITIONAL);
if (pos == 0) {
x = 0;
@ -163,7 +163,7 @@ void gen_arc(conference_obj_t *conference, switch_stream_handle_t *stream)
void process_al(al_handle_t *al, void *data, switch_size_t datalen, int rate)
void conf_al_process(al_handle_t *al, void *data, switch_size_t datalen, int rate)
{
if (rate != 48000) {
@ -180,7 +180,7 @@ void process_al(al_handle_t *al, void *data, switch_size_t datalen, int rate)
0
};
switch_mutex_lock(mod_conference_globals.setup_mutex);
switch_mutex_lock(conf_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 process_al(al_handle_t *al, void *data, switch_size_t datalen, int rate)
alSourceQueueBuffers(al->source, 2, al->buffer_in);
alSourcePlay(al->source);
}
switch_mutex_unlock(mod_conference_globals.setup_mutex);
switch_mutex_unlock(conf_globals.setup_mutex);
}
if (al->device) {
@ -237,42 +237,14 @@ void process_al(al_handle_t *al, void *data, switch_size_t datalen, int rate)
}
#endif
void check_agc_levels(conference_member_t *member)
{
int x = 0;
if (!member->avg_score) return;
if ((int)member->avg_score < member->conference->agc_level - 100) {
member->agc_volume_in_level++;
switch_normalize_volume_granular(member->agc_volume_in_level);
x = 1;
} else if ((int)member->avg_score > member->conference->agc_level + 100) {
member->agc_volume_in_level--;
switch_normalize_volume_granular(member->agc_volume_in_level);
x = -1;
}
if (x) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG7,
"AGC %s:%d diff:%d level:%d cur:%d avg:%d vol:%d %s\n",
member->conference->name,
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 ? "+++" : "---");
clear_avg(member);
}
}
#ifndef OPENAL_POSITIONING
switch_status_t parse_position(al_handle_t *al, const char *data)
switch_status_t conf_al_parse_position(al_handle_t *al, const char *data)
{
return SWITCH_STATUS_FALSE;
}
#else
switch_status_t parse_position(al_handle_t *al, const char *data)
switch_status_t conf_al_parse_position(al_handle_t *al, const char *data)
{
char *args[3];
int num;
@ -297,31 +269,12 @@ switch_status_t parse_position(al_handle_t *al, const char *data)
}
#endif
#ifndef OPENAL_POSITIONING
switch_status_t member_parse_position(conference_member_t *member, const char *data)
{
return SWITCH_STATUS_FALSE;
}
#else
switch_status_t member_parse_position(conference_member_t *member, const char *data)
{
switch_status_t status = SWITCH_STATUS_FALSE;
if (member->al) {
status = parse_position(member->al, data);
}
return status;
}
#endif
#ifdef OPENAL_POSITIONING
void close_al(al_handle_t *al)
void conf_al_close(al_handle_t *al)
{
if (!al) return;
switch_mutex_lock(mod_conference_globals.setup_mutex);
switch_mutex_lock(conf_globals.setup_mutex);
if (al->source) {
alDeleteSources(1, &al->source);
al->source = 0;
@ -342,7 +295,7 @@ void close_al(al_handle_t *al)
alcCloseDevice(al->device);
al->device = NULL;
}
switch_mutex_unlock(mod_conference_globals.setup_mutex);
switch_mutex_unlock(conf_globals.setup_mutex);
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -42,28 +42,28 @@
#include <mod_conference.h>
inline switch_bool_t cdr_test_mflag(conference_cdr_node_t *np, member_flag_t mflag)
inline switch_bool_t conf_cdr_test_mflag(conf_cdr_node_t *np, member_flag_t mflag)
{
return !!np->mflags[mflag];
}
const char *audio_flow(conference_member_t *member)
const char *conf_cdr_audio_flow(conf_member_t *member)
{
const char *flow = "sendrecv";
if (!member_test_flag(member, MFLAG_CAN_SPEAK)) {
if (!conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) {
flow = "recvonly";
}
if (member->channel && switch_channel_test_flag(member->channel, CF_HOLD)) {
flow = member_test_flag(member, MFLAG_CAN_SPEAK) ? "sendonly" : "inactive";
flow = conf_utils_member_test_flag(member, MFLAG_CAN_SPEAK) ? "sendonly" : "inactive";
}
return flow;
}
char *conference_rfc4579_render(conference_obj_t *conference, switch_event_t *event, switch_event_t *revent)
char *conf_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 *conference_rfc4579_render(conference_obj_t *conference, switch_event_t *ev
char *dup_domain = NULL;
char *uri;
int off = 0, off1 = 0, off2 = 0, off3 = 0, off4 = 0;
conference_cdr_node_t *np;
conf_cdr_node_t *np;
char *tmpp = tmp;
char *xml_text = NULL;
@ -276,7 +276,7 @@ char *conference_rfc4579_render(conference_obj_t *conference, switch_event_t *ev
if (!(x_tag4 = switch_xml_add_child_d(x_tag3, "status", off4++))) {
abort();
}
switch_xml_set_txt_d(x_tag4, audio_flow(np->member));
switch_xml_set_txt_d(x_tag4, conf_cdr_audio_flow(np->member));
if (switch_channel_test_flag(channel, CF_VIDEO)) {
@ -327,13 +327,13 @@ char *conference_rfc4579_render(conference_obj_t *conference, switch_event_t *ev
}
cJSON *conference_json_render(conference_obj_t *conference, cJSON *req)
cJSON *conf_cdr_json_render(conference_obj_t *conference, cJSON *req)
{
char tmp[30];
const char *domain; const char *name;
char *dup_domain = NULL;
char *uri;
conference_cdr_node_t *np;
conf_cdr_node_t *np;
char *tmpp = tmp;
cJSON *json = cJSON_CreateObject(), *jusers = NULL, *jold_users = NULL, *juser = NULL, *jvars = NULL;
@ -457,7 +457,7 @@ cJSON *conference_json_render(conference_obj_t *conference, cJSON *req)
json_add_child_string(juser, "rtpAudioSSRC", var);
}
json_add_child_string(juser, "rtpAudioDirection", audio_flow(np->member));
json_add_child_string(juser, "rtpAudioDirection", conf_cdr_audio_flow(np->member));
if (switch_channel_test_flag(channel, CF_VIDEO)) {
@ -486,7 +486,7 @@ cJSON *conference_json_render(conference_obj_t *conference, cJSON *req)
return json;
}
void conference_cdr_del(conference_member_t *member)
void conf_cdr_del(conf_member_t *member)
{
if (member->channel) {
switch_channel_get_variables(member->channel, &member->cdr_node->var_event);
@ -498,9 +498,9 @@ void conference_cdr_del(conference_member_t *member)
}
}
void conference_cdr_add(conference_member_t *member)
void conf_cdr_add(conf_member_t *member)
{
conference_cdr_node_t *np;
conf_cdr_node_t *np;
switch_caller_profile_t *cp;
switch_channel_t *channel;
@ -530,9 +530,9 @@ 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 conf_cdr_rejected(conference_obj_t *conference, switch_channel_t *channel, cdr_reject_reason_t reason)
{
conference_cdr_reject_t *rp;
conf_cdr_reject_t *rp;
switch_caller_profile_t *cp;
rp = switch_core_alloc(conference->pool, sizeof(*rp));
@ -549,11 +549,11 @@ void conference_cdr_rejected(conference_obj_t *conference, switch_channel_t *cha
rp->cp = switch_caller_profile_dup(conference->pool, cp);
}
void conference_cdr_render(conference_obj_t *conference)
void conf_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;
conference_cdr_node_t *np;
conference_cdr_reject_t *rp;
conf_cdr_node_t *np;
conf_cdr_reject_t *rp;
int cdr_off = 0, conf_off = 0;
char str[512];
char *path = NULL, *xml_text;
@ -605,7 +605,7 @@ void conference_cdr_render(conference_obj_t *conference)
if (!(x_ptr = switch_xml_add_child_d(x_conference, "end_time", conf_off++))) {
abort();
}
switch_xml_set_attr_d(x_ptr, "endconf_forced", conference_test_flag(conference, CFLAG_ENDCONF_FORCED) ? "true" : "false");
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, "type", "UNIX-epoch");
switch_snprintf(str, sizeof(str), "%ld", (long)conference->end_time);
switch_xml_set_txt_d(x_ptr, str);
@ -647,16 +647,16 @@ void conference_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, cdr_test_mflag(np, MFLAG_MOD) ? "true" : "false");
switch_xml_set_txt_d(x_tag, conf_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, cdr_test_mflag(np, MFLAG_ENDCONF) ? "true" : "false");
switch_xml_set_txt_d(x_tag, conf_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, cdr_test_mflag(np, MFLAG_KICKED) ? "true" : "false");
switch_xml_set_txt_d(x_tag, conf_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, cdr_test_mflag(np, MFLAG_GHOST) ? "true" : "false");
switch_xml_set_txt_d(x_tag, conf_cdr_test_mflag(np, MFLAG_GHOST) ? "true" : "false");
if (!(x_cp = switch_xml_add_child_d(x_member, "caller_profile", member_off++))) {
abort();

View File

@ -42,7 +42,7 @@
#include <mod_conference.h>
void conference_mod_event_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 *data, *addobj = NULL;
const char *action = NULL;
@ -124,14 +124,14 @@ void conference_mod_event_channel_handler(const char *event_channel, cJSON *json
exec = switch_mprintf("%s %s %s %s", conf_name, action, argv[0], argv[1]);
} else if (!strcasecmp(action, "transfer") && cid) {
conference_member_t *member;
conf_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 = conference_find(conf_name, NULL))) {
if ((member = conference_member_get(conference, cid))) {
if ((conference = conf_find(conf_name, NULL))) {
if ((member = conf_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 conference_mod_event_channel_handler(const char *event_channel, cJSON *json
const void *vvar;
cJSON *array = cJSON_CreateArray();
conference_obj_t *conference = NULL;
if ((conference = conference_find(conf_name, NULL))) {
switch_mutex_lock(mod_conference_globals.setup_mutex);
if ((conference = conf_find(conf_name, NULL))) {
switch_mutex_lock(conf_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,7 +163,7 @@ void conference_mod_event_channel_handler(const char *event_channel, cJSON *json
}
}
switch_mutex_unlock(mod_conference_globals.setup_mutex);
switch_mutex_unlock(conf_globals.setup_mutex);
switch_thread_rwlock_unlock(conference->rwlock);
}
addobj = array;
@ -193,7 +193,7 @@ void conference_mod_event_channel_handler(const char *event_channel, cJSON *json
cJSON_AddItemToObject(jdata, "error", cJSON_CreateString("Invalid Command"));
}
switch_event_channel_broadcast(event_channel, &msg, __FILE__, mod_conference_globals.event_channel_id);
switch_event_channel_broadcast(event_channel, &msg, __FILE__, conf_globals.event_channel_id);
switch_safe_free(stream.data);
@ -203,12 +203,12 @@ void conference_mod_event_channel_handler(const char *event_channel, cJSON *json
}
void conference_la_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)
{
switch_live_array_parse_json(json, mod_conference_globals.event_channel_id);
switch_live_array_parse_json(json, conf_globals.event_channel_id);
}
void conference_event_channel_handler(const char *event_channel, cJSON *json, const char *key, switch_event_channel_id_t id)
void conf_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;
@ -236,8 +236,8 @@ void conference_event_channel_handler(const char *event_channel, cJSON *json, co
}
if (!strcasecmp(action, "bootstrap")) {
if (!zstr(name) && (conference = conference_find(name, domain))) {
conf_desc = conference_json_render(conference, json);
if (!zstr(name) && (conference = conf_find(name, domain))) {
conf_desc = conf_cdr_json_render(conference, json);
} else {
conf_desc = cJSON_CreateObject();
json_add_child_string(conf_desc, "conferenceDescription", "FreeSWITCH Conference");
@ -256,20 +256,20 @@ void conference_event_channel_handler(const char *event_channel, cJSON *json, co
switch_safe_free(dup);
switch_event_channel_broadcast(event_channel, &reply, "mod_conference", mod_conference_globals.event_channel_id);
switch_event_channel_broadcast(event_channel, &reply, "mod_conference", conf_globals.event_channel_id);
}
void send_json_event(conference_obj_t *conference)
void conf_event_send_json(conference_obj_t *conference)
{
cJSON *event, *conf_desc = NULL;
char *name = NULL, *domain = NULL, *dup_domain = NULL;
char *event_channel = NULL;
if (!conference_test_flag(conference, CFLAG_JSON_EVENTS)) {
if (!conf_utils_test_flag(conference, CFLAG_JSON_EVENTS)) {
return;
}
conf_desc = conference_json_render(conference, NULL);
conf_desc = conf_cdr_json_render(conference, NULL);
if (!(name = conference->name)) {
name = "conference";
@ -289,103 +289,18 @@ void send_json_event(conference_obj_t *conference)
json_add_child_string(event, "eventChannel", event_channel);
cJSON_AddItemToObject(event, "data", conf_desc);
switch_event_channel_broadcast(event_channel, &event, "mod_conference", mod_conference_globals.event_channel_id);
switch_event_channel_broadcast(event_channel, &event, "mod_conference", conf_globals.event_channel_id);
switch_safe_free(dup_domain);
switch_safe_free(event_channel);
}
void conference_command_handler(switch_live_array_t *la, const char *cmd, const char *sessid, cJSON *jla, void *user_data)
void conf_event_la_command_handler(switch_live_array_t *la, const char *cmd, const char *sessid, cJSON *jla, void *user_data)
{
}
void 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) || member_test_flag(member, MFLAG_SECOND_SCREEN)) {
return;
}
switch_live_array_lock(member->conference->la);
if (conference_test_flag(member->conference, CFLAG_JSON_STATUS)) {
json = cJSON_CreateObject();
audio = cJSON_CreateObject();
cJSON_AddItemToObject(audio, "muted", cJSON_CreateBool(!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(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);
if (switch_channel_test_flag(member->channel, CF_VIDEO) || member->avatar_png_img) {
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(!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 && conference_test_flag(member->conference, CFLAG_VID_FLOOR_LOCK)) {
cJSON_AddItemToObject(video, "floorLocked", cJSON_CreateTrue());
}
cJSON_AddItemToObject(video, "reservationID", member->video_reservation_id ?
cJSON_CreateString(member->video_reservation_id) : cJSON_CreateNull());
cJSON_AddItemToObject(video, "videoLayerID", cJSON_CreateNumber(member->video_layer_id));
cJSON_AddItemToObject(json, "video", video);
} else {
cJSON_AddItemToObject(json, "video", cJSON_CreateFalse());
}
json_display = cJSON_PrintUnformatted(json);
cJSON_Delete(json);
} else {
if (!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 (member_test_flag(member, MFLAG_TALKING)) {
str = "TALKING (FLOOR)";
} else {
str = "FLOOR";
}
} else if (member_test_flag(member, MFLAG_TALKING)) {
str = "TALKING";
} else {
str = "ACTIVE";
}
if (switch_channel_test_flag(member->channel, CF_VIDEO)) {
if (!member_test_flag(member, MFLAG_CAN_BE_SEEN)) {
vstr = " VIDEO (BLIND)";
} else {
vstr = " VIDEO";
if (member && member->id == member->conference->video_floor_holder) {
vstr = " VIDEO (FLOOR)";
}
}
}
switch_snprintf(display, sizeof(display), "%s%s", str, vstr);
}
if (json_display) {
member->status_field->valuestring = json_display;
} else {
free(member->status_field->valuestring);
member->status_field->valuestring = strdup(display);
}
switch_live_array_add(member->conference->la, switch_core_session_get_uuid(member->session), -1, &member->json, SWITCH_FALSE);
switch_live_array_unlock(member->conference->la);
}
void adv_la(conference_obj_t *conference, conference_member_t *member, switch_bool_t join)
void conf_event_adv_la(conference_obj_t *conference, conf_member_t *member, switch_bool_t join)
{
//if (member->video_flow == SWITCH_MEDIA_FLOW_SENDONLY) {
@ -411,15 +326,15 @@ void adv_la(conference_obj_t *conference, conference_member_t *member, switch_bo
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(member_test_flag(member, MFLAG_MOD) ? "moderator" : "participant"));
cJSON_AddItemToObject(data, "role", cJSON_CreateString(conf_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 (member_test_flag(member, MFLAG_SECOND_SCREEN)) {
if (conf_utils_member_test_flag(member, MFLAG_SECOND_SCREEN)) {
cJSON_AddItemToObject(data, "secondScreen", cJSON_CreateTrue());
}
if (member_test_flag(member, MFLAG_MOD)) {
if (conf_utils_member_test_flag(member, MFLAG_MOD)) {
cJSON_AddItemToObject(data, "modChannel", cJSON_CreateString(conference->mod_event_channel));
}
@ -434,7 +349,7 @@ void adv_la(conference_obj_t *conference, conference_member_t *member, switch_bo
}
switch_event_destroy(&variables);
switch_event_channel_broadcast(event_channel, &msg, "mod_conference", mod_conference_globals.event_channel_id);
switch_event_channel_broadcast(event_channel, &msg, "mod_conference", conf_globals.event_channel_id);
if (cookie) {
switch_event_channel_permission_modify(cookie, conference->la_event_channel, join);
@ -443,13 +358,13 @@ void adv_la(conference_obj_t *conference, conference_member_t *member, switch_bo
}
}
void send_rfc_event(conference_obj_t *conference)
void conf_event_send_rfc(conference_obj_t *conference)
{
switch_event_t *event;
char *body;
char *name = NULL, *domain = NULL, *dup_domain = NULL;
if (!conference_test_flag(conference, CFLAG_RFC4579)) {
if (!conf_utils_test_flag(conference, CFLAG_RFC4579)) {
return;
}
@ -471,7 +386,7 @@ void send_rfc_event(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 = conference_rfc4579_render(conference, NULL, event);
body = conf_cdr_rfc4579_render(conference, NULL, event);
switch_event_add_body(event, "%s", body);
free(body);
switch_event_fire(&event);
@ -482,7 +397,7 @@ void send_rfc_event(conference_obj_t *conference)
}
switch_status_t conference_add_event_data(conference_obj_t *conference, switch_event_t *event)
switch_status_t conf_event_add_data(conference_obj_t *conference, switch_event_t *event)
{
switch_status_t status = SWITCH_STATUS_SUCCESS;
@ -495,49 +410,10 @@ switch_status_t conference_add_event_data(conference_obj_t *conference, switch_e
return status;
}
switch_status_t conference_add_event_member_data(conference_member_t *member, switch_event_t *event)
{
switch_status_t status = SWITCH_STATUS_SUCCESS;
if (!member)
return status;
if (member->conference) {
status = conference_add_event_data(member->conference, event);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Floor", "%s", (member == member->conference->floor_holder) ? "true" : "false" );
}
if (member->session) {
switch_channel_t *channel = switch_core_session_get_channel(member->session);
if (member->verbose_events) {
switch_channel_event_set_data(channel, event);
} else {
switch_channel_event_set_basic_data(channel, event);
}
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Video", "%s",
switch_channel_test_flag(switch_core_session_get_channel(member->session), CF_VIDEO) ? "true" : "false" );
}
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Hear", "%s", member_test_flag(member, MFLAG_CAN_HEAR) ? "true" : "false" );
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "See", "%s", member_test_flag(member, MFLAG_CAN_BE_SEEN) ? "true" : "false" );
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Speak", "%s", member_test_flag(member, MFLAG_CAN_SPEAK) ? "true" : "false" );
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Talking", "%s", member_test_flag(member, MFLAG_TALKING) ? "true" : "false" );
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Mute-Detect", "%s", 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", member_test_flag(member, MFLAG_MOD) ? "moderator" : "member");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-Ghost", "%s", 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);
return status;
}
/* send a message to every member of the conference */
void chat_message_broadcast(conference_obj_t *conference, switch_event_t *event)
void conf_event_chat_message_broadcast(conference_obj_t *conference, switch_event_t *event)
{
conference_member_t *member = NULL;
conf_member_t *member = NULL;
switch_event_t *processed;
switch_assert(conference != NULL);
@ -545,7 +421,7 @@ void chat_message_broadcast(conference_obj_t *conference, switch_event_t *event)
switch_mutex_lock(conference->member_mutex);
for (member = conference->members; member; member = member->next) {
if (member->session && !member_test_flag(member, MFLAG_NOCHANNEL)) {
if (member->session && !conf_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;
@ -570,7 +446,7 @@ void chat_message_broadcast(conference_obj_t *conference, switch_event_t *event)
switch_mutex_unlock(conference->member_mutex);
}
void call_setup_event_handler(switch_event_t *event)
void conf_event_call_setup_handler(switch_event_t *event)
{
switch_status_t status = SWITCH_STATUS_FALSE;
conference_obj_t *conference = NULL;
@ -586,11 +462,11 @@ void call_setup_event_handler(switch_event_t *event)
if (!ext) ext = dial_str;
if (!zstr(conf) && !zstr(dial_str) && !zstr(action) && (conference = conference_find(conf, domain))) {
if (!zstr(conf) && !zstr(dial_str) && !zstr(action) && (conference = conf_find(conf, domain))) {
switch_event_t *var_event;
switch_event_header_t *hp;
if (conference_test_flag(conference, CFLAG_RFC4579)) {
if (conf_utils_test_flag(conference, CFLAG_RFC4579)) {
char *key = switch_mprintf("conf_%s_%s_%s_%s", conference->name, conference->domain, ext, ext_domain);
char *expanded = NULL, *ostr = dial_str;;
@ -627,7 +503,7 @@ void call_setup_event_handler(switch_event_t *event)
}
}
status = conference_outcall_bg(conference, NULL, NULL, ostr, 60, NULL, NULL, NULL, NULL, NULL, NULL, &var_event);
status = conf_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);
@ -636,9 +512,9 @@ void call_setup_event_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)) {
send_conference_notify(conference, "SIP/2.0 200 OK\r\n", call_id, SWITCH_TRUE);
conf_send_notify(conference, "SIP/2.0 200 OK\r\n", call_id, SWITCH_TRUE);
} else {
send_conference_notify(conference, "SIP/2.0 481 Failure\r\n", call_id, SWITCH_TRUE);
conf_send_notify(conference, "SIP/2.0 481 Failure\r\n", call_id, SWITCH_TRUE);
}
status = SWITCH_STATUS_SUCCESS;
}
@ -679,14 +555,14 @@ void conf_data_event_handler(switch_event_t *event)
conference_obj_t *conference = NULL;
char *body = NULL;
if (!zstr(name) && (conference = conference_find(name, domain))) {
if (conference_test_flag(conference, CFLAG_RFC4579)) {
if (!zstr(name) && (conference = conf_find(name, domain))) {
if (conf_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 = conference_rfc4579_render(conference, event, revent);
body = conf_cdr_rfc4579_render(conference, event, revent);
switch_event_add_body(revent, "%s", body);
switch_event_fire(&revent);
switch_safe_free(body);
@ -696,7 +572,7 @@ void conf_data_event_handler(switch_event_t *event)
}
void pres_event_handler(switch_event_t *event)
void conf_event_pres_handler(switch_event_t *event)
{
char *to = switch_event_get_header(event, "to");
char *domain_name = NULL;
@ -721,7 +597,7 @@ void pres_event_handler(switch_event_t *event)
dup_conf_name = switch_mprintf("%q@%q", conf_name, domain_name);
if ((conference = conference_find(conf_name, NULL)) || (conference = conference_find(dup_conf_name, NULL))) {
if ((conference = conf_find(conf_name, NULL)) || (conference = conf_find(dup_conf_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);
@ -794,7 +670,7 @@ switch_status_t chat_send(switch_event_t *message_event)
switch_copy_string(name, to, sizeof(name));
}
if (!(conference = conference_find(name, NULL))) {
if (!(conference = conf_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;
@ -805,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) {
chat_message_broadcast(conference, message_event);
conf_event_chat_message_broadcast(conference, message_event);
} else if (switch_stristr("list", lbuf)) {
conference_list_pretty(conference, &stream);
conf_list_pretty(conference, &stream);
/* provide help */
} else {
return SWITCH_STATUS_SUCCESS;

View File

@ -45,12 +45,12 @@
switch_status_t conference_file_close(conference_obj_t *conference, conference_file_node_t *node)
{
switch_event_t *event;
conference_member_t *member = NULL;
conf_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) {
conference_add_event_data(conference, event);
conf_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 = conference_member_get(conference, node->member_id))) {
conference_add_event_member_data(member, event);
if ((member = conf_member_get(conference, node->member_id))) {
conf_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) {
close_al(node->al);
conf_al_close(node->al);
}
#endif
if (switch_core_file_has_video(&node->fh) && conference->canvas) {
@ -98,7 +98,7 @@ switch_status_t conference_file_close(conference_obj_t *conference, conference_f
/* Make files stop playing in a conference either the current one or all of them */
uint32_t conference_stop_file(conference_obj_t *conference, file_stop_t stop)
uint32_t conference_file_stop(conference_obj_t *conference, file_stop_t stop)
{
uint32_t count = 0;
conference_file_node_t *nptr;
@ -134,7 +134,7 @@ uint32_t conference_stop_file(conference_obj_t *conference, file_stop_t stop)
}
/* Play a file in the conference room */
switch_status_t conference_play_file(conference_obj_t *conference, char *file, uint32_t leadin, switch_channel_t *channel, uint8_t async)
switch_status_t conference_file_play(conference_obj_t *conference, char *file, uint32_t leadin, switch_channel_t *channel, uint8_t async)
{
switch_status_t status = SWITCH_STATUS_SUCCESS;
conference_file_node_t *fnode, *nptr = NULL;
@ -175,7 +175,7 @@ switch_status_t conference_play_file(conference_obj_t *conference, char *file, u
}
if (!async && say) {
status = conference_say(conference, file + 4, leadin);
status = conf_say(conference, file + 4, leadin);
goto done;
}
@ -196,7 +196,7 @@ switch_status_t conference_play_file(conference_obj_t *conference, char *file, u
switch_safe_free(params_portion);
} else if (!async) {
status = conference_say(conference, file, leadin);
status = conf_say(conference, file, leadin);
goto done;
} else {
goto done;
@ -232,7 +232,7 @@ switch_status_t conference_play_file(conference_obj_t *conference, char *file, u
flags = SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT;
if (conference->members_with_video && conference_test_flag(conference, CFLAG_TRANSCODE_VIDEO)) {
if (conference->members_with_video && conf_utils_test_flag(conference, CFLAG_TRANSCODE_VIDEO)) {
flags |= SWITCH_FILE_FLAG_VIDEO;
}
@ -244,7 +244,7 @@ switch_status_t conference_play_file(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) {
conference_add_event_data(conference, event);
conf_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_play_file(conference_obj_t *conference, char *file, u
}
if (!bad_params && !zstr(position) && conference->channels == 2) {
fnode->al = create_al(pool);
if (parse_position(fnode->al, position) != SWITCH_STATUS_SUCCESS) {
fnode->al = conf_al_create(pool);
if (conf_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_play_file(conference_obj_t *conference, char *file, u
fnode->file = switch_core_strdup(fnode->pool, file);
if (!conference->fnode || (async && !conference->async_fnode)) {
fnode_check_video(fnode);
conf_video_fnode_check(fnode);
}
/* Queue the node */
@ -328,7 +328,7 @@ switch_status_t conference_play_file(conference_obj_t *conference, char *file, u
}
/* Play a file */
switch_status_t conference_local_play_file(conference_obj_t *conference, switch_core_session_t *session, char *path, uint32_t leadin, void *buf,
switch_status_t conference_file_local_play(conference_obj_t *conference, switch_core_session_t *session, char *path, uint32_t leadin, void *buf,
uint32_t buflen)
{
uint32_t x = 0;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -41,25 +41,60 @@
*/
#include <mod_conference.h>
void conf_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;
/* Setup a memory pool to use. */
if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Pool Failure\n");
}
/* Create a node object */
if (!(rec = switch_core_alloc(pool, sizeof(*rec)))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Alloc Failure\n");
switch_core_destroy_memory_pool(&pool);
return;
}
rec->conference = conference;
rec->path = switch_core_strdup(pool, path);
rec->pool = pool;
rec->autorec = autorec;
switch_mutex_lock(conference->flag_mutex);
rec->next = conference->rec_node_head;
conference->rec_node_head = rec;
switch_mutex_unlock(conference->flag_mutex);
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);
}
/* stop the specified recording */
switch_status_t conference_record_stop(conference_obj_t *conference, switch_stream_handle_t *stream, char *path)
switch_status_t conf_record_stop(conference_obj_t *conference, switch_stream_handle_t *stream, char *path)
{
conference_member_t *member = NULL;
conf_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 (member_test_flag(member, MFLAG_NOCHANNEL) && (!path || !strcmp(path, member->rec_path))) {
if (!conference_test_flag(conference, CFLAG_CONF_RESTART_AUTO_RECORD) && member->rec && member->rec->autorec) {
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) {
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);
}
member_clear_flag_locked(member, MFLAG_RUNNING);
conf_utils_member_clear_flag_locked(member, MFLAG_RUNNING);
count++;
}
@ -71,9 +106,9 @@ switch_status_t conference_record_stop(conference_obj_t *conference, switch_stre
return count;
}
/* stop/pause/resume the specified recording */
switch_status_t conference_record_action(conference_obj_t *conference, char *path, recording_action_type_t action)
switch_status_t conf_record_action(conference_obj_t *conference, char *path, recording_action_type_t action)
{
conference_member_t *member = NULL;
conf_member_t *member = NULL;
int count = 0;
//switch_file_handle_t *fh = NULL;
@ -81,21 +116,21 @@ switch_status_t conference_record_action(conference_obj_t *conference, char *pat
switch_mutex_lock(conference->member_mutex);
for (member = conference->members; member; member = member->next)
{
if (member_test_flag(member, MFLAG_NOCHANNEL) && (!path || !strcmp(path, member->rec_path)))
if (conf_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:
member_clear_flag_locked(member, MFLAG_RUNNING);
conf_utils_member_clear_flag_locked(member, MFLAG_RUNNING);
count++;
break;
case REC_ACTION_PAUSE:
member_set_flag_locked(member, MFLAG_PAUSE_RECORDING);
conf_utils_member_set_flag_locked(member, MFLAG_PAUSE_RECORDING);
count = 1;
break;
case REC_ACTION_RESUME:
member_clear_flag_locked(member, MFLAG_PAUSE_RECORDING);
conf_utils_member_clear_flag_locked(member, MFLAG_PAUSE_RECORDING);
count = 1;
break;
}
@ -107,11 +142,11 @@ switch_status_t conference_record_action(conference_obj_t *conference, char *pat
/* Sub-Routine called by a record entity inside a conference */
void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, void *obj)
void *SWITCH_THREAD_FUNC conf_record_thread_run(switch_thread_t *thread, void *obj)
{
int16_t *data_buf;
conference_member_t smember = { 0 }, *member;
conference_record_t *rp, *last = NULL, *rec = (conference_record_t *) obj;
conf_member_t smember = { 0 }, *member;
conf_record_t *rp, *last = NULL, *rec = (conf_record_t *) obj;
conference_obj_t *conference = rec->conference;
uint32_t samples = switch_samples_per_packet(conference->rate, conference->interval);
uint32_t mux_used;
@ -135,9 +170,9 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
data_buf_len = samples * sizeof(int16_t) * conference->channels;
switch_zmalloc(data_buf, data_buf_len);
switch_mutex_lock(mod_conference_globals.hash_mutex);
mod_conference_globals.threads++;
switch_mutex_unlock(mod_conference_globals.hash_mutex);
switch_mutex_lock(conf_globals.hash_mutex);
conf_globals.threads++;
switch_mutex_unlock(conf_globals.hash_mutex);
member = &smember;
@ -186,7 +221,7 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
flags = SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT;
if (conference->members_with_video && conference_test_flag(conference, CFLAG_TRANSCODE_VIDEO)) {
if (conference->members_with_video && conf_utils_test_flag(conference, CFLAG_TRANSCODE_VIDEO)) {
flags |= SWITCH_FILE_FLAG_VIDEO;
if (conference->canvas) {
char *orig_path = rec->path;
@ -205,7 +240,7 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
if (test_eflag(conference, EFLAG_RECORD) &&
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
conference_add_event_data(conference, event);
conf_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");
@ -217,8 +252,8 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
switch_mutex_lock(conference->mutex);
if (conference->video_floor_holder) {
conference_member_t *member;
if ((member = conference_member_get(conference, conference->video_floor_holder))) {
conf_member_t *member;
if ((member = conf_member_get(conference, conference->video_floor_holder))) {
if (member->session) {
switch_core_session_video_reinit(member->session);
}
@ -243,37 +278,37 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
if (test_eflag(conference, EFLAG_RECORD) &&
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
conference_add_event_data(conference, event);
conf_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 (conference_add_member(conference, member) != SWITCH_STATUS_SUCCESS) {
if (conf_member_add(conference, member) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Joining Conference\n");
goto end;
}
while (member_test_flag(member, MFLAG_RUNNING) && conference_test_flag(conference, CFLAG_RUNNING) && (conference->count + conference->count_ghosts)) {
while (conf_utils_member_test_flag(member, MFLAG_RUNNING) && conf_utils_test_flag(conference, CFLAG_RUNNING) && (conference->count + conference->count_ghosts)) {
len = 0;
mux_used = (uint32_t) switch_buffer_inuse(member->mux_buffer);
if (member_test_flag(member, MFLAG_FLUSH_BUFFER)) {
if (conf_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;
}
member_clear_flag_locked(member, MFLAG_FLUSH_BUFFER);
conf_utils_member_clear_flag_locked(member, MFLAG_FLUSH_BUFFER);
}
again:
if (switch_test_flag((&member->rec->fh), SWITCH_FILE_PAUSE)) {
member_set_flag_locked(member, MFLAG_FLUSH_BUFFER);
conf_utils_member_set_flag_locked(member, MFLAG_FLUSH_BUFFER);
goto loop;
}
@ -299,10 +334,10 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
len = (switch_size_t) samples;
}
if (!member_test_flag(member, MFLAG_PAUSE_RECORDING)) {
if (!conf_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");
member_clear_flag_locked(member, MFLAG_RUNNING);
conf_utils_member_clear_flag_locked(member, MFLAG_RUNNING);
}
}
@ -328,7 +363,7 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
switch_safe_free(data_buf);
switch_core_timer_destroy(&timer);
conference_del_member(conference, member);
conf_member_del(conference, member);
if (conference->canvas) {
conference->canvas->send_keyframe = 1;
@ -336,7 +371,7 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
switch_buffer_destroy(&member->audio_buffer);
switch_buffer_destroy(&member->mux_buffer);
member_clear_flag_locked(member, MFLAG_RUNNING);
conf_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);
@ -344,7 +379,7 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
}
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) {
conference_add_event_data(conference, event);
conf_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);
@ -376,9 +411,9 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
switch_core_destroy_memory_pool(&pool);
}
switch_mutex_lock(mod_conference_globals.hash_mutex);
mod_conference_globals.threads--;
switch_mutex_unlock(mod_conference_globals.hash_mutex);
switch_mutex_lock(conf_globals.hash_mutex);
conf_globals.threads--;
switch_mutex_unlock(conf_globals.hash_mutex);
switch_thread_rwlock_unlock(conference->rwlock);
return NULL;

View File

@ -41,7 +41,51 @@
*/
#include <mod_conference.h>
void set_mflags(const char *flags, member_flag_t *f)
const char *conf_utils_combine_flag_var(switch_core_session_t *session, const char *var_name)
{
switch_event_header_t *hp;
switch_event_t *event, *cevent;
char *ret = NULL;
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_core_get_variables(&event);
switch_channel_get_variables(channel, &cevent);
switch_event_merge(event, cevent);
for (hp = event->headers; hp; hp = hp->next) {
char *var = hp->name;
char *val = hp->value;
if (!strcasecmp(var, var_name)) {
if (hp->idx) {
int i;
for (i = 0; i < hp->idx; i++) {
if (zstr(ret)) {
ret = switch_core_session_sprintf(session, "%s", hp->array[i]);
} else {
ret = switch_core_session_sprintf(session, "%s|%s", ret, hp->array[i]);
}
}
} else {
if (zstr(ret)) {
ret = switch_core_session_sprintf(session, "%s", val);
} else {
ret = switch_core_session_sprintf(session, "%s|%s", ret, val);
}
}
}
}
switch_event_destroy(&event);
switch_event_destroy(&cevent);
return ret;
}
void conf_utils_set_mflags(const char *flags, member_flag_t *f)
{
if (flags) {
char *dup = strdup(flags);
@ -106,7 +150,7 @@ void set_mflags(const char *flags, member_flag_t *f)
void set_cflags(const char *flags, conference_flag_t *f)
void conf_utils_set_cflags(const char *flags, conference_flag_t *f)
{
if (flags) {
char *dup = strdup(flags);
@ -159,7 +203,7 @@ void set_cflags(const char *flags, conference_flag_t *f)
}
void clear_eflags(char *events, uint32_t *f)
void conf_utils_clear_eflags(char *events, uint32_t *f)
{
char buf[512] = "";
char *next = NULL;
@ -236,7 +280,7 @@ void clear_eflags(char *events, uint32_t *f)
}
void merge_mflags(member_flag_t *a, member_flag_t *b)
void conf_utils_merge_mflags(member_flag_t *a, member_flag_t *b)
{
int x;
@ -245,71 +289,71 @@ void merge_mflags(member_flag_t *a, member_flag_t *b)
}
}
void conference_set_flag(conference_obj_t *conference, conference_flag_t flag)
void conf_utils_set_flag(conference_obj_t *conference, conference_flag_t flag)
{
conference->flags[flag] = 1;
}
void conference_set_flag_locked(conference_obj_t *conference, conference_flag_t flag)
void conf_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 conference_clear_flag(conference_obj_t *conference, conference_flag_t flag)
void conf_utils_clear_flag(conference_obj_t *conference, conference_flag_t flag)
{
conference->flags[flag] = 0;
}
void conference_clear_flag_locked(conference_obj_t *conference, conference_flag_t flag)
void conf_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 conference_test_flag(conference_obj_t *conference, conference_flag_t flag)
switch_bool_t conf_utils_test_flag(conference_obj_t *conference, conference_flag_t flag)
{
return !!conference->flags[flag];
}
#if 0
void conference_set_mflag(conference_obj_t *conference, member_flag_t mflag)
void conf_utils_conf_utils_set_mflag(conference_obj_t *conference, member_flag_t mflag)
{
conference->mflags[mflag] = 1;
}
void conference_clear_mflag(conference_obj_t *conference, member_flag_t mflag)
void conf_utils_clear_mflag(conference_obj_t *conference, member_flag_t mflag)
{
conference->mflags[mflag] = 0;
}
switch_bool_t conference_test_mflag(conference_obj_t *conference, member_flag_t mflag)
switch_bool_t conf_utils_test_mflag(conference_obj_t *conference, member_flag_t mflag)
{
return !!conference->mflags[mflag];
}
#endif
void member_set_flag(conference_member_t *member, member_flag_t flag)
void conf_utils_member_set_flag(conf_member_t *member, member_flag_t flag)
{
member->flags[flag] = 1;
}
void member_set_flag_locked(conference_member_t *member, member_flag_t flag)
void conf_utils_member_set_flag_locked(conf_member_t *member, member_flag_t flag)
{
switch_mutex_lock(member->flag_mutex);
member->flags[flag] = 1;
switch_mutex_unlock(member->flag_mutex);
}
void member_clear_flag(conference_member_t *member, member_flag_t flag)
void conf_utils_member_clear_flag(conf_member_t *member, member_flag_t flag)
{
member->flags[flag] = 0;
}
void member_clear_flag_locked(conference_member_t *member, member_flag_t flag)
void conf_utils_member_clear_flag_locked(conf_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 member_test_flag(conference_member_t *member, member_flag_t flag)
switch_bool_t conf_utils_member_test_flag(conf_member_t *member, member_flag_t flag)
{
return !!member->flags[flag];
}

File diff suppressed because it is too large Load Diff