Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
4bdd2a7f
提交
4bdd2a7f
authored
5月 21, 2013
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-5211 --resolve
上级
36116944
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
70 行增加
和
1 行删除
+70
-1
mod_conference.c
src/mod/applications/mod_conference/mod_conference.c
+70
-1
没有找到文件。
src/mod/applications/mod_conference/mod_conference.c
浏览文件 @
4bdd2a7f
...
@@ -209,6 +209,11 @@ typedef enum {
...
@@ -209,6 +209,11 @@ typedef enum {
NODE_TYPE_SPEECH
NODE_TYPE_SPEECH
}
node_type_t
;
}
node_type_t
;
typedef
enum
{
NFLAG_NONE
=
(
1
<<
0
),
NFLAG_PAUSE
=
(
1
<<
1
)
}
node_flag_t
;
typedef
enum
{
typedef
enum
{
EFLAG_ADD_MEMBER
=
(
1
<<
0
),
EFLAG_ADD_MEMBER
=
(
1
<<
0
),
EFLAG_DEL_MEMBER
=
(
1
<<
1
),
EFLAG_DEL_MEMBER
=
(
1
<<
1
),
...
@@ -245,6 +250,7 @@ typedef enum {
...
@@ -245,6 +250,7 @@ typedef enum {
typedef
struct
conference_file_node
{
typedef
struct
conference_file_node
{
switch_file_handle_t
fh
;
switch_file_handle_t
fh
;
switch_speech_handle_t
*
sh
;
switch_speech_handle_t
*
sh
;
node_flag_t
flags
;
node_type_t
type
;
node_type_t
type
;
uint8_t
done
;
uint8_t
done
;
uint8_t
async
;
uint8_t
async
;
...
@@ -2134,7 +2140,7 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v
...
@@ -2134,7 +2140,7 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v
}
}
/* If a file or speech event is being played */
/* If a file or speech event is being played */
if
(
conference
->
fnode
)
{
if
(
conference
->
fnode
&&
!
switch_test_flag
(
conference
->
fnode
,
NFLAG_PAUSE
)
)
{
/* Lead in time */
/* Lead in time */
if
(
conference
->
fnode
->
leadin
)
{
if
(
conference
->
fnode
->
leadin
)
{
conference
->
fnode
->
leadin
--
;
conference
->
fnode
->
leadin
--
;
...
@@ -5543,6 +5549,67 @@ static switch_status_t conf_api_sub_xml_list(conference_obj_t *conference, switc
...
@@ -5543,6 +5549,67 @@ static switch_status_t conf_api_sub_xml_list(conference_obj_t *conference, switc
return
SWITCH_STATUS_SUCCESS
;
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
)
{
if
(
argc
==
2
)
{
switch_mutex_lock
(
conference
->
mutex
);
if
(
conference
->
fnode
)
{
if
(
switch_test_flag
(
conference
->
fnode
,
NFLAG_PAUSE
))
{
stream
->
write_function
(
stream
,
"+OK Resume
\n
"
);
switch_clear_flag
(
conference
->
fnode
,
NFLAG_PAUSE
);
}
else
{
stream
->
write_function
(
stream
,
"+OK Pause
\n
"
);
switch_set_flag
(
conference
->
fnode
,
NFLAG_PAUSE
);
}
}
switch_mutex_unlock
(
conference
->
mutex
);
return
SWITCH_STATUS_SUCCESS
;
}
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
)
{
if
(
argc
==
3
)
{
unsigned
int
samps
=
0
;
unsigned
int
pos
=
0
;
switch_mutex_lock
(
conference
->
mutex
);
if
(
conference
->
fnode
&&
conference
->
fnode
->
type
==
NODE_TYPE_FILE
)
{
if
(
*
argv
[
2
]
==
'+'
||
*
argv
[
2
]
==
'-'
)
{
int
step
;
int32_t
target
;
if
(
!
(
step
=
atoi
(
argv
[
2
])))
{
step
=
1000
;
}
samps
=
step
*
(
conference
->
rate
/
1000
);
target
=
(
int32_t
)
conference
->
fnode
->
fh
.
pos
+
samps
;
if
(
target
<
0
)
{
target
=
0
;
}
stream
->
write_function
(
stream
,
"+OK seek to position %d
\n
"
,
target
);
switch_core_file_seek
(
&
conference
->
fnode
->
fh
,
&
pos
,
target
,
SEEK_SET
);
}
else
{
samps
=
switch_atoui
(
argv
[
2
])
*
(
conference
->
rate
/
1000
);
stream
->
write_function
(
stream
,
"+OK seek to position %d
\n
"
,
samps
);
switch_core_file_seek
(
&
conference
->
fnode
->
fh
,
&
pos
,
samps
,
SEEK_SET
);
}
}
switch_mutex_unlock
(
conference
->
mutex
);
return
SWITCH_STATUS_SUCCESS
;
}
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
;
int
ret_status
=
SWITCH_STATUS_GENERR
;
...
@@ -6358,6 +6425,8 @@ static api_command_t conf_api_sub_commands[] = {
...
@@ -6358,6 +6425,8 @@ static api_command_t conf_api_sub_commands[] = {
{
"volume_in"
,
(
void_fn_t
)
&
conf_api_sub_volume_in
,
CONF_API_SUB_MEMBER_TARGET
,
"volume_in"
,
"<member_id|all|last|non_moderator> [<newval>]"
},
{
"volume_in"
,
(
void_fn_t
)
&
conf_api_sub_volume_in
,
CONF_API_SUB_MEMBER_TARGET
,
"volume_in"
,
"<member_id|all|last|non_moderator> [<newval>]"
},
{
"volume_out"
,
(
void_fn_t
)
&
conf_api_sub_volume_out
,
CONF_API_SUB_MEMBER_TARGET
,
"volume_out"
,
"<member_id|all|last|non_moderator> [<newval>]"
},
{
"volume_out"
,
(
void_fn_t
)
&
conf_api_sub_volume_out
,
CONF_API_SUB_MEMBER_TARGET
,
"volume_out"
,
"<member_id|all|last|non_moderator> [<newval>]"
},
{
"play"
,
(
void_fn_t
)
&
conf_api_sub_play
,
CONF_API_SUB_ARGS_SPLIT
,
"play"
,
"<file_path> [async|<member_id>]"
},
{
"play"
,
(
void_fn_t
)
&
conf_api_sub_play
,
CONF_API_SUB_ARGS_SPLIT
,
"play"
,
"<file_path> [async|<member_id>]"
},
{
"pause_play"
,
(
void_fn_t
)
&
conf_api_sub_pause_play
,
CONF_API_SUB_ARGS_SPLIT
,
"pause"
,
""
},
{
"file_seek"
,
(
void_fn_t
)
&
conf_api_sub_file_seek
,
CONF_API_SUB_ARGS_SPLIT
,
"file_seek"
,
"[+-]<val>"
},
{
"say"
,
(
void_fn_t
)
&
conf_api_sub_say
,
CONF_API_SUB_ARGS_AS_ONE
,
"say"
,
"<text>"
},
{
"say"
,
(
void_fn_t
)
&
conf_api_sub_say
,
CONF_API_SUB_ARGS_AS_ONE
,
"say"
,
"<text>"
},
{
"saymember"
,
(
void_fn_t
)
&
conf_api_sub_saymember
,
CONF_API_SUB_ARGS_AS_ONE
,
"saymember"
,
"<member_id> <text>"
},
{
"saymember"
,
(
void_fn_t
)
&
conf_api_sub_saymember
,
CONF_API_SUB_ARGS_AS_ONE
,
"saymember"
,
"<member_id> <text>"
},
{
"stop"
,
(
void_fn_t
)
&
conf_api_sub_stop
,
CONF_API_SUB_ARGS_SPLIT
,
"stop"
,
"<[current|all|async|last]> [<member_id>]"
},
{
"stop"
,
(
void_fn_t
)
&
conf_api_sub_stop
,
CONF_API_SUB_ARGS_SPLIT
,
"stop"
,
"<[current|all|async|last]> [<member_id>]"
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论