Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
3b50675d
提交
3b50675d
authored
3月 27, 2013
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-5231 --resolve
上级
f7408f88
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
34 行增加
和
1 行删除
+34
-1
switch_ivr.h
src/include/switch_ivr.h
+9
-0
mod_commands.c
src/mod/applications/mod_commands/mod_commands.c
+3
-1
switch_ivr.c
src/switch_ivr.c
+22
-0
没有找到文件。
src/include/switch_ivr.h
浏览文件 @
3b50675d
...
...
@@ -591,6 +591,15 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_nomedia(const char *uuid, switch_medi
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_hold_uuid
(
const
char
*
uuid
,
const
char
*
message
,
switch_bool_t
moh
);
/*!
\brief Toggles channel hold state of session
\param uuid the uuid of the session to hold
\param message optional message
\param moh play music-on-hold
\return SWITCH_STATUS_SUCCESS if all is well
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_hold_toggle_uuid
(
const
char
*
uuid
,
const
char
*
message
,
switch_bool_t
moh
);
/*!
\brief Signal the session with a protocol specific unhold message.
\param uuid the uuid of the session to hold
...
...
src/mod/applications/mod_commands/mod_commands.c
浏览文件 @
3b50675d
...
...
@@ -3184,7 +3184,7 @@ SWITCH_STANDARD_API(sched_broadcast_function)
return
SWITCH_STATUS_SUCCESS
;
}
#define HOLD_SYNTAX "[off] <uuid> [<display>]"
#define HOLD_SYNTAX "[off
|toggle
] <uuid> [<display>]"
SWITCH_STANDARD_API
(
uuid_hold_function
)
{
char
*
mycmd
=
NULL
,
*
argv
[
4
]
=
{
0
};
...
...
@@ -3200,6 +3200,8 @@ SWITCH_STANDARD_API(uuid_hold_function)
}
else
{
if
(
!
strcasecmp
(
argv
[
0
],
"off"
))
{
status
=
switch_ivr_unhold_uuid
(
argv
[
1
]);
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"toggle"
))
{
status
=
switch_ivr_hold_toggle_uuid
(
argv
[
1
],
argv
[
2
],
1
);
}
else
{
status
=
switch_ivr_hold_uuid
(
argv
[
0
],
argv
[
1
],
1
);
}
...
...
src/switch_ivr.c
浏览文件 @
3b50675d
...
...
@@ -1445,6 +1445,28 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_hold_uuid(const char *uuid, const cha
return
SWITCH_STATUS_SUCCESS
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_hold_toggle_uuid
(
const
char
*
uuid
,
const
char
*
message
,
switch_bool_t
moh
)
{
switch_core_session_t
*
session
;
switch_channel_t
*
channel
;
switch_channel_callstate_t
callstate
;
if
((
session
=
switch_core_session_locate
(
uuid
)))
{
if
((
channel
=
switch_core_session_get_channel
(
session
)))
{
callstate
=
switch_channel_get_callstate
(
channel
);
if
(
callstate
==
CCS_ACTIVE
)
{
switch_ivr_hold
(
session
,
message
,
moh
);
}
else
if
(
callstate
==
CCS_HELD
)
{
switch_ivr_unhold
(
session
);
}
}
switch_core_session_rwunlock
(
session
);
}
return
SWITCH_STATUS_SUCCESS
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_unhold
(
switch_core_session_t
*
session
)
{
switch_core_session_message_t
msg
=
{
0
};
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论