Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
d9eb0197
提交
d9eb0197
authored
6月 08, 2010
作者:
Michael Jerris
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add block_dtmf and unblock_dtmf apps
上级
abb7d2e5
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
54 行增加
和
0 行删除
+54
-0
switch_ivr.h
src/include/switch_ivr.h
+3
-0
mod_dptools.c
src/mod/applications/mod_dptools/mod_dptools.c
+12
-0
switch_ivr_async.c
src/switch_ivr_async.c
+39
-0
没有找到文件。
src/include/switch_ivr.h
浏览文件 @
d9eb0197
...
@@ -806,6 +806,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_read(switch_core_session_t *session,
...
@@ -806,6 +806,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_read(switch_core_session_t *session,
const
char
*
var_name
,
const
char
*
var_name
,
char
*
digit_buffer
,
switch_size_t
digit_buffer_length
,
uint32_t
timeout
,
const
char
*
valid_terminators
);
char
*
digit_buffer
,
switch_size_t
digit_buffer_length
,
uint32_t
timeout
,
const
char
*
valid_terminators
);
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_block_dtmf_session
(
switch_core_session_t
*
session
);
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_unblock_dtmf_session
(
switch_core_session_t
*
session
);
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_bind_dtmf_meta_session
(
switch_core_session_t
*
session
,
uint32_t
key
,
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_bind_dtmf_meta_session
(
switch_core_session_t
*
session
,
uint32_t
key
,
switch_bind_flag_t
bind_flags
,
const
char
*
app
);
switch_bind_flag_t
bind_flags
,
const
char
*
app
);
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_unbind_dtmf_meta_session
(
switch_core_session_t
*
session
,
uint32_t
key
);
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_unbind_dtmf_meta_session
(
switch_core_session_t
*
session
,
uint32_t
key
);
...
...
src/mod/applications/mod_dptools/mod_dptools.c
浏览文件 @
d9eb0197
...
@@ -198,6 +198,16 @@ SWITCH_STANDARD_APP(soft_hold_function)
...
@@ -198,6 +198,16 @@ SWITCH_STANDARD_APP(soft_hold_function)
}
}
}
}
SWITCH_STANDARD_APP
(
dtmf_unblock_function
)
{
switch_ivr_unblock_dtmf_session
(
session
);
}
SWITCH_STANDARD_APP
(
dtmf_block_function
)
{
switch_ivr_block_dtmf_session
(
session
);
}
#define UNBIND_SYNTAX "[<key>]"
#define UNBIND_SYNTAX "[<key>]"
SWITCH_STANDARD_APP
(
dtmf_unbind_function
)
SWITCH_STANDARD_APP
(
dtmf_unbind_function
)
{
{
...
@@ -3108,6 +3118,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
...
@@ -3108,6 +3118,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
SAF_SUPPORT_NOMEDIA
);
SAF_SUPPORT_NOMEDIA
);
SWITCH_ADD_APP
(
app_interface
,
"unbind_meta_app"
,
"Unbind a key from an application"
,
"Unbind a key from an application"
,
dtmf_unbind_function
,
SWITCH_ADD_APP
(
app_interface
,
"unbind_meta_app"
,
"Unbind a key from an application"
,
"Unbind a key from an application"
,
dtmf_unbind_function
,
UNBIND_SYNTAX
,
SAF_SUPPORT_NOMEDIA
);
UNBIND_SYNTAX
,
SAF_SUPPORT_NOMEDIA
);
SWITCH_ADD_APP
(
app_interface
,
"block_dfmf"
,
"Block DTMF"
,
"Block DTMF"
,
dtmf_block_function
,
""
,
SAF_SUPPORT_NOMEDIA
);
SWITCH_ADD_APP
(
app_interface
,
"unblock_dtmf"
,
"Stop blocking DTMF"
,
"Stop blocking DTMF"
,
dtmf_unblock_function
,
""
,
SAF_SUPPORT_NOMEDIA
);
SWITCH_ADD_APP
(
app_interface
,
"intercept"
,
"intercept"
,
"intercept"
,
intercept_function
,
INTERCEPT_SYNTAX
,
SAF_NONE
);
SWITCH_ADD_APP
(
app_interface
,
"intercept"
,
"intercept"
,
"intercept"
,
intercept_function
,
INTERCEPT_SYNTAX
,
SAF_NONE
);
SWITCH_ADD_APP
(
app_interface
,
"eavesdrop"
,
"eavesdrop on a uuid"
,
"eavesdrop on a uuid"
,
eavesdrop_function
,
eavesdrop_SYNTAX
,
SAF_MEDIA_TAP
);
SWITCH_ADD_APP
(
app_interface
,
"eavesdrop"
,
"eavesdrop on a uuid"
,
"eavesdrop on a uuid"
,
eavesdrop_function
,
eavesdrop_SYNTAX
,
SAF_MEDIA_TAP
);
SWITCH_ADD_APP
(
app_interface
,
"three_way"
,
"three way call with a uuid"
,
"three way call with a uuid"
,
three_way_function
,
threeway_SYNTAX
,
SWITCH_ADD_APP
(
app_interface
,
"three_way"
,
"three way call with a uuid"
,
"three way call with a uuid"
,
three_way_function
,
threeway_SYNTAX
,
...
...
src/switch_ivr_async.c
浏览文件 @
d9eb0197
...
@@ -2180,6 +2180,7 @@ typedef struct {
...
@@ -2180,6 +2180,7 @@ typedef struct {
}
dtmf_meta_data_t
;
}
dtmf_meta_data_t
;
#define SWITCH_META_VAR_KEY "__dtmf_meta"
#define SWITCH_META_VAR_KEY "__dtmf_meta"
#define SWITCH_BLOCK_DTMF_KEY "__dtmf_block"
typedef
struct
{
typedef
struct
{
switch_core_session_t
*
session
;
switch_core_session_t
*
session
;
...
@@ -2355,6 +2356,44 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_unbind_dtmf_meta_session(switch_core_
...
@@ -2355,6 +2356,44 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_unbind_dtmf_meta_session(switch_core_
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
block_on_dtmf
(
switch_core_session_t
*
session
,
const
switch_dtmf_t
*
dtmf
,
switch_dtmf_direction_t
direction
)
{
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
uint8_t
enabled
=
(
intptr_t
)
switch_channel_get_private
(
channel
,
SWITCH_BLOCK_DTMF_KEY
);
if
(
!
enabled
||
switch_channel_test_flag
(
channel
,
CF_INNER_BRIDGE
))
{
return
SWITCH_STATUS_SUCCESS
;
}
return
SWITCH_STATUS_FALSE
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_unblock_dtmf_session
(
switch_core_session_t
*
session
)
{
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
uint8_t
enabled
=
(
intptr_t
)
switch_channel_get_private
(
channel
,
SWITCH_BLOCK_DTMF_KEY
);
if
(
enabled
)
{
switch_channel_set_private
(
channel
,
SWITCH_BLOCK_DTMF_KEY
,
NULL
);
}
return
SWITCH_STATUS_SUCCESS
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_block_dtmf_session
(
switch_core_session_t
*
session
)
{
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
uint8_t
enabled
=
(
intptr_t
)
switch_channel_get_private
(
channel
,
SWITCH_BLOCK_DTMF_KEY
);
if
(
!
enabled
)
{
switch_channel_set_private
(
channel
,
SWITCH_BLOCK_DTMF_KEY
,
(
void
*
)(
intptr_t
)
1
);
switch_core_event_hook_add_send_dtmf
(
session
,
block_on_dtmf
);
switch_core_event_hook_add_recv_dtmf
(
session
,
block_on_dtmf
);
}
return
SWITCH_STATUS_SUCCESS
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_bind_dtmf_meta_session
(
switch_core_session_t
*
session
,
uint32_t
key
,
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_bind_dtmf_meta_session
(
switch_core_session_t
*
session
,
uint32_t
key
,
switch_bind_flag_t
bind_flags
,
const
char
*
app
)
switch_bind_flag_t
bind_flags
,
const
char
*
app
)
{
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论