Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
6f58e6aa
提交
6f58e6aa
authored
1月 26, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-2771
上级
0e0431ec
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
46 行增加
和
14 行删除
+46
-14
mod_conference.c
src/mod/applications/mod_conference/mod_conference.c
+46
-14
没有找到文件。
src/mod/applications/mod_conference/mod_conference.c
浏览文件 @
6f58e6aa
...
...
@@ -152,7 +152,8 @@ typedef enum {
CFLAG_BRIDGE_TO
=
(
1
<<
6
),
CFLAG_WAIT_MOD
=
(
1
<<
7
),
CFLAG_VID_FLOOR
=
(
1
<<
8
),
CFLAG_WASTE_BANDWIDTH
=
(
1
<<
9
)
CFLAG_WASTE_BANDWIDTH
=
(
1
<<
9
),
CFLAG_OUTCALL
=
(
1
<<
10
)
}
conf_flag_t
;
typedef
enum
{
...
...
@@ -288,6 +289,8 @@ typedef struct conference_obj {
uint32_t
avg_tally
;
switch_time_t
run_time
;
char
*
uuid_str
;
uint32_t
originating
;
switch_call_cause_t
cancel_cause
;
}
conference_obj_t
;
/* Relationship with another member */
...
...
@@ -395,11 +398,16 @@ SWITCH_STANDARD_API(conf_api_main);
static
switch_status_t
conference_outcall
(
conference_obj_t
*
conference
,
char
*
conference_name
,
switch_core_session_t
*
session
,
char
*
bridgeto
,
uint32_t
timeout
,
char
*
flags
,
char
*
cid_name
,
char
*
cid_num
,
switch_call_cause_t
*
cause
);
char
*
bridgeto
,
uint32_t
timeout
,
char
*
flags
,
char
*
cid_name
,
char
*
cid_num
,
switch_call_cause_t
*
cause
,
switch_call_cause_t
*
cancel_cause
);
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
*
cid_num
,
const
char
*
call_uuid
,
switch_call_cause_t
*
cancel_cause
);
SWITCH_STANDARD_APP
(
conference_function
);
static
void
launch_conference_thread
(
conference_obj_t
*
conference
);
static
void
launch_conference_video_thread
(
conference_obj_t
*
conference
);
...
...
@@ -1381,6 +1389,14 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v
/* Rinse ... Repeat */
end:
if
(
switch_test_flag
(
conference
,
CFLAG_OUTCALL
))
{
conference
->
cancel_cause
=
SWITCH_CAUSE_ORIGINATOR_CANCEL
;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_NOTICE
,
"Ending pending outcall channels for Conference: '%s'
\n
"
,
conference
->
name
);
while
(
conference
->
originating
)
{
switch_yield
(
200000
);
}
}
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
);
...
...
@@ -2404,6 +2420,8 @@ static void conference_loop_output(conference_member_t *member)
switch_channel_set_private
(
channel
,
"_conference_autocall_list_"
,
NULL
);
switch_set_flag
(
member
->
conference
,
CFLAG_OUTCALL
);
if
(
toval
)
{
to
=
atoi
(
toval
);
if
(
to
<
10
||
to
>
500
)
{
...
...
@@ -2422,7 +2440,8 @@ static void conference_loop_output(conference_member_t *member)
for
(
x
=
0
;
x
<
argc
;
x
++
)
{
char
*
dial_str
=
switch_mprintf
(
"%s%s"
,
switch_str_nil
(
prefix
),
argv
[
x
]);
switch_assert
(
dial_str
);
conference_outcall_bg
(
member
->
conference
,
NULL
,
NULL
,
dial_str
,
to
,
switch_str_nil
(
flags
),
cid_name
,
cid_num
,
NULL
);
conference_outcall_bg
(
member
->
conference
,
NULL
,
NULL
,
dial_str
,
to
,
switch_str_nil
(
flags
),
cid_name
,
cid_num
,
NULL
,
&
member
->
conference
->
cancel_cause
);
switch_safe_free
(
dial_str
);
}
switch_safe_free
(
cpstr
);
...
...
@@ -4244,9 +4263,9 @@ static switch_status_t conf_api_sub_dial(conference_obj_t *conference, switch_st
}
if
(
conference
)
{
conference_outcall
(
conference
,
NULL
,
NULL
,
argv
[
2
],
60
,
NULL
,
argv
[
4
],
argv
[
3
],
&
cause
);
conference_outcall
(
conference
,
NULL
,
NULL
,
argv
[
2
],
60
,
NULL
,
argv
[
4
],
argv
[
3
],
&
cause
,
NULL
);
}
else
{
conference_outcall
(
NULL
,
argv
[
0
],
NULL
,
argv
[
2
],
60
,
NULL
,
argv
[
4
],
argv
[
3
],
&
cause
);
conference_outcall
(
NULL
,
argv
[
0
],
NULL
,
argv
[
2
],
60
,
NULL
,
argv
[
4
],
argv
[
3
],
&
cause
,
NULL
);
}
stream
->
write_function
(
stream
,
"Call Requested: result: [%s]
\n
"
,
switch_channel_cause2str
(
cause
));
...
...
@@ -4269,9 +4288,9 @@ static switch_status_t conf_api_sub_bgdial(conference_obj_t *conference, switch_
switch_uuid_format
(
uuid_str
,
&
uuid
);
if
(
conference
)
{
conference_outcall_bg
(
conference
,
NULL
,
NULL
,
argv
[
2
],
60
,
NULL
,
argv
[
4
],
argv
[
3
],
uuid_str
);
conference_outcall_bg
(
conference
,
NULL
,
NULL
,
argv
[
2
],
60
,
NULL
,
argv
[
4
],
argv
[
3
],
uuid_str
,
NULL
);
}
else
{
conference_outcall_bg
(
NULL
,
argv
[
0
],
NULL
,
argv
[
2
],
60
,
NULL
,
argv
[
4
],
argv
[
3
],
uuid_str
);
conference_outcall_bg
(
NULL
,
argv
[
0
],
NULL
,
argv
[
2
],
60
,
NULL
,
argv
[
4
],
argv
[
3
],
uuid_str
,
NULL
);
}
stream
->
write_function
(
stream
,
"OK Job-UUID: %s
\n
"
,
uuid_str
);
...
...
@@ -4785,7 +4804,11 @@ SWITCH_STANDARD_API(conf_api_main)
static
switch_status_t
conference_outcall
(
conference_obj_t
*
conference
,
char
*
conference_name
,
switch_core_session_t
*
session
,
char
*
bridgeto
,
uint32_t
timeout
,
char
*
flags
,
char
*
cid_name
,
char
*
cid_num
,
switch_call_cause_t
*
cause
)
char
*
bridgeto
,
uint32_t
timeout
,
char
*
flags
,
char
*
cid_name
,
char
*
cid_num
,
switch_call_cause_t
*
cause
,
switch_call_cause_t
*
cancel_cause
)
{
switch_core_session_t
*
peer_session
=
NULL
;
switch_channel_t
*
peer_channel
;
...
...
@@ -4831,8 +4854,15 @@ static switch_status_t conference_outcall(conference_obj_t *conference,
/* establish an outbound call leg */
if
(
switch_ivr_originate
(
session
,
&
peer_session
,
cause
,
bridgeto
,
timeout
,
NULL
,
cid_name
,
cid_num
,
NULL
,
NULL
,
SOF_NO_LIMITS
,
NULL
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_mutex_lock
(
conference
->
mutex
);
conference
->
originating
++
;
switch_mutex_unlock
(
conference
->
mutex
);
status
=
switch_ivr_originate
(
session
,
&
peer_session
,
cause
,
bridgeto
,
timeout
,
NULL
,
cid_name
,
cid_num
,
NULL
,
NULL
,
SOF_NO_LIMITS
,
cancel_cause
);
switch_mutex_lock
(
conference
->
mutex
);
conference
->
originating
--
;
switch_mutex_unlock
(
conference
->
mutex
);
if
(
status
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"Cannot create outgoing channel, cause: %s
\n
"
,
switch_channel_cause2str
(
*
cause
));
if
(
caller_channel
)
{
...
...
@@ -4909,6 +4939,7 @@ struct bg_call {
char
*
cid_num
;
char
*
conference_name
;
char
*
uuid
;
switch_call_cause_t
*
cancel_cause
;
switch_memory_pool_t
*
pool
;
};
...
...
@@ -4921,7 +4952,7 @@ static void *SWITCH_THREAD_FUNC conference_outcall_run(switch_thread_t *thread,
switch_event_t
*
event
;
conference_outcall
(
call
->
conference
,
call
->
conference_name
,
call
->
session
,
call
->
bridgeto
,
call
->
timeout
,
call
->
flags
,
call
->
cid_name
,
call
->
cid_num
,
&
cause
);
call
->
session
,
call
->
bridgeto
,
call
->
timeout
,
call
->
flags
,
call
->
cid_name
,
call
->
cid_num
,
&
cause
,
call
->
cancel_cause
);
if
(
call
->
conference
&&
test_eflag
(
call
->
conference
,
EFLAG_BGDIAL_RESULT
)
&&
switch_event_create_subclass
(
&
event
,
SWITCH_EVENT_CUSTOM
,
CONF_EVENT_MAINT
)
==
SWITCH_STATUS_SUCCESS
)
{
...
...
@@ -4949,7 +4980,7 @@ static void *SWITCH_THREAD_FUNC conference_outcall_run(switch_thread_t *thread,
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
*
cid_num
,
const
char
*
call_uuid
,
switch_call_cause_t
*
cancel_cause
)
{
struct
bg_call
*
call
=
NULL
;
switch_thread_t
*
thread
;
...
...
@@ -4963,6 +4994,7 @@ static switch_status_t conference_outcall_bg(conference_obj_t *conference,
call
->
conference
=
conference
;
call
->
session
=
session
;
call
->
timeout
=
timeout
;
call
->
cancel_cause
=
cancel_cause
;
if
(
conference
)
{
pool
=
conference
->
pool
;
...
...
@@ -5717,7 +5749,7 @@ SWITCH_STANDARD_APP(conference_function)
/* if we're using "bridge:" make an outbound call and bridge it in */
if
(
!
zstr
(
bridgeto
)
&&
strcasecmp
(
bridgeto
,
"none"
))
{
switch_call_cause_t
cause
;
if
(
conference_outcall
(
conference
,
NULL
,
session
,
bridgeto
,
60
,
NULL
,
NULL
,
NULL
,
&
cause
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
conference_outcall
(
conference
,
NULL
,
session
,
bridgeto
,
60
,
NULL
,
NULL
,
NULL
,
&
cause
,
NULL
)
!=
SWITCH_STATUS_SUCCESS
)
{
goto
done
;
}
}
else
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论