Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
a24f9aa8
提交
a24f9aa8
authored
2月 05, 2014
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
no
上级
a000749e
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
6998 行增加
和
7042 行删除
+6998
-7042
mod_conference.c
src/mod/applications/mod_conference/mod_conference.c
+6998
-7042
没有找到文件。
src/mod/applications/mod_conference/mod_conference.c
浏览文件 @
a24f9aa8
...
...
@@ -32,7 +32,6 @@
* David Weekly <david@weekly.org>
* Joao Mesquita <jmesquita@gmail.com>
* Raymond Chandler <intralanman@freeswitch.org>
* Ken Rice <krice@freeswitch.org>
* Seven Du <dujinfang@gmail.com>
* Emmanuel Schmidbauer <e.schmidbauer@gmail.com>
*
...
...
@@ -186,8 +185,7 @@ typedef enum {
MFLAG_VIDEO_BRIDGE
=
(
1
<<
20
),
MFLAG_INDICATE_MUTE_DETECT
=
(
1
<<
21
),
MFLAG_PAUSE_RECORDING
=
(
1
<<
22
),
MFLAG_ACK_VIDEO
=
(
1
<<
23
),
MFLAG_TOOL
=
(
1
<<
24
)
MFLAG_ACK_VIDEO
=
(
1
<<
23
)
}
member_flag_t
;
typedef
enum
{
...
...
@@ -562,8 +560,6 @@ static void conference_member_itterator(conference_obj_t *conference, switch_str
static
switch_status_t
conf_api_sub_mute
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
);
static
switch_status_t
conf_api_sub_tmute
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
);
static
switch_status_t
conf_api_sub_unmute
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
);
static
switch_status_t
conf_api_sub_tool
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
);
static
switch_status_t
conf_api_sub_untool
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
);
static
switch_status_t
conf_api_sub_deaf
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
);
static
switch_status_t
conf_api_sub_undeaf
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
);
static
switch_status_t
conference_add_event_data
(
conference_obj_t
*
conference
,
switch_event_t
*
event
);
...
...
@@ -1105,10 +1101,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_safe_free
(
path
);
switch_safe_free
(
xml_text
);
switch_xml_free
(
cdr
);
}
}
static
cJSON
*
conference_json_render
(
conference_obj_t
*
conference
,
cJSON
*
req
)
{
static
cJSON
*
conference_json_render
(
conference_obj_t
*
conference
,
cJSON
*
req
)
{
char
tmp
[
30
];
const
char
*
domain
;
const
char
*
name
;
char
*
dup_domain
=
NULL
;
...
...
@@ -1264,15 +1260,15 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_safe_free
(
uri
);
return
json
;
}
}
static
void
conference_la_event_channel_handler
(
const
char
*
event_channel
,
cJSON
*
json
,
const
char
*
key
,
switch_event_channel_id_t
id
)
{
static
void
conference_la_event_channel_handler
(
const
char
*
event_channel
,
cJSON
*
json
,
const
char
*
key
,
switch_event_channel_id_t
id
)
{
switch_live_array_parse_json
(
json
,
globals
.
event_channel_id
);
}
}
static
void
conference_event_channel_handler
(
const
char
*
event_channel
,
cJSON
*
json
,
const
char
*
key
,
switch_event_channel_id_t
id
)
{
static
void
conference_event_channel_handler
(
const
char
*
event_channel
,
cJSON
*
json
,
const
char
*
key
,
switch_event_channel_id_t
id
)
{
char
*
domain
=
NULL
,
*
name
=
NULL
;
conference_obj_t
*
conference
=
NULL
;
cJSON
*
data
,
*
reply
=
NULL
,
*
conf_desc
=
NULL
;
...
...
@@ -1318,11 +1314,11 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_event_channel_broadcast
(
event_channel
,
&
reply
,
modname
,
globals
.
event_channel_id
);
}
}
static
switch_status_t
conference_add_event_data
(
conference_obj_t
*
conference
,
switch_event_t
*
event
)
{
static
switch_status_t
conference_add_event_data
(
conference_obj_t
*
conference
,
switch_event_t
*
event
)
{
switch_status_t
status
=
SWITCH_STATUS_SUCCESS
;
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Conference-Name"
,
conference
->
name
);
...
...
@@ -1331,10 +1327,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Conference-Unique-ID"
,
conference
->
uuid_str
);
return
status
;
}
}
static
switch_status_t
conference_add_event_member_data
(
conference_member_t
*
member
,
switch_event_t
*
event
)
{
static
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
)
...
...
@@ -1368,11 +1364,11 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"Current-Energy"
,
"%d"
,
member
->
score
);
return
status
;
}
}
/* Return a Distinct ID # */
static
uint32_t
next_member_id
(
void
)
{
/* Return a Distinct ID # */
static
uint32_t
next_member_id
(
void
)
{
uint32_t
id
;
switch_mutex_lock
(
globals
.
id_mutex
);
...
...
@@ -1380,11 +1376,11 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_mutex_unlock
(
globals
.
id_mutex
);
return
id
;
}
}
/* if other_member has a relationship with member, produce it */
static
conference_relationship_t
*
member_get_relationship
(
conference_member_t
*
member
,
conference_member_t
*
other_member
)
{
/* if other_member has a relationship with member, produce it */
static
conference_relationship_t
*
member_get_relationship
(
conference_member_t
*
member
,
conference_member_t
*
other_member
)
{
conference_relationship_t
*
rel
=
NULL
,
*
global
=
NULL
;
if
(
member
==
NULL
||
other_member
==
NULL
||
member
->
relationships
==
NULL
)
...
...
@@ -1408,11 +1404,11 @@ static void conference_cdr_render(conference_obj_t *conference)
unlock_member
(
member
);
return
rel
?
rel
:
global
;
}
}
/* traverse the conference member list for the specified member id and return it's pointer */
static
conference_member_t
*
conference_member_get
(
conference_obj_t
*
conference
,
uint32_t
id
)
{
/* traverse the conference member list for the specified member id and return it's pointer */
static
conference_member_t
*
conference_member_get
(
conference_obj_t
*
conference
,
uint32_t
id
)
{
conference_member_t
*
member
=
NULL
;
switch_assert
(
conference
!=
NULL
);
...
...
@@ -1452,11 +1448,11 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_mutex_unlock
(
conference
->
member_mutex
);
return
member
;
}
}
/* stop the specified recording */
static
switch_status_t
conference_record_stop
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
char
*
path
)
{
/* stop the specified recording */
static
switch_status_t
conference_record_stop
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
char
*
path
)
{
conference_member_t
*
member
=
NULL
;
int
count
=
0
;
...
...
@@ -1481,10 +1477,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_mutex_unlock
(
conference
->
member_mutex
);
return
count
;
}
/* stop/pause/resume the specified recording */
static
switch_status_t
conference_record_action
(
conference_obj_t
*
conference
,
char
*
path
,
recording_action_type_t
action
)
{
}
/* stop/pause/resume the specified recording */
static
switch_status_t
conference_record_action
(
conference_obj_t
*
conference
,
char
*
path
,
recording_action_type_t
action
)
{
conference_member_t
*
member
=
NULL
;
int
count
=
0
;
//switch_file_handle_t *fh = NULL;
...
...
@@ -1515,12 +1511,12 @@ static void conference_cdr_render(conference_obj_t *conference)
}
switch_mutex_unlock
(
conference
->
member_mutex
);
return
count
;
}
}
/* Add a custom relationship to a member */
static
conference_relationship_t
*
member_add_relationship
(
conference_member_t
*
member
,
uint32_t
id
)
{
/* Add a custom relationship to a member */
static
conference_relationship_t
*
member_add_relationship
(
conference_member_t
*
member
,
uint32_t
id
)
{
conference_relationship_t
*
rel
=
NULL
;
if
(
member
==
NULL
||
id
==
0
||
!
(
rel
=
switch_core_alloc
(
member
->
pool
,
sizeof
(
*
rel
))))
...
...
@@ -1538,11 +1534,11 @@ static void conference_cdr_render(conference_obj_t *conference)
unlock_member
(
member
);
return
rel
;
}
}
/* Remove a custom relationship from a member */
static
switch_status_t
member_del_relationship
(
conference_member_t
*
member
,
uint32_t
id
)
{
/* Remove a custom relationship from a member */
static
switch_status_t
member_del_relationship
(
conference_member_t
*
member
,
uint32_t
id
)
{
switch_status_t
status
=
SWITCH_STATUS_FALSE
;
conference_relationship_t
*
rel
,
*
last
=
NULL
;
...
...
@@ -1571,10 +1567,10 @@ static void conference_cdr_render(conference_obj_t *conference)
unlock_member
(
member
);
return
status
;
}
}
static
void
send_json_event
(
conference_obj_t
*
conference
)
{
static
void
send_json_event
(
conference_obj_t
*
conference
)
{
cJSON
*
event
,
*
conf_desc
=
NULL
;
char
*
name
=
NULL
,
*
domain
=
NULL
,
*
dup_domain
=
NULL
;
char
*
event_channel
=
NULL
;
...
...
@@ -1607,10 +1603,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_safe_free
(
dup_domain
);
switch_safe_free
(
event_channel
);
}
}
static
void
send_rfc_event
(
conference_obj_t
*
conference
)
{
static
void
send_rfc_event
(
conference_obj_t
*
conference
)
{
switch_event_t
*
event
;
char
*
body
;
char
*
name
=
NULL
,
*
domain
=
NULL
,
*
dup_domain
=
NULL
;
...
...
@@ -1645,12 +1641,12 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_safe_free
(
dup_domain
);
}
}
static
void
send_conference_notify
(
conference_obj_t
*
conference
,
const
char
*
status
,
const
char
*
call_id
,
switch_bool_t
final
)
{
static
void
send_conference_notify
(
conference_obj_t
*
conference
,
const
char
*
status
,
const
char
*
call_id
,
switch_bool_t
final
)
{
switch_event_t
*
event
;
char
*
name
=
NULL
,
*
domain
=
NULL
,
*
dup_domain
=
NULL
;
...
...
@@ -1689,10 +1685,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_safe_free
(
dup_domain
);
}
}
static
void
member_update_status_field
(
conference_member_t
*
member
)
{
static
void
member_update_status_field
(
conference_member_t
*
member
)
{
char
*
str
,
*
vstr
=
""
,
display
[
128
]
=
""
;
if
(
!
member
->
conference
->
la
)
{
...
...
@@ -1732,10 +1728,10 @@ static void conference_cdr_render(conference_obj_t *conference)
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
);
}
}
static
void
adv_la
(
conference_obj_t
*
conference
,
conference_member_t
*
member
,
switch_bool_t
join
)
{
static
void
adv_la
(
conference_obj_t
*
conference
,
conference_member_t
*
member
,
switch_bool_t
join
)
{
if
(
conference
&&
conference
->
la
&&
member
->
session
)
{
cJSON
*
msg
,
*
data
;
const
char
*
uuid
=
switch_core_session_get_uuid
(
member
->
session
);
...
...
@@ -1757,11 +1753,11 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_event_channel_broadcast
(
uuid
,
&
msg
,
modname
,
globals
.
event_channel_id
);
}
}
}
/* Gain exclusive access and add the member to the list */
static
switch_status_t
conference_add_member
(
conference_obj_t
*
conference
,
conference_member_t
*
member
)
{
/* Gain exclusive access and add the member to the list */
static
switch_status_t
conference_add_member
(
conference_obj_t
*
conference
,
conference_member_t
*
member
)
{
switch_status_t
status
=
SWITCH_STATUS_FALSE
;
switch_event_t
*
event
;
char
msg
[
512
];
/* conference count announcement */
...
...
@@ -1956,10 +1952,10 @@ static void conference_cdr_render(conference_obj_t *conference)
return
status
;
}
}
static
void
conference_set_video_floor_holder
(
conference_obj_t
*
conference
,
conference_member_t
*
member
,
switch_bool_t
force
)
{
static
void
conference_set_video_floor_holder
(
conference_obj_t
*
conference
,
conference_member_t
*
member
,
switch_bool_t
force
)
{
switch_event_t
*
event
;
conference_member_t
*
old_member
=
NULL
,
*
imember
=
NULL
;
int
old_id
=
0
;
...
...
@@ -2047,10 +2043,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_event_fire
(
&
event
);
}
}
}
static
void
conference_set_floor_holder
(
conference_obj_t
*
conference
,
conference_member_t
*
member
)
{
static
void
conference_set_floor_holder
(
conference_obj_t
*
conference
,
conference_member_t
*
member
)
{
switch_event_t
*
event
;
conference_member_t
*
old_member
=
NULL
;
int
old_id
=
0
;
...
...
@@ -2111,10 +2107,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_event_fire
(
&
event
);
}
}
}
static
switch_status_t
conference_file_close
(
conference_obj_t
*
conference
,
conference_file_node_t
*
node
)
{
static
switch_status_t
conference_file_close
(
conference_obj_t
*
conference
,
conference_file_node_t
*
node
)
{
switch_event_t
*
event
;
conference_member_t
*
member
=
NULL
;
...
...
@@ -2153,11 +2149,11 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
switch_core_file_close
(
&
node
->
fh
);
}
}
/* Gain exclusive access and remove the member from the list */
static
switch_status_t
conference_del_member
(
conference_obj_t
*
conference
,
conference_member_t
*
member
)
{
/* Gain exclusive access and remove the member from the list */
static
switch_status_t
conference_del_member
(
conference_obj_t
*
conference
,
conference_member_t
*
member
)
{
switch_status_t
status
=
SWITCH_STATUS_FALSE
;
conference_member_t
*
imember
,
*
last
=
NULL
;
switch_event_t
*
event
;
...
...
@@ -2302,11 +2298,11 @@ static void conference_cdr_render(conference_obj_t *conference)
status
=
SWITCH_STATUS_SUCCESS
;
return
status
;
}
}
/* Thread bridging video between two members, there will be two threads if video briding is used */
static
void
*
SWITCH_THREAD_FUNC
conference_video_bridge_thread_run
(
switch_thread_t
*
thread
,
void
*
obj
)
{
/* Thread bridging video between two members, there will be two threads if video briding is used */
static
void
*
SWITCH_THREAD_FUNC
conference_video_bridge_thread_run
(
switch_thread_t
*
thread
,
void
*
obj
)
{
struct
vid_helper
*
vh
=
obj
;
switch_core_session_t
*
session_a
=
vh
->
member_a
->
session
;
switch_core_session_t
*
session_b
=
vh
->
member_b
->
session
;
...
...
@@ -2361,12 +2357,12 @@ static void conference_cdr_render(conference_obj_t *conference)
vh
->
up
=
0
;
return
NULL
;
}
}
/* Main video monitor thread (1 per distinct conference room) */
static
void
*
SWITCH_THREAD_FUNC
conference_video_thread_run
(
switch_thread_t
*
thread
,
void
*
obj
)
{
/* Main video monitor thread (1 per distinct conference room) */
static
void
*
SWITCH_THREAD_FUNC
conference_video_thread_run
(
switch_thread_t
*
thread
,
void
*
obj
)
{
conference_obj_t
*
conference
=
(
conference_obj_t
*
)
obj
;
conference_member_t
*
imember
;
switch_frame_t
*
vid_frame
=
NULL
;
...
...
@@ -2474,16 +2470,16 @@ static void conference_cdr_render(conference_obj_t *conference)
conference
->
video_running
=
0
;
return
NULL
;
}
}
static
void
conference_command_handler
(
switch_live_array_t
*
la
,
const
char
*
cmd
,
const
char
*
sessid
,
cJSON
*
jla
,
void
*
user_data
)
{
static
void
conference_command_handler
(
switch_live_array_t
*
la
,
const
char
*
cmd
,
const
char
*
sessid
,
cJSON
*
jla
,
void
*
user_data
)
{
}
}
/* Main monitor thread (1 per distinct conference room) */
static
void
*
SWITCH_THREAD_FUNC
conference_thread_run
(
switch_thread_t
*
thread
,
void
*
obj
)
{
/* Main monitor thread (1 per distinct conference room) */
static
void
*
SWITCH_THREAD_FUNC
conference_thread_run
(
switch_thread_t
*
thread
,
void
*
obj
)
{
conference_obj_t
*
conference
=
(
conference_obj_t
*
)
obj
;
conference_member_t
*
imember
,
*
omember
;
uint32_t
samples
=
switch_samples_per_packet
(
conference
->
rate
,
conference
->
interval
);
...
...
@@ -2785,10 +2781,6 @@ static void conference_cdr_render(conference_obj_t *conference)
continue
;
}
if
(
switch_test_flag
(
omember
,
MFLAG_TOOL
)
&&
(
rand
()
%
20
)
>
9
){
continue
;
}
if
(
conference
->
agc_level
)
{
if
(
switch_test_flag
(
omember
,
MFLAG_TALKING
)
&&
switch_test_flag
(
omember
,
MFLAG_CAN_SPEAK
))
{
member_score_sum
+=
omember
->
score
;
...
...
@@ -2834,10 +2826,6 @@ static void conference_cdr_render(conference_obj_t *conference)
continue
;
}
if
(
switch_test_flag
(
omember
,
MFLAG_TOOL
)
&&
(
rand
()
%
20
)
>
9
)
{
continue
;
}
bptr
=
(
int16_t
*
)
omember
->
frame
;
for
(
x
=
0
;
x
<
bytes
/
2
;
x
++
)
{
z
=
main_frame
[
x
];
...
...
@@ -3062,31 +3050,31 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_mutex_unlock
(
globals
.
hash_mutex
);
return
NULL
;
}
}
static
void
conference_loop_fn_floor_toggle
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_floor_toggle
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
if
(
member
==
NULL
)
return
;
conf_api_sub_floor
(
member
,
NULL
,
NULL
);
}
}
static
void
conference_loop_fn_vid_floor_toggle
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_vid_floor_toggle
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
if
(
member
==
NULL
)
return
;
conf_api_sub_vid_floor
(
member
,
NULL
,
NULL
);
}
}
static
void
conference_loop_fn_vid_floor_force
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_vid_floor_force
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
if
(
member
==
NULL
)
return
;
conf_api_sub_vid_floor
(
member
,
NULL
,
"force"
);
}
}
static
void
conference_loop_fn_mute_toggle
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_mute_toggle
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
if
(
member
==
NULL
)
return
;
...
...
@@ -3098,27 +3086,27 @@ static void conference_cdr_render(conference_obj_t *conference)
conf_api_sub_undeaf
(
member
,
NULL
,
NULL
);
}
}
}
}
static
void
conference_loop_fn_mute_on
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_mute_on
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
if
(
switch_test_flag
(
member
,
MFLAG_CAN_SPEAK
))
{
conf_api_sub_mute
(
member
,
NULL
,
NULL
);
}
}
}
static
void
conference_loop_fn_mute_off
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_mute_off
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
if
(
!
switch_test_flag
(
member
,
MFLAG_CAN_SPEAK
))
{
conf_api_sub_unmute
(
member
,
NULL
,
NULL
);
if
(
!
switch_test_flag
(
member
,
MFLAG_CAN_HEAR
))
{
conf_api_sub_undeaf
(
member
,
NULL
,
NULL
);
}
}
}
}
static
void
conference_loop_fn_lock_toggle
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_lock_toggle
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
switch_event_t
*
event
;
if
(
member
==
NULL
)
...
...
@@ -3153,10 +3141,10 @@ static void conference_cdr_render(conference_obj_t *conference)
}
}
}
}
static
void
conference_loop_fn_deafmute_toggle
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_deafmute_toggle
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
if
(
member
==
NULL
)
return
;
...
...
@@ -3171,10 +3159,10 @@ static void conference_cdr_render(conference_obj_t *conference)
conf_api_sub_undeaf
(
member
,
NULL
,
NULL
);
}
}
}
}
static
void
conference_loop_fn_energy_up
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_energy_up
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
char
msg
[
512
],
str
[
30
]
=
""
;
switch_event_t
*
event
;
char
*
p
;
...
...
@@ -3208,10 +3196,10 @@ static void conference_cdr_render(conference_obj_t *conference)
}
}
static
void
conference_loop_fn_energy_equ_conf
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_energy_equ_conf
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
char
msg
[
512
],
str
[
30
]
=
""
,
*
p
;
switch_event_t
*
event
;
...
...
@@ -3237,10 +3225,10 @@ static void conference_cdr_render(conference_obj_t *conference)
conference_member_play_file
(
member
,
msg
,
0
,
SWITCH_TRUE
);
}
}
}
static
void
conference_loop_fn_energy_dn
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_energy_dn
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
char
msg
[
512
],
str
[
30
]
=
""
,
*
p
;
switch_event_t
*
event
;
...
...
@@ -3269,10 +3257,10 @@ static void conference_cdr_render(conference_obj_t *conference)
conference_member_play_file
(
member
,
msg
,
0
,
SWITCH_TRUE
);
}
}
}
static
void
conference_loop_fn_volume_talk_up
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_volume_talk_up
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
char
msg
[
512
];
switch_event_t
*
event
;
...
...
@@ -3301,10 +3289,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_snprintf
(
msg
,
sizeof
(
msg
),
"digits/%d.wav"
,
abs
(
member
->
volume_out_level
));
conference_member_play_file
(
member
,
msg
,
0
,
SWITCH_TRUE
);
}
}
static
void
conference_loop_fn_volume_talk_zero
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_volume_talk_zero
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
char
msg
[
512
];
switch_event_t
*
event
;
...
...
@@ -3332,10 +3320,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_snprintf
(
msg
,
sizeof
(
msg
),
"digits/%d.wav"
,
abs
(
member
->
volume_out_level
));
conference_member_play_file
(
member
,
msg
,
0
,
SWITCH_TRUE
);
}
}
static
void
conference_loop_fn_volume_talk_dn
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_volume_talk_dn
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
char
msg
[
512
];
switch_event_t
*
event
;
...
...
@@ -3363,10 +3351,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_snprintf
(
msg
,
sizeof
(
msg
),
"digits/%d.wav"
,
abs
(
member
->
volume_out_level
));
conference_member_play_file
(
member
,
msg
,
0
,
SWITCH_TRUE
);
}
}
static
void
conference_loop_fn_volume_listen_up
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_volume_listen_up
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
char
msg
[
512
];
switch_event_t
*
event
;
...
...
@@ -3395,10 +3383,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_snprintf
(
msg
,
sizeof
(
msg
),
"digits/%d.wav"
,
abs
(
member
->
volume_in_level
));
conference_member_play_file
(
member
,
msg
,
0
,
SWITCH_TRUE
);
}
}
static
void
conference_loop_fn_volume_listen_zero
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_volume_listen_zero
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
char
msg
[
512
];
switch_event_t
*
event
;
...
...
@@ -3426,10 +3414,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_snprintf
(
msg
,
sizeof
(
msg
),
"digits/%d.wav"
,
abs
(
member
->
volume_in_level
));
conference_member_play_file
(
member
,
msg
,
0
,
SWITCH_TRUE
);
}
}
static
void
conference_loop_fn_volume_listen_dn
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_volume_listen_dn
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
char
msg
[
512
];
switch_event_t
*
event
;
...
...
@@ -3457,10 +3445,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_snprintf
(
msg
,
sizeof
(
msg
),
"digits/%d.wav"
,
abs
(
member
->
volume_in_level
));
conference_member_play_file
(
member
,
msg
,
0
,
SWITCH_TRUE
);
}
}
static
void
conference_loop_fn_event
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_event
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
switch_event_t
*
event
;
if
(
test_eflag
(
member
->
conference
,
EFLAG_DTMF
)
&&
switch_event_create_subclass
(
&
event
,
SWITCH_EVENT_CUSTOM
,
CONF_EVENT_MAINT
)
==
SWITCH_STATUS_SUCCESS
)
{
conference_add_event_member_data
(
member
,
event
);
...
...
@@ -3469,10 +3457,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Data"
,
action
->
expanded_data
);
switch_event_fire
(
&
event
);
}
}
}
static
void
conference_loop_fn_transfer
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_transfer
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
char
*
exten
=
NULL
;
char
*
dialplan
=
"XML"
;
char
*
context
=
"default"
;
...
...
@@ -3516,10 +3504,10 @@ static void conference_cdr_render(conference_obj_t *conference)
done:
return
;
}
}
static
void
conference_loop_fn_exec_app
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_exec_app
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
char
*
app
=
NULL
;
char
*
arg
=
""
;
...
...
@@ -3575,16 +3563,16 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_safe_free
(
mydata
);
return
;
}
}
static
void
conference_loop_fn_hangup
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
static
void
conference_loop_fn_hangup
(
conference_member_t
*
member
,
caller_control_action_t
*
action
)
{
switch_clear_flag_locked
(
member
,
MFLAG_RUNNING
);
}
}
static
int
noise_gate_check
(
conference_member_t
*
member
)
{
static
int
noise_gate_check
(
conference_member_t
*
member
)
{
int
r
=
0
;
...
...
@@ -3602,19 +3590,19 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
r
;
}
}
static
void
clear_avg
(
conference_member_t
*
member
)
{
static
void
clear_avg
(
conference_member_t
*
member
)
{
member
->
avg_score
=
0
;
member
->
avg_itt
=
0
;
member
->
avg_tally
=
0
;
member
->
agc_concur
=
0
;
}
}
static
void
check_agc_levels
(
conference_member_t
*
member
)
{
static
void
check_agc_levels
(
conference_member_t
*
member
)
{
int
x
=
0
;
if
(
!
member
->
avg_score
)
return
;
...
...
@@ -3638,14 +3626,14 @@ static void conference_cdr_render(conference_obj_t *conference)
clear_avg
(
member
);
}
}
}
/* marshall frames from the call leg to the conference thread for muxing to other call legs */
static
void
*
SWITCH_THREAD_FUNC
conference_loop_input
(
switch_thread_t
*
thread
,
void
*
obj
)
{
/* marshall frames from the call leg to the conference thread for muxing to other call legs */
static
void
*
SWITCH_THREAD_FUNC
conference_loop_input
(
switch_thread_t
*
thread
,
void
*
obj
)
{
switch_event_t
*
event
;
conference_member_t
*
member
=
obj
;
switch_channel_t
*
channel
;
...
...
@@ -3975,11 +3963,11 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_clear_flag_locked
(
member
,
MFLAG_ITHREAD
);
return
NULL
;
}
}
static
void
member_add_file_data
(
conference_member_t
*
member
,
int16_t
*
data
,
switch_size_t
file_data_len
)
{
static
void
member_add_file_data
(
conference_member_t
*
member
,
int16_t
*
data
,
switch_size_t
file_data_len
)
{
switch_size_t
file_sample_len
=
file_data_len
/
2
;
int16_t
file_frame
[
SWITCH_RECOMMENDED_BUFFER_SIZE
/
2
]
=
{
0
};
...
...
@@ -4050,13 +4038,13 @@ static void conference_cdr_render(conference_obj_t *conference)
done:
switch_mutex_unlock
(
member
->
fnode_mutex
);
}
}
/* launch an input thread for the call leg */
static
void
launch_conference_loop_input
(
conference_member_t
*
member
,
switch_memory_pool_t
*
pool
)
{
/* launch an input thread for the call leg */
static
void
launch_conference_loop_input
(
conference_member_t
*
member
,
switch_memory_pool_t
*
pool
)
{
switch_threadattr_t
*
thd_attr
=
NULL
;
if
(
member
==
NULL
)
...
...
@@ -4068,12 +4056,12 @@ static void conference_cdr_render(conference_obj_t *conference)
if
(
switch_thread_create
(
&
member
->
input_thread
,
thd_attr
,
conference_loop_input
,
member
,
pool
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_clear_flag_locked
(
member
,
MFLAG_ITHREAD
);
}
}
}
/* marshall frames from the conference (or file or tts output) to the call leg */
/* NB. this starts the input thread after some initial setup for the call leg */
static
void
conference_loop_output
(
conference_member_t
*
member
)
{
/* marshall frames from the conference (or file or tts output) to the call leg */
/* NB. this starts the input thread after some initial setup for the call leg */
static
void
conference_loop_output
(
conference_member_t
*
member
)
{
switch_channel_t
*
channel
;
switch_frame_t
write_frame
=
{
0
};
uint8_t
*
data
=
NULL
;
...
...
@@ -4432,11 +4420,11 @@ static void conference_cdr_render(conference_obj_t *conference)
if
(
switch_channel_direction
(
channel
)
==
SWITCH_CALL_DIRECTION_OUTBOUND
)
{
member
->
conference
->
bridge_hangup_cause
=
switch_channel_get_cause
(
channel
);
}
}
}
/* Sub-Routine called by a record entity inside a conference */
static
void
*
SWITCH_THREAD_FUNC
conference_record_thread_run
(
switch_thread_t
*
thread
,
void
*
obj
)
{
/* Sub-Routine called by a record entity inside a conference */
static
void
*
SWITCH_THREAD_FUNC
conference_record_thread_run
(
switch_thread_t
*
thread
,
void
*
obj
)
{
int16_t
*
data_buf
;
switch_file_handle_t
fh
=
{
0
};
conference_member_t
smember
=
{
0
},
*
member
;
...
...
@@ -4682,11 +4670,11 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_thread_rwlock_unlock
(
conference
->
rwlock
);
return
NULL
;
}
}
/* Make files stop playing in a conference either the current one or all of them */
static
uint32_t
conference_stop_file
(
conference_obj_t
*
conference
,
file_stop_t
stop
)
{
/* Make files stop playing in a conference either the current one or all of them */
static
uint32_t
conference_stop_file
(
conference_obj_t
*
conference
,
file_stop_t
stop
)
{
uint32_t
count
=
0
;
conference_file_node_t
*
nptr
;
...
...
@@ -4718,11 +4706,11 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_mutex_unlock
(
conference
->
mutex
);
return
count
;
}
}
/* stop playing a file for the member of the conference */
static
uint32_t
conference_member_stop_file
(
conference_member_t
*
member
,
file_stop_t
stop
)
{
/* stop playing a file for the member of the conference */
static
uint32_t
conference_member_stop_file
(
conference_member_t
*
member
,
file_stop_t
stop
)
{
conference_file_node_t
*
nptr
;
uint32_t
count
=
0
;
...
...
@@ -4747,10 +4735,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_mutex_unlock
(
member
->
fnode_mutex
);
return
count
;
}
}
static
void
conference_send_all_dtmf
(
conference_member_t
*
member
,
conference_obj_t
*
conference
,
const
char
*
dtmf
)
{
static
void
conference_send_all_dtmf
(
conference_member_t
*
member
,
conference_obj_t
*
conference
,
const
char
*
dtmf
)
{
conference_member_t
*
imember
;
switch_mutex_lock
(
conference
->
mutex
);
...
...
@@ -4776,11 +4764,11 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_mutex_unlock
(
conference
->
member_mutex
);
switch_mutex_unlock
(
conference
->
mutex
);
}
}
/* Play a file in the conference room */
static
switch_status_t
conference_play_file
(
conference_obj_t
*
conference
,
char
*
file
,
uint32_t
leadin
,
switch_channel_t
*
channel
,
uint8_t
async
)
{
/* Play a file in the conference room */
static
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
status
=
SWITCH_STATUS_SUCCESS
;
conference_file_node_t
*
fnode
,
*
nptr
=
NULL
;
switch_memory_pool_t
*
pool
;
...
...
@@ -4925,11 +4913,11 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_safe_free
(
dfile
);
return
status
;
}
}
/* Play a file in the conference room to a member */
static
switch_status_t
conference_member_play_file
(
conference_member_t
*
member
,
char
*
file
,
uint32_t
leadin
,
switch_bool_t
mux
)
{
/* Play a file in the conference room to a member */
static
switch_status_t
conference_member_play_file
(
conference_member_t
*
member
,
char
*
file
,
uint32_t
leadin
,
switch_bool_t
mux
)
{
switch_status_t
status
=
SWITCH_STATUS_FALSE
;
char
*
dfile
=
NULL
,
*
expanded
=
NULL
;
conference_file_node_t
*
fnode
,
*
nptr
=
NULL
;
...
...
@@ -5007,11 +4995,11 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_safe_free
(
dfile
);
return
status
;
}
}
/* Say some thing with TTS in the conference room */
static
switch_status_t
conference_member_say
(
conference_member_t
*
member
,
char
*
text
,
uint32_t
leadin
)
{
/* Say some thing with TTS in the conference room */
static
switch_status_t
conference_member_say
(
conference_member_t
*
member
,
char
*
text
,
uint32_t
leadin
)
{
conference_obj_t
*
conference
=
(
member
!=
NULL
?
member
->
conference
:
NULL
);
conference_file_node_t
*
fnode
,
*
nptr
;
switch_memory_pool_t
*
pool
;
...
...
@@ -5087,11 +5075,11 @@ static void conference_cdr_render(conference_obj_t *conference)
status
=
SWITCH_STATUS_SUCCESS
;
return
status
;
}
}
/* Say some thing with TTS in the conference room */
static
switch_status_t
conference_say
(
conference_obj_t
*
conference
,
const
char
*
text
,
uint32_t
leadin
)
{
/* Say some thing with TTS in the conference room */
static
switch_status_t
conference_say
(
conference_obj_t
*
conference
,
const
char
*
text
,
uint32_t
leadin
)
{
switch_status_t
status
=
SWITCH_STATUS_FALSE
;
conference_file_node_t
*
fnode
,
*
nptr
;
switch_memory_pool_t
*
pool
;
...
...
@@ -5175,11 +5163,11 @@ static void conference_cdr_render(conference_obj_t *conference)
status
=
SWITCH_STATUS_SUCCESS
;
return
status
;
}
}
/* send a message to every member of the conference */
static
void
chat_message_broadcast
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
const
char
*
data
,
const
char
*
chat_from
,
const
char
*
ouuid
)
{
/* send a message to every member of the conference */
static
void
chat_message_broadcast
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
const
char
*
data
,
const
char
*
chat_from
,
const
char
*
ouuid
)
{
conference_member_t
*
member
=
NULL
;
char
*
argv
[
2
]
=
{
0
};
char
*
dup
=
NULL
;
...
...
@@ -5209,11 +5197,11 @@ static void conference_cdr_render(conference_obj_t *conference)
}
}
switch_mutex_unlock
(
conference
->
member_mutex
);
}
}
/* execute a callback for every member of the conference */
static
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
)
{
/* execute a callback for every member of the conference */
static
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
)
{
conference_member_t
*
member
=
NULL
;
switch_assert
(
conference
!=
NULL
);
...
...
@@ -5231,11 +5219,11 @@ static void conference_cdr_render(conference_obj_t *conference)
}
}
switch_mutex_unlock
(
conference
->
member_mutex
);
}
}
static
switch_status_t
list_conferences
(
const
char
*
line
,
const
char
*
cursor
,
switch_console_callback_match_t
**
matches
)
{
static
switch_status_t
list_conferences
(
const
char
*
line
,
const
char
*
cursor
,
switch_console_callback_match_t
**
matches
)
{
switch_console_callback_match_t
*
my_matches
=
NULL
;
switch_status_t
status
=
SWITCH_STATUS_FALSE
;
switch_hash_index_t
*
hi
;
...
...
@@ -5255,10 +5243,10 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
status
;
}
}
static
void
conference_list_pretty
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
)
{
static
void
conference_list_pretty
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
)
{
conference_member_t
*
member
=
NULL
;
switch_assert
(
conference
!=
NULL
);
...
...
@@ -5280,10 +5268,10 @@ static void conference_cdr_render(conference_obj_t *conference)
}
switch_mutex_unlock
(
conference
->
member_mutex
);
}
}
static
void
conference_list
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
char
*
delim
)
{
static
void
conference_list
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
char
*
delim
)
{
conference_member_t
*
member
=
NULL
;
switch_assert
(
conference
!=
NULL
);
...
...
@@ -5344,46 +5332,18 @@ static void conference_cdr_render(conference_obj_t *conference)
}
switch_mutex_unlock
(
conference
->
member_mutex
);
}
}
static
void
conference_list_count_only
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
)
{
static
void
conference_list_count_only
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
)
{
switch_assert
(
conference
!=
NULL
);
switch_assert
(
stream
!=
NULL
);
stream
->
write_function
(
stream
,
"%d"
,
conference
->
count
);
}
static
switch_status_t
conf_api_sub_untool
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
if
(
member
==
NULL
)
return
SWITCH_STATUS_GENERR
;
switch_clear_flag_locked
(
member
,
MFLAG_TOOL
);
if
(
stream
!=
NULL
)
{
stream
->
write_function
(
stream
,
"OK untooled %u
\n
"
,
member
->
id
);
}
return
SWITCH_STATUS_SUCCESS
;
}
static
switch_status_t
conf_api_sub_tool
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
if
(
member
==
NULL
)
return
SWITCH_STATUS_GENERR
;
switch_set_flag_locked
(
member
,
MFLAG_TOOL
);
if
(
stream
!=
NULL
)
{
stream
->
write_function
(
stream
,
"OK tooled %u
\n
"
,
member
->
id
);
}
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_mute
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
static
switch_status_t
conf_api_sub_mute
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
switch_event_t
*
event
;
if
(
member
==
NULL
)
...
...
@@ -5409,11 +5369,11 @@ static void conference_cdr_render(conference_obj_t *conference)
member_update_status_field
(
member
);
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_tmute
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
static
switch_status_t
conf_api_sub_tmute
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
if
(
member
==
NULL
)
return
SWITCH_STATUS_GENERR
;
...
...
@@ -5423,10 +5383,10 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
conf_api_sub_unmute
(
member
,
stream
,
data
);
}
}
static
switch_status_t
conf_api_sub_agc
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_agc
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
int
level
;
int
on
=
0
;
...
...
@@ -5469,10 +5429,10 @@ static void conference_cdr_render(conference_obj_t *conference)
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_unmute
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
static
switch_status_t
conf_api_sub_unmute
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
switch_event_t
*
event
;
if
(
member
==
NULL
)
...
...
@@ -5495,10 +5455,10 @@ static void conference_cdr_render(conference_obj_t *conference)
member_update_status_field
(
member
);
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_deaf
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
static
switch_status_t
conf_api_sub_deaf
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
switch_event_t
*
event
;
if
(
member
==
NULL
)
...
...
@@ -5515,10 +5475,10 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_undeaf
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
static
switch_status_t
conf_api_sub_undeaf
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
switch_event_t
*
event
;
if
(
member
==
NULL
)
...
...
@@ -5535,10 +5495,10 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_hup
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
static
switch_status_t
conf_api_sub_hup
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
switch_event_t
*
event
;
if
(
member
==
NULL
)
{
...
...
@@ -5556,10 +5516,10 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_kick
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
static
switch_status_t
conf_api_sub_kick
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
switch_event_t
*
event
;
if
(
member
==
NULL
)
{
...
...
@@ -5587,11 +5547,11 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_dtmf
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
static
switch_status_t
conf_api_sub_dtmf
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
switch_event_t
*
event
;
char
*
dtmf
=
(
char
*
)
data
;
...
...
@@ -5630,10 +5590,10 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_energy
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
static
switch_status_t
conf_api_sub_energy
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
switch_event_t
*
event
;
if
(
member
==
NULL
)
...
...
@@ -5656,10 +5616,10 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_volume_in
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
static
switch_status_t
conf_api_sub_volume_in
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
switch_event_t
*
event
;
if
(
member
==
NULL
)
...
...
@@ -5683,10 +5643,10 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_volume_out
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
static
switch_status_t
conf_api_sub_volume_out
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
switch_event_t
*
event
;
if
(
member
==
NULL
)
...
...
@@ -5710,10 +5670,10 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_list
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_list
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
int
ret_status
=
SWITCH_STATUS_GENERR
;
int
count
=
0
;
switch_hash_index_t
*
hi
;
...
...
@@ -5868,10 +5828,10 @@ static void conference_cdr_render(conference_obj_t *conference)
ret_status
=
SWITCH_STATUS_SUCCESS
;
return
ret_status
;
}
}
static
switch_status_t
conf_api_sub_floor
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
static
switch_status_t
conf_api_sub_floor
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
if
(
member
==
NULL
)
return
SWITCH_STATUS_GENERR
;
...
...
@@ -5897,10 +5857,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_mutex_unlock
(
member
->
conference
->
mutex
);
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_clear_vid_floor
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
static
switch_status_t
conf_api_sub_clear_vid_floor
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
if
(
switch_test_flag
(
conference
,
CFLAG_VIDEO_BRIDGE
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
...
...
@@ -5914,10 +5874,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_mutex_unlock
(
conference
->
mutex
);
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_vid_floor
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
static
switch_status_t
conf_api_sub_vid_floor
(
conference_member_t
*
member
,
switch_stream_handle_t
*
stream
,
void
*
data
)
{
int
force
=
0
;
if
(
member
==
NULL
)
...
...
@@ -5973,10 +5933,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_mutex_unlock
(
member
->
conference
->
mutex
);
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_xml_t
add_x_tag
(
switch_xml_t
x_member
,
const
char
*
name
,
const
char
*
value
,
int
off
)
{
static
switch_xml_t
add_x_tag
(
switch_xml_t
x_member
,
const
char
*
name
,
const
char
*
value
,
int
off
)
{
switch_size_t
dlen
;
char
*
data
;
switch_xml_t
x_tag
;
...
...
@@ -5997,10 +5957,10 @@ static void conference_cdr_render(conference_obj_t *conference)
free
(
data
);
return
x_tag
;
}
}
static
void
conference_xlist
(
conference_obj_t
*
conference
,
switch_xml_t
x_conference
,
int
off
)
{
static
void
conference_xlist
(
conference_obj_t
*
conference
,
switch_xml_t
x_conference
,
int
off
)
{
conference_member_t
*
member
=
NULL
;
switch_xml_t
x_member
=
NULL
,
x_members
=
NULL
,
x_flags
;
int
moff
=
0
;
...
...
@@ -6208,9 +6168,9 @@ static void conference_cdr_render(conference_obj_t *conference)
}
switch_mutex_unlock
(
conference
->
member_mutex
);
}
static
switch_status_t
conf_api_sub_xml_list
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
}
static
switch_status_t
conf_api_sub_xml_list
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
int
count
=
0
;
switch_hash_index_t
*
hi
;
void
*
val
;
...
...
@@ -6251,10 +6211,10 @@ static void conference_cdr_render(conference_obj_t *conference)
free
(
ebuf
);
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_pause_play
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_pause_play
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
if
(
argc
==
2
)
{
switch_mutex_lock
(
conference
->
mutex
);
if
(
conference
->
fnode
)
{
...
...
@@ -6272,10 +6232,10 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
SWITCH_STATUS_GENERR
;
}
}
static
switch_status_t
conf_api_sub_file_seek
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_file_seek
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
if
(
argc
==
3
)
{
unsigned
int
samps
=
0
;
unsigned
int
pos
=
0
;
...
...
@@ -6312,10 +6272,10 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
SWITCH_STATUS_GENERR
;
}
}
static
switch_status_t
conf_api_sub_play
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_play
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
int
ret_status
=
SWITCH_STATUS_GENERR
;
switch_event_t
*
event
;
uint8_t
async
=
0
;
...
...
@@ -6383,10 +6343,10 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
ret_status
;
}
}
static
switch_status_t
conf_api_sub_say
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
const
char
*
text
)
{
static
switch_status_t
conf_api_sub_say
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
const
char
*
text
)
{
switch_event_t
*
event
;
if
(
zstr
(
text
))
{
...
...
@@ -6407,10 +6367,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_event_fire
(
&
event
);
}
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_saymember
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
const
char
*
text
)
{
static
switch_status_t
conf_api_sub_saymember
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
const
char
*
text
)
{
int
ret_status
=
SWITCH_STATUS_GENERR
;
char
*
expanded
=
NULL
;
char
*
start_text
=
NULL
;
...
...
@@ -6476,10 +6436,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_safe_free
(
workspace
);
switch_safe_free
(
expanded
);
return
ret_status
;
}
}
static
switch_status_t
conf_api_sub_stop
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_stop
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
uint8_t
current
=
0
,
all
=
0
,
async
=
0
;
switch_assert
(
conference
!=
NULL
);
...
...
@@ -6512,10 +6472,10 @@ static void conference_cdr_render(conference_obj_t *conference)
stream
->
write_function
(
stream
,
"Stopped %u files.
\n
"
,
stopped
);
}
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_relate
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_relate
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
uint8_t
nospeak
=
0
,
nohear
=
0
,
clear
=
0
;
switch_assert
(
conference
!=
NULL
);
...
...
@@ -6595,10 +6555,10 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_lock
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_lock
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
switch_event_t
*
event
;
switch_assert
(
conference
!=
NULL
);
...
...
@@ -6617,10 +6577,10 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
0
;
}
}
static
switch_status_t
conf_api_sub_unlock
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_unlock
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
switch_event_t
*
event
;
switch_assert
(
conference
!=
NULL
);
...
...
@@ -6639,10 +6599,10 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
0
;
}
}
static
switch_status_t
conf_api_sub_exit_sound
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_exit_sound
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
switch_event_t
*
event
;
switch_assert
(
conference
!=
NULL
);
...
...
@@ -6689,11 +6649,11 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
0
;
}
}
static
switch_status_t
conf_api_sub_enter_sound
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_enter_sound
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
switch_event_t
*
event
;
switch_assert
(
conference
!=
NULL
);
...
...
@@ -6739,11 +6699,11 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
0
;
}
}
static
switch_status_t
conf_api_sub_dial
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_dial
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
switch_call_cause_t
cause
;
switch_assert
(
stream
!=
NULL
);
...
...
@@ -6761,10 +6721,10 @@ static void conference_cdr_render(conference_obj_t *conference)
stream
->
write_function
(
stream
,
"Call Requested: result: [%s]
\n
"
,
switch_channel_cause2str
(
cause
));
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_bgdial
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_bgdial
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
switch_uuid_t
uuid
;
char
uuid_str
[
SWITCH_UUID_FORMATTED_LENGTH
+
1
];
...
...
@@ -6787,12 +6747,12 @@ static void conference_cdr_render(conference_obj_t *conference)
stream
->
write_function
(
stream
,
"OK Job-UUID: %s
\n
"
,
uuid_str
);
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_transfer
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_transfer
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
switch_status_t
ret_status
=
SWITCH_STATUS_SUCCESS
;
char
*
conf_name
=
NULL
,
*
profile_name
;
switch_event_t
*
params
=
NULL
;
...
...
@@ -6854,10 +6814,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_safe_free
(
conf_name
);
return
ret_status
;
}
}
static
switch_status_t
conf_api_sub_check_record
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
arc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_check_record
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
arc
,
char
**
argv
)
{
conference_record_t
*
rec
;
int
x
=
0
;
...
...
@@ -6873,10 +6833,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_mutex_unlock
(
conference
->
flag_mutex
);
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_record
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_record
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
switch_assert
(
conference
!=
NULL
);
switch_assert
(
stream
!=
NULL
);
...
...
@@ -6889,10 +6849,10 @@ static void conference_cdr_render(conference_obj_t *conference)
conference
->
record_count
++
;
launch_conference_record_thread
(
conference
,
argv
[
2
],
SWITCH_FALSE
);
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_norecord
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_norecord
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
int
all
,
before
=
conference
->
record_count
,
ttl
=
0
;
switch_event_t
*
event
;
...
...
@@ -6921,10 +6881,10 @@ static void conference_cdr_render(conference_obj_t *conference)
stream
->
write_function
(
stream
,
"Stopped recording %d file%s
\n
"
,
ttl
,
ttl
==
1
?
""
:
"s"
);
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_pauserec
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_pauserec
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
switch_event_t
*
event
;
recording_action_type_t
action
;
...
...
@@ -6964,10 +6924,10 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
conf_api_sub_recording
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_recording
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
switch_assert
(
conference
!=
NULL
);
switch_assert
(
stream
!=
NULL
);
...
...
@@ -7007,10 +6967,10 @@ static void conference_cdr_render(conference_obj_t *conference)
return
SWITCH_STATUS_GENERR
;
}
}
}
}
static
switch_status_t
conf_api_sub_file_vol
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_file_vol
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
if
(
argc
>=
1
)
{
conference_file_node_t
*
fnode
;
int
vol
=
0
;
...
...
@@ -7055,10 +7015,10 @@ static void conference_cdr_render(conference_obj_t *conference)
stream
->
write_function
(
stream
,
"Invalid parameters:
\n
"
);
return
SWITCH_STATUS_GENERR
;
}
}
}
static
switch_status_t
conf_api_sub_pin
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
static
switch_status_t
conf_api_sub_pin
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
switch_assert
(
conference
!=
NULL
);
switch_assert
(
stream
!=
NULL
);
...
...
@@ -7078,9 +7038,9 @@ static void conference_cdr_render(conference_obj_t *conference)
stream
->
write_function
(
stream
,
"Invalid parameters:
\n
"
);
return
SWITCH_STATUS_GENERR
;
}
}
}
static
switch_status_t
conf_api_sub_get
(
conference_obj_t
*
conference
,
static
switch_status_t
conf_api_sub_get
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
int
ret_status
=
SWITCH_STATUS_GENERR
;
...
...
@@ -7130,9 +7090,9 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
ret_status
;
}
}
static
switch_status_t
conf_api_sub_set
(
conference_obj_t
*
conference
,
static
switch_status_t
conf_api_sub_set
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
)
{
int
ret_status
=
SWITCH_STATUS_GENERR
;
...
...
@@ -7171,9 +7131,9 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
ret_status
;
}
}
typedef
enum
{
typedef
enum
{
CONF_API_COMMAND_LIST
=
0
,
CONF_API_COMMAND_ENERGY
,
CONF_API_COMMAND_VOLUME_IN
,
...
...
@@ -7202,11 +7162,11 @@ static void conference_cdr_render(conference_obj_t *conference)
CONF_API_COMMAND_NOPIN
,
CONF_API_COMMAND_GET
,
CONF_API_COMMAND_SET
,
}
api_command_type_t
;
}
api_command_type_t
;
/* API Interface Function sub-commands */
/* Entries in this list should be kept in sync with the enum above */
static
api_command_t
conf_api_sub_commands
[]
=
{
/* API Interface Function sub-commands */
/* Entries in this list should be kept in sync with the enum above */
static
api_command_t
conf_api_sub_commands
[]
=
{
{
"list"
,
(
void_fn_t
)
&
conf_api_sub_list
,
CONF_API_SUB_ARGS_SPLIT
,
"list"
,
"[delim <string>]|[count]"
},
{
"xml_list"
,
(
void_fn_t
)
&
conf_api_sub_xml_list
,
CONF_API_SUB_ARGS_SPLIT
,
"xml_list"
,
""
},
{
"energy"
,
(
void_fn_t
)
&
conf_api_sub_energy
,
CONF_API_SUB_MEMBER_TARGET
,
"energy"
,
"<member_id|all|last|non_moderator> [<newval>]"
},
...
...
@@ -7226,8 +7186,6 @@ static void conference_cdr_render(conference_obj_t *conference)
{
"unmute"
,
(
void_fn_t
)
&
conf_api_sub_unmute
,
CONF_API_SUB_MEMBER_TARGET
,
"unmute"
,
"<[member_id|all]|last|non_moderator>"
},
{
"deaf"
,
(
void_fn_t
)
&
conf_api_sub_deaf
,
CONF_API_SUB_MEMBER_TARGET
,
"deaf"
,
"<[member_id|all]|last|non_moderator>"
},
{
"undeaf"
,
(
void_fn_t
)
&
conf_api_sub_undeaf
,
CONF_API_SUB_MEMBER_TARGET
,
"undeaf"
,
"<[member_id|all]|last|non_moderator>"
},
{
"tool"
,
(
void_fn_t
)
&
conf_api_sub_tool
,
CONF_API_SUB_MEMBER_TARGET
,
""
,
""
},
{
"untool"
,
(
void_fn_t
)
&
conf_api_sub_untool
,
CONF_API_SUB_MEMBER_TARGET
,
""
,
""
},
{
"relate"
,
(
void_fn_t
)
&
conf_api_sub_relate
,
CONF_API_SUB_ARGS_SPLIT
,
"relate"
,
"<member_id> <other_member_id> [nospeak|nohear|clear]"
},
{
"lock"
,
(
void_fn_t
)
&
conf_api_sub_lock
,
CONF_API_SUB_ARGS_SPLIT
,
"lock"
,
""
},
{
"unlock"
,
(
void_fn_t
)
&
conf_api_sub_unlock
,
CONF_API_SUB_ARGS_SPLIT
,
"unlock"
,
""
},
...
...
@@ -7251,12 +7209,12 @@ static void conference_cdr_render(conference_obj_t *conference)
{
"floor"
,
(
void_fn_t
)
&
conf_api_sub_floor
,
CONF_API_SUB_MEMBER_TARGET
,
"floor"
,
"<member_id|last>"
},
{
"vid-floor"
,
(
void_fn_t
)
&
conf_api_sub_vid_floor
,
CONF_API_SUB_MEMBER_TARGET
,
"vid-floor"
,
"<member_id|last> [force]"
},
{
"clear-vid-floor"
,
(
void_fn_t
)
&
conf_api_sub_clear_vid_floor
,
CONF_API_SUB_ARGS_AS_ONE
,
"clear-vid-floor"
,
""
}
};
};
#define CONFFUNCAPISIZE (sizeof(conf_api_sub_commands)/sizeof(conf_api_sub_commands[0]))
switch_status_t
conf_api_dispatch
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
,
const
char
*
cmdline
,
int
argn
)
{
switch_status_t
conf_api_dispatch
(
conference_obj_t
*
conference
,
switch_stream_handle_t
*
stream
,
int
argc
,
char
**
argv
,
const
char
*
cmdline
,
int
argn
)
{
switch_status_t
status
=
SWITCH_STATUS_FALSE
;
uint32_t
i
,
found
=
0
;
switch_assert
(
conference
!=
NULL
);
...
...
@@ -7369,11 +7327,11 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
status
;
}
}
/* API Interface Function */
SWITCH_STANDARD_API
(
conf_api_main
)
{
/* API Interface Function */
SWITCH_STANDARD_API
(
conf_api_main
)
{
char
*
lbuf
=
NULL
;
switch_status_t
status
=
SWITCH_STATUS_SUCCESS
;
char
*
http
=
NULL
,
*
type
=
NULL
;
...
...
@@ -7443,20 +7401,18 @@ static void conference_cdr_render(conference_obj_t *conference)
int
i
;
for
(
i
=
0
;
i
<
CONFFUNCAPISIZE
;
i
++
)
{
if
(
!
switch_strlen_zero
(
conf_api_sub_commands
[
i
].
psyntax
))
{
stream
->
write_function
(
stream
,
"<conf name> %s %s
\n
"
,
conf_api_sub_commands
[
i
].
pcommand
,
conf_api_sub_commands
[
i
].
psyntax
);
}
}
}
switch_safe_free
(
lbuf
);
return
status
;
}
}
/* generate an outbound call from the conference */
static
switch_status_t
conference_outcall
(
conference_obj_t
*
conference
,
/* generate an outbound call from the conference */
static
switch_status_t
conference_outcall
(
conference_obj_t
*
conference
,
char
*
conference_name
,
switch_core_session_t
*
session
,
char
*
bridgeto
,
uint32_t
timeout
,
...
...
@@ -7465,7 +7421,7 @@ static void conference_cdr_render(conference_obj_t *conference)
char
*
profile
,
switch_call_cause_t
*
cause
,
switch_call_cause_t
*
cancel_cause
,
switch_event_t
*
var_event
)
{
{
switch_core_session_t
*
peer_session
=
NULL
;
switch_channel_t
*
peer_channel
;
switch_status_t
status
=
SWITCH_STATUS_SUCCESS
;
...
...
@@ -7615,9 +7571,9 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
status
;
}
}
struct
bg_call
{
struct
bg_call
{
conference_obj_t
*
conference
;
switch_core_session_t
*
session
;
char
*
bridgeto
;
...
...
@@ -7631,10 +7587,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_call_cause_t
*
cancel_cause
;
switch_event_t
*
var_event
;
switch_memory_pool_t
*
pool
;
};
};
static
void
*
SWITCH_THREAD_FUNC
conference_outcall_run
(
switch_thread_t
*
thread
,
void
*
obj
)
{
static
void
*
SWITCH_THREAD_FUNC
conference_outcall_run
(
switch_thread_t
*
thread
,
void
*
obj
)
{
struct
bg_call
*
call
=
(
struct
bg_call
*
)
obj
;
if
(
call
)
{
...
...
@@ -7673,13 +7629,13 @@ static void conference_cdr_render(conference_obj_t *conference)
}
return
NULL
;
}
}
static
switch_status_t
conference_outcall_bg
(
conference_obj_t
*
conference
,
static
switch_status_t
conference_outcall_bg
(
conference_obj_t
*
conference
,
char
*
conference_name
,
switch_core_session_t
*
session
,
char
*
bridgeto
,
uint32_t
timeout
,
const
char
*
flags
,
const
char
*
cid_name
,
const
char
*
cid_num
,
const
char
*
call_uuid
,
const
char
*
profile
,
switch_call_cause_t
*
cancel_cause
,
switch_event_t
**
var_event
)
{
{
struct
bg_call
*
call
=
NULL
;
switch_thread_t
*
thread
;
switch_threadattr_t
*
thd_attr
=
NULL
;
...
...
@@ -7738,12 +7694,12 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Launching BG Thread for outcall
\n
"
);
return
SWITCH_STATUS_SUCCESS
;
}
}
/* Play a file */
static
switch_status_t
conference_local_play_file
(
conference_obj_t
*
conference
,
switch_core_session_t
*
session
,
char
*
path
,
uint32_t
leadin
,
void
*
buf
,
/* Play a file */
static
switch_status_t
conference_local_play_file
(
conference_obj_t
*
conference
,
switch_core_session_t
*
session
,
char
*
path
,
uint32_t
leadin
,
void
*
buf
,
uint32_t
buflen
)
{
{
uint32_t
x
=
0
;
switch_status_t
status
=
SWITCH_STATUS_SUCCESS
;
switch_channel_t
*
channel
;
...
...
@@ -7802,10 +7758,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_safe_free
(
expanded
);
return
status
;
}
}
static
void
set_mflags
(
const
char
*
flags
,
member_flag_t
*
f
)
{
static
void
set_mflags
(
const
char
*
flags
,
member_flag_t
*
f
)
{
if
(
flags
)
{
char
*
dup
=
strdup
(
flags
);
char
*
p
;
...
...
@@ -7845,12 +7801,12 @@ static void conference_cdr_render(conference_obj_t *conference)
free
(
dup
);
}
}
}
static
void
set_cflags
(
const
char
*
flags
,
uint32_t
*
f
)
{
static
void
set_cflags
(
const
char
*
flags
,
uint32_t
*
f
)
{
if
(
flags
)
{
char
*
dup
=
strdup
(
flags
);
char
*
p
;
...
...
@@ -7889,11 +7845,11 @@ static void conference_cdr_render(conference_obj_t *conference)
free
(
dup
);
}
}
}
static
void
clear_eflags
(
char
*
events
,
uint32_t
*
f
)
{
static
void
clear_eflags
(
char
*
events
,
uint32_t
*
f
)
{
char
buf
[
512
]
=
""
;
char
*
next
=
NULL
;
char
*
event
=
buf
;
...
...
@@ -7966,10 +7922,10 @@ static void conference_cdr_render(conference_obj_t *conference)
event
=
next
;
}
}
}
}
SWITCH_STANDARD_APP
(
conference_auto_function
)
{
SWITCH_STANDARD_APP
(
conference_auto_function
)
{
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
call_list_t
*
call_list
,
*
np
;
...
...
@@ -7991,11 +7947,11 @@ static void conference_cdr_render(conference_obj_t *conference)
call_list
=
np
;
}
switch_channel_set_private
(
channel
,
"_conference_autocall_list_"
,
call_list
);
}
}
static
int
setup_media
(
conference_member_t
*
member
,
conference_obj_t
*
conference
)
{
static
int
setup_media
(
conference_member_t
*
member
,
conference_obj_t
*
conference
)
{
switch_codec_implementation_t
read_impl
=
{
0
};
switch_core_session_get_read_impl
(
member
->
session
,
&
read_impl
);
...
...
@@ -8094,7 +8050,7 @@ static void conference_cdr_render(conference_obj_t *conference)
return
-
1
;
}
}
#define validate_pin(buf, pin, mpin) \
pin_valid = (!zstr(pin) && strcmp(buf, pin) == 0); \
...
...
@@ -8103,9 +8059,9 @@ static void conference_cdr_render(conference_obj_t *conference)
pin_valid = 1; \
mpin_matched = 1; \
}
/* Application interface function that is called from the dialplan to join the channel to a conference */
SWITCH_STANDARD_APP
(
conference_function
)
{
/* Application interface function that is called from the dialplan to join the channel to a conference */
SWITCH_STANDARD_APP
(
conference_function
)
{
switch_codec_t
*
read_codec
=
NULL
;
//uint32_t flags = 0;
conference_member_t
member
=
{
0
};
...
...
@@ -8695,11 +8651,11 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_channel_clear_flag
(
channel
,
CF_VIDEO_PASSIVE
);
switch_core_session_video_reset
(
session
);
}
}
/* Create a thread for the conference and launch it */
static
void
launch_conference_thread
(
conference_obj_t
*
conference
)
{
/* Create a thread for the conference and launch it */
static
void
launch_conference_thread
(
conference_obj_t
*
conference
)
{
switch_thread_t
*
thread
;
switch_threadattr_t
*
thd_attr
=
NULL
;
...
...
@@ -8711,10 +8667,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_mutex_lock
(
globals
.
hash_mutex
);
switch_mutex_unlock
(
globals
.
hash_mutex
);
switch_thread_create
(
&
thread
,
thd_attr
,
conference_thread_run
,
conference
,
conference
->
pool
);
}
}
static
switch_thread_t
*
launch_thread_detached
(
switch_thread_start_t
func
,
switch_memory_pool_t
*
pool
,
void
*
data
)
{
static
switch_thread_t
*
launch_thread_detached
(
switch_thread_start_t
func
,
switch_memory_pool_t
*
pool
,
void
*
data
)
{
switch_thread_t
*
thread
;
switch_threadattr_t
*
thd_attr
=
NULL
;
...
...
@@ -8724,18 +8680,18 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_thread_create
(
&
thread
,
thd_attr
,
func
,
data
,
pool
);
return
thread
;
}
}
/* Create a video thread for the conference and launch it */
static
void
launch_conference_video_thread
(
conference_obj_t
*
conference
)
{
/* Create a video thread for the conference and launch it */
static
void
launch_conference_video_thread
(
conference_obj_t
*
conference
)
{
launch_thread_detached
(
conference_video_thread_run
,
conference
->
pool
,
conference
);
conference
->
video_running
=
1
;
}
}
/* Create a video thread for the conference and launch it */
static
int
launch_conference_video_bridge_thread
(
conference_member_t
*
member_a
,
conference_member_t
*
member_b
)
{
/* Create a video thread for the conference and launch it */
static
int
launch_conference_video_bridge_thread
(
conference_member_t
*
member_a
,
conference_member_t
*
member_b
)
{
conference_obj_t
*
conference
=
member_a
->
conference
;
switch_memory_pool_t
*
pool
=
conference
->
pool
;
int
sanity
=
10000
,
r
=
0
;
...
...
@@ -8767,10 +8723,10 @@ static void conference_cdr_render(conference_obj_t *conference)
return
r
;
}
}
static
void
launch_conference_record_thread
(
conference_obj_t
*
conference
,
char
*
path
,
switch_bool_t
autorec
)
{
static
void
launch_conference_record_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
;
...
...
@@ -8802,10 +8758,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_threadattr_detach_set
(
thd_attr
,
1
);
switch_threadattr_stacksize_set
(
thd_attr
,
SWITCH_THREAD_STACKSIZE
);
switch_thread_create
(
&
thread
,
thd_attr
,
conference_record_thread_run
,
rec
,
rec
->
pool
);
}
}
static
switch_status_t
chat_send
(
switch_event_t
*
message_event
)
{
static
switch_status_t
chat_send
(
switch_event_t
*
message_event
)
{
char
name
[
512
]
=
""
,
*
p
,
*
lbuf
=
NULL
;
conference_obj_t
*
conference
=
NULL
;
switch_stream_handle_t
stream
=
{
0
};
...
...
@@ -8868,10 +8824,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_thread_rwlock_unlock
(
conference
->
rwlock
);
return
SWITCH_STATUS_SUCCESS
;
}
}
static
conference_obj_t
*
conference_find
(
char
*
name
,
char
*
domain
)
{
static
conference_obj_t
*
conference_find
(
char
*
name
,
char
*
domain
)
{
conference_obj_t
*
conference
;
switch_mutex_lock
(
globals
.
hash_mutex
);
...
...
@@ -8893,11 +8849,11 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_mutex_unlock
(
globals
.
hash_mutex
);
return
conference
;
}
}
/* create a new conferene with a specific profile */
static
conference_obj_t
*
conference_new
(
char
*
name
,
conf_xml_cfg_t
cfg
,
switch_core_session_t
*
session
,
switch_memory_pool_t
*
pool
)
{
/* create a new conferene with a specific profile */
static
conference_obj_t
*
conference_new
(
char
*
name
,
conf_xml_cfg_t
cfg
,
switch_core_session_t
*
session
,
switch_memory_pool_t
*
pool
)
{
conference_obj_t
*
conference
;
switch_xml_t
xml_kvp
;
char
*
timer_name
=
NULL
;
...
...
@@ -9457,10 +9413,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_mutex_unlock
(
globals
.
hash_mutex
);
return
conference
;
}
}
static
void
conference_send_presence
(
conference_obj_t
*
conference
)
{
static
void
conference_send_presence
(
conference_obj_t
*
conference
)
{
switch_event_t
*
event
;
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_PRESENCE_IN
)
==
SWITCH_STATUS_SUCCESS
)
{
...
...
@@ -9494,10 +9450,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_event_fire
(
&
event
);
}
}
}
#if 0
static uint32_t kickall_matching_var(conference_obj_t *conference, const char *var, const char *val)
{
static uint32_t kickall_matching_var(conference_obj_t *conference, const char *var, const char *val)
{
conference_member_t *member = NULL;
const char *vval = NULL;
uint32_t r = 0;
...
...
@@ -9528,11 +9484,11 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_mutex_unlock(conference->mutex);
return r;
}
}
#endif
static
void
call_setup_event_handler
(
switch_event_t
*
event
)
{
static
void
call_setup_event_handler
(
switch_event_t
*
event
)
{
switch_status_t
status
=
SWITCH_STATUS_FALSE
;
conference_obj_t
*
conference
=
NULL
;
char
*
conf
=
switch_event_get_header
(
event
,
"Target-Component"
);
...
...
@@ -9630,10 +9586,10 @@ static void conference_cdr_render(conference_obj_t *conference)
}
}
}
}
static
void
conf_data_event_handler
(
switch_event_t
*
event
)
{
static
void
conf_data_event_handler
(
switch_event_t
*
event
)
{
switch_event_t
*
revent
;
char
*
name
=
switch_event_get_header
(
event
,
"conference-name"
);
char
*
domain
=
switch_event_get_header
(
event
,
"conference-domain"
);
...
...
@@ -9654,11 +9610,11 @@ static void conference_cdr_render(conference_obj_t *conference)
}
switch_thread_rwlock_unlock
(
conference
->
rwlock
);
}
}
}
static
void
pres_event_handler
(
switch_event_t
*
event
)
{
static
void
pres_event_handler
(
switch_event_t
*
event
)
{
char
*
to
=
switch_event_get_header
(
event
,
"to"
);
char
*
domain_name
=
NULL
;
char
*
dup_to
=
NULL
,
*
conf_name
,
*
dup_conf_name
=
NULL
;
...
...
@@ -9718,10 +9674,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_safe_free
(
dup_to
);
switch_safe_free
(
dup_conf_name
);
}
}
static
void
send_presence
(
switch_event_types_t
id
)
{
static
void
send_presence
(
switch_event_types_t
id
)
{
switch_xml_t
cxml
,
cfg
,
advertise
,
room
;
switch_event_t
*
params
=
NULL
;
...
...
@@ -9762,19 +9718,19 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_xml_free
(
cxml
);
cxml
=
NULL
;
}
}
}
typedef
void
(
*
conf_key_callback_t
)
(
conference_member_t
*
,
struct
caller_control_actions
*
);
typedef
void
(
*
conf_key_callback_t
)
(
conference_member_t
*
,
struct
caller_control_actions
*
);
typedef
struct
{
typedef
struct
{
conference_member_t
*
member
;
caller_control_action_t
action
;
conf_key_callback_t
handler
;
}
key_binding_t
;
}
key_binding_t
;
static
switch_status_t
dmachine_dispatcher
(
switch_ivr_dmachine_match_t
*
match
)
{
static
switch_status_t
dmachine_dispatcher
(
switch_ivr_dmachine_match_t
*
match
)
{
key_binding_t
*
binding
=
match
->
user_data
;
switch_channel_t
*
channel
;
...
...
@@ -9797,10 +9753,10 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_set_flag_locked
(
binding
->
member
,
MFLAG_FLUSH_BUFFER
);
return
SWITCH_STATUS_SUCCESS
;
}
}
static
void
do_binding
(
conference_member_t
*
member
,
conf_key_callback_t
handler
,
const
char
*
digits
,
const
char
*
data
)
{
static
void
do_binding
(
conference_member_t
*
member
,
conf_key_callback_t
handler
,
const
char
*
digits
,
const
char
*
data
)
{
key_binding_t
*
binding
;
binding
=
switch_core_alloc
(
member
->
pool
,
sizeof
(
*
binding
));
...
...
@@ -9815,14 +9771,14 @@ static void conference_cdr_render(conference_obj_t *conference)
binding
->
handler
=
handler
;
switch_ivr_dmachine_bind
(
member
->
dmachine
,
"conf"
,
digits
,
0
,
dmachine_dispatcher
,
binding
);
}
}
struct
_mapping
{
struct
_mapping
{
const
char
*
name
;
conf_key_callback_t
handler
;
};
};
static
struct
_mapping
control_mappings
[]
=
{
static
struct
_mapping
control_mappings
[]
=
{
{
"mute"
,
conference_loop_fn_mute_toggle
},
{
"mute on"
,
conference_loop_fn_mute_on
},
{
"mute off"
,
conference_loop_fn_mute_off
},
...
...
@@ -9844,11 +9800,11 @@ static void conference_cdr_render(conference_obj_t *conference)
{
"floor"
,
conference_loop_fn_floor_toggle
},
{
"vid-floor"
,
conference_loop_fn_vid_floor_toggle
},
{
"vid-floor-force"
,
conference_loop_fn_vid_floor_force
}
};
};
#define MAPPING_LEN (sizeof(control_mappings)/sizeof(control_mappings[0]))
static
void
member_bind_controls
(
conference_member_t
*
member
,
const
char
*
controls
)
{
static
void
member_bind_controls
(
conference_member_t
*
member
,
const
char
*
controls
)
{
switch_xml_t
cxml
,
cfg
,
xgroups
,
xcontrol
;
switch_event_t
*
params
;
int
i
;
...
...
@@ -9901,14 +9857,14 @@ static void conference_cdr_render(conference_obj_t *conference)
if
(
params
)
switch_event_destroy
(
&
params
);
}
}
/* Called by FreeSWITCH when the module loads */
SWITCH_MODULE_LOAD_FUNCTION
(
mod_conference_load
)
{
/* Called by FreeSWITCH when the module loads */
SWITCH_MODULE_LOAD_FUNCTION
(
mod_conference_load
)
{
uint32_t
i
;
size_t
nl
,
ol
=
0
;
char
*
p
=
NULL
,
*
tmp
=
NULL
;
...
...
@@ -10000,10 +9956,10 @@ static void conference_cdr_render(conference_obj_t *conference)
globals
.
running
=
1
;
/* indicate that the module should continue to be loaded */
return
status
;
}
}
SWITCH_MODULE_SHUTDOWN_FUNCTION
(
mod_conference_shutdown
)
{
SWITCH_MODULE_SHUTDOWN_FUNCTION
(
mod_conference_shutdown
)
{
if
(
globals
.
running
)
{
/* signal all threads to shutdown */
...
...
@@ -10031,9 +9987,9 @@ static void conference_cdr_render(conference_obj_t *conference)
switch_core_hash_destroy
(
&
globals
.
conference_hash
);
return
SWITCH_STATUS_SUCCESS
;
}
}
/* For Emacs:
/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:t
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论