Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
a391d82b
提交
a391d82b
authored
4月 28, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove unused code
上级
3829e2fd
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
53 行增加
和
73 行删除
+53
-73
mod_conference.c
src/mod/applications/mod_conference/mod_conference.c
+53
-73
没有找到文件。
src/mod/applications/mod_conference/mod_conference.c
浏览文件 @
a391d82b
...
@@ -2500,20 +2500,10 @@ static void conference_loop_output(conference_member_t *member)
...
@@ -2500,20 +2500,10 @@ static void conference_loop_output(conference_member_t *member)
uint32_t
flush_len
;
uint32_t
flush_len
;
uint32_t
low_count
,
bytes
;
uint32_t
low_count
,
bytes
;
call_list_t
*
call_list
,
*
cp
;
call_list_t
*
call_list
,
*
cp
;
int
restarting
=
-
1
;
switch_codec_implementation_t
read_impl
=
{
0
};
switch_codec_implementation_t
read_impl
=
{
0
};
top:
switch_core_session_get_read_impl
(
member
->
session
,
&
read_impl
);
switch_core_session_get_read_impl
(
member
->
session
,
&
read_impl
);
restarting
++
;
if
(
switch_test_flag
(
member
,
MFLAG_RESTART
))
{
switch_clear_flag
(
member
,
MFLAG_RESTART
);
switch_set_flag_locked
(
member
,
MFLAG_FLUSH_BUFFER
);
switch_core_timer_destroy
(
&
timer
);
}
channel
=
switch_core_session_get_channel
(
member
->
session
);
channel
=
switch_core_session_get_channel
(
member
->
session
);
interval
=
read_impl
.
microseconds_per_packet
/
1000
;
interval
=
read_impl
.
microseconds_per_packet
/
1000
;
...
@@ -2540,82 +2530,77 @@ static void conference_loop_output(conference_member_t *member)
...
@@ -2540,82 +2530,77 @@ static void conference_loop_output(conference_member_t *member)
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
member
->
session
),
SWITCH_LOG_DEBUG
,
"Setup timer %s success interval: %u samples: %u
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
member
->
session
),
SWITCH_LOG_DEBUG
,
"Setup timer %s success interval: %u samples: %u
\n
"
,
member
->
conference
->
timer_name
,
interval
,
tsamples
);
member
->
conference
->
timer_name
,
interval
,
tsamples
);
if
(
!
restarting
)
{
write_frame
.
data
=
data
=
switch_core_session_alloc
(
member
->
session
,
SWITCH_RECOMMENDED_BUFFER_SIZE
);
write_frame
.
data
=
data
=
switch_core_session_alloc
(
member
->
session
,
SWITCH_RECOMMENDED_BUFFER_SIZE
);
write_frame
.
buflen
=
SWITCH_RECOMMENDED_BUFFER_SIZE
;
write_frame
.
buflen
=
SWITCH_RECOMMENDED_BUFFER_SIZE
;
}
write_frame
.
codec
=
&
member
->
write_codec
;
write_frame
.
codec
=
&
member
->
write_codec
;
if
(
!
restarting
)
{
/* Start the input thread */
/* Start the input thread */
launch_conference_loop_input
(
member
,
switch_core_session_get_pool
(
member
->
session
));
launch_conference_loop_input
(
member
,
switch_core_session_get_pool
(
member
->
session
));
if
((
call_list
=
switch_channel_get_private
(
channel
,
"_conference_autocall_list_"
)))
{
const
char
*
cid_name
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_caller_id_name"
);
const
char
*
cid_num
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_caller_id_number"
);
const
char
*
toval
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_timeout"
);
const
char
*
flags
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_flags"
);
const
char
*
profile
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_profile"
);
const
char
*
ann
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_announce"
);
const
char
*
prefix
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_prefix"
);
int
to
=
60
;
if
(
ann
&&
!
switch_channel_test_app_flag_key
(
"conf_silent"
,
channel
,
CONF_SILENT_REQ
))
{
member
->
conference
->
special_announce
=
switch_core_strdup
(
member
->
conference
->
pool
,
ann
);
}
switch_channel_set_private
(
channel
,
"_conference_autocall_list_"
,
NULL
);
if
((
call_list
=
switch_channel_get_private
(
channel
,
"_conference_autocall_list_"
)))
{
const
char
*
cid_name
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_caller_id_name"
);
const
char
*
cid_num
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_caller_id_number"
);
const
char
*
toval
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_timeout"
);
const
char
*
flags
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_flags"
);
const
char
*
profile
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_profile"
);
const
char
*
ann
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_announce"
);
const
char
*
prefix
=
switch_channel_get_variable
(
channel
,
"conference_auto_outcall_prefix"
);
int
to
=
60
;
switch_set_flag
(
member
->
conference
,
CFLAG_OUTCALL
);
if
(
ann
&&
!
switch_channel_test_app_flag_key
(
"conf_silent"
,
channel
,
CONF_SILENT_REQ
))
{
member
->
conference
->
special_announce
=
switch_core_strdup
(
member
->
conference
->
pool
,
ann
);
}
if
(
toval
)
{
switch_channel_set_private
(
channel
,
"_conference_autocall_list_"
,
NULL
);
to
=
atoi
(
toval
);
if
(
to
<
10
||
to
>
500
)
{
to
=
60
;
}
}
for
(
cp
=
call_list
;
cp
;
cp
=
cp
->
next
)
{
switch_set_flag
(
member
->
conference
,
CFLAG_OUTCALL
);
int
argc
;
char
*
argv
[
512
]
=
{
0
};
char
*
cpstr
=
strdup
(
cp
->
string
);
int
x
=
0
;
switch_assert
(
cpstr
);
argc
=
switch_separate_string
(
cpstr
,
','
,
argv
,
(
sizeof
(
argv
)
/
sizeof
(
argv
[
0
])));
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
,
profile
,
&
member
->
conference
->
cancel_cause
);
switch_safe_free
(
dial_str
);
}
switch_safe_free
(
cpstr
);
}
do
{
if
(
toval
)
{
switch_ivr_sleep
(
member
->
session
,
500
,
SWITCH_TRUE
,
NULL
);
to
=
atoi
(
toval
);
}
while
(
switch_channel_up
(
channel
)
&&
member
->
conference
->
originating
);
if
(
to
<
10
||
to
>
500
)
{
to
=
60
;
}
}
if
(
!
switch_channel_ready
(
channel
))
{
for
(
cp
=
call_list
;
cp
;
cp
=
cp
->
next
)
{
member
->
conference
->
cancel_cause
=
SWITCH_CAUSE_ORIGINATOR_CANCEL
;
int
argc
;
goto
end
;
char
*
argv
[
512
]
=
{
0
};
char
*
cpstr
=
strdup
(
cp
->
string
);
int
x
=
0
;
switch_assert
(
cpstr
);
argc
=
switch_separate_string
(
cpstr
,
','
,
argv
,
(
sizeof
(
argv
)
/
sizeof
(
argv
[
0
])));
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
,
profile
,
&
member
->
conference
->
cancel_cause
);
switch_safe_free
(
dial_str
);
}
}
switch_safe_free
(
cpstr
);
conference_member_play_file
(
member
,
"tone_stream://%(500,0,640)"
,
0
);
}
switch_channel_set_app_flag
(
channel
,
CF_APP_TAGGED
);
do
{
switch_ivr_sleep
(
member
->
session
,
500
,
SWITCH_TRUE
,
NULL
);
}
while
(
switch_channel_up
(
channel
)
&&
member
->
conference
->
originating
);
switch_channel_clear_app_flag
(
channel
,
CF_APP_TAGGED
);
if
(
!
switch_channel_ready
(
channel
))
{
member
->
conference
->
cancel_cause
=
SWITCH_CAUSE_ORIGINATOR_CANCEL
;
goto
end
;
}
}
conference_member_play_file
(
member
,
"tone_stream://%(500,0,640)"
,
0
);
}
}
if
(
!
switch_test_flag
(
member
->
conference
,
CFLAG_ANSWERED
))
{
if
(
!
switch_test_flag
(
member
->
conference
,
CFLAG_ANSWERED
))
{
switch_channel_answer
(
channel
);
switch_channel_answer
(
channel
);
}
}
if
(
restarting
)
{
switch_channel_clear_app_flag
(
channel
,
CF_APP_TAGGED
);
}
/* Fair WARNING, If you expect the caller to hear anything or for digit handling to be processed, */
/* Fair WARNING, If you expect the caller to hear anything or for digit handling to be processed, */
/* you better not block this thread loop for more than the duration of member->conference->timer_name! */
/* you better not block this thread loop for more than the duration of member->conference->timer_name! */
while
(
switch_test_flag
(
member
,
MFLAG_RUNNING
)
&&
switch_test_flag
(
member
,
MFLAG_ITHREAD
)
while
(
switch_test_flag
(
member
,
MFLAG_RUNNING
)
&&
switch_test_flag
(
member
,
MFLAG_ITHREAD
)
...
@@ -2628,11 +2613,6 @@ static void conference_loop_output(conference_member_t *member)
...
@@ -2628,11 +2613,6 @@ static void conference_loop_output(conference_member_t *member)
switch_mutex_lock
(
member
->
write_mutex
);
switch_mutex_lock
(
member
->
write_mutex
);
if
(
switch_test_flag
(
member
,
MFLAG_RESTART
))
{
switch_mutex_unlock
(
member
->
write_mutex
);
goto
top
;
}
if
(
switch_core_session_dequeue_event
(
member
->
session
,
&
event
,
SWITCH_FALSE
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_core_session_dequeue_event
(
member
->
session
,
&
event
,
SWITCH_FALSE
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
event
->
event_id
==
SWITCH_EVENT_MESSAGE
)
{
if
(
event
->
event_id
==
SWITCH_EVENT_MESSAGE
)
{
char
*
from
=
switch_event_get_header
(
event
,
"from"
);
char
*
from
=
switch_event_get_header
(
event
,
"from"
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论