Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
dd8784a9
提交
dd8784a9
authored
1月 21, 2013
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add terminators to dmachine and a way to use them in dp_tools and httapi
上级
75dfa651
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
49 行增加
和
2 行删除
+49
-2
switch_core.h
src/include/switch_core.h
+1
-1
mod_dptools.c
src/mod/applications/mod_dptools/mod_dptools.c
+5
-0
mod_httapi.c
src/mod/applications/mod_httapi/mod_httapi.c
+10
-0
switch_ivr_async.c
src/switch_ivr_async.c
+33
-1
没有找到文件。
src/include/switch_core.h
浏览文件 @
dd8784a9
...
...
@@ -756,7 +756,7 @@ SWITCH_DECLARE(void) switch_core_session_set_dmachine(switch_core_session_t *ses
SWITCH_DECLARE
(
switch_ivr_dmachine_t
*
)
switch_core_session_get_dmachine
(
switch_core_session_t
*
session
,
switch_digit_action_target_t
target
);
SWITCH_DECLARE
(
switch_digit_action_target_t
)
switch_ivr_dmachine_get_target
(
switch_ivr_dmachine_t
*
dmachine
);
SWITCH_DECLARE
(
void
)
switch_ivr_dmachine_set_target
(
switch_ivr_dmachine_t
*
dmachine
,
switch_digit_action_target_t
target
);
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_dmachine_set_terminators
(
switch_ivr_dmachine_t
*
dmachine
,
const
char
*
terminators
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_set_codec_slin
(
switch_core_session_t
*
session
,
switch_slin_data_t
*
data
);
/*!
...
...
src/mod/applications/mod_dptools/mod_dptools.c
浏览文件 @
dd8784a9
...
...
@@ -336,6 +336,7 @@ static void bind_to_session(switch_core_session_t *session,
struct
action_binding
*
act
;
switch_ivr_dmachine_t
*
dmachine
;
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
const
char
*
terminators
=
NULL
;
if
(
!
(
dmachine
=
switch_core_session_get_dmachine
(
session
,
target
)))
{
uint32_t
digit_timeout
=
1500
;
...
...
@@ -363,6 +364,10 @@ static void bind_to_session(switch_core_session_t *session,
act
->
target
=
bind_target
;
act
->
session
=
session
;
switch_ivr_dmachine_bind
(
dmachine
,
act
->
realm
,
act
->
input
,
0
,
digit_action_callback
,
act
);
if
((
terminators
=
switch_channel_get_variable
(
channel
,
"bda_terminators"
)))
{
switch_ivr_dmachine_set_terminators
(
dmachine
,
terminators
);
}
}
#define BIND_DIGIT_ACTION_USAGE "<realm>,<digits|~regex>,<string>[,<value>][,<dtmf target leg>][,<event target leg>]"
...
...
src/mod/applications/mod_httapi/mod_httapi.c
浏览文件 @
dd8784a9
...
...
@@ -374,6 +374,7 @@ static switch_status_t parse_playback(const char *tag_name, client_t *client, sw
const
char
*
action
=
switch_xml_attr
(
tag
,
"action"
);
const
char
*
digit_timeout_
=
switch_xml_attr
(
tag
,
"digit-timeout"
);
const
char
*
input_timeout_
=
switch_xml_attr
(
tag
,
"input-timeout"
);
const
char
*
terminators
=
switch_xml_attr
(
tag
,
"terminators"
);
const
char
*
tts_engine
=
NULL
;
const
char
*
tts_voice
=
NULL
;
char
*
loops_
=
(
char
*
)
switch_xml_attr
(
tag
,
"loops"
);
...
...
@@ -559,6 +560,10 @@ static switch_status_t parse_playback(const char *tag_name, client_t *client, sw
}
switch_ivr_dmachine_set_realm
(
dmachine
,
realm
);
if
(
!
zstr
(
terminators
))
{
switch_ivr_dmachine_set_terminators
(
dmachine
,
terminators
);
}
myargs
.
dmachine
=
dmachine
;
args
=
&
myargs
;
}
...
...
@@ -915,6 +920,7 @@ static switch_status_t parse_record(const char *tag_name, client_t *client, swit
const
char
*
action
=
switch_xml_attr
(
tag
,
"action"
);
const
char
*
sub_action
=
NULL
;
const
char
*
digit_timeout_
=
switch_xml_attr
(
tag
,
"digit-timeout"
);
const
char
*
terminators
=
switch_xml_attr
(
tag
,
"terminators"
);
char
*
loops_
=
(
char
*
)
switch_xml_attr
(
tag
,
"loops"
);
int
loops
=
0
;
switch_status_t
status
=
SWITCH_STATUS_SUCCESS
;
...
...
@@ -1032,6 +1038,10 @@ static switch_status_t parse_record(const char *tag_name, client_t *client, swit
}
switch_ivr_dmachine_set_realm
(
dmachine
,
realm
);
if
(
!
zstr
(
terminators
))
{
switch_ivr_dmachine_set_terminators
(
dmachine
,
terminators
);
}
myargs
.
dmachine
=
dmachine
;
args
=
&
myargs
;
}
...
...
src/switch_ivr_async.c
浏览文件 @
dd8784a9
...
...
@@ -51,6 +51,8 @@ typedef struct switch_ivr_dmachine_binding switch_ivr_dmachine_binding_t;
typedef
struct
{
switch_ivr_dmachine_binding_t
*
binding_list
;
switch_ivr_dmachine_binding_t
*
tail
;
char
*
name
;
char
*
terminators
;
}
dm_binding_head_t
;
struct
switch_ivr_dmachine
{
...
...
@@ -187,6 +189,21 @@ SWITCH_DECLARE(void) switch_ivr_dmachine_destroy(switch_ivr_dmachine_t **dmachin
}
}
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_dmachine_set_terminators
(
switch_ivr_dmachine_t
*
dmachine
,
const
char
*
terminators
)
{
if
(
!
dmachine
->
realm
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"No realm selected.
\n
"
);
return
SWITCH_STATUS_FALSE
;
}
dmachine
->
realm
->
terminators
=
switch_core_strdup
(
dmachine
->
pool
,
terminators
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Digit parser %s: Setting terminators for realm '%s' to '%s'
\n
"
,
dmachine
->
name
,
dmachine
->
realm
->
name
,
terminators
);
return
SWITCH_STATUS_SUCCESS
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_dmachine_set_realm
(
switch_ivr_dmachine_t
*
dmachine
,
const
char
*
realm
)
{
dm_binding_head_t
*
headp
=
switch_core_hash_find
(
dmachine
->
binding_hash
,
realm
);
...
...
@@ -198,7 +215,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_set_realm(switch_ivr_dmachin
}
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Digit parser %s: Error Setting realm to '%s'
\n
"
,
dmachine
->
name
,
realm
);
return
SWITCH_STATUS_FALSE
;
}
...
...
@@ -248,6 +265,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_bind(switch_ivr_dmachine_t *
if
(
!
(
headp
=
switch_core_hash_find
(
dmachine
->
binding_hash
,
realm
)))
{
headp
=
switch_core_alloc
(
dmachine
->
pool
,
sizeof
(
*
headp
));
headp
->
name
=
switch_core_strdup
(
dmachine
->
pool
,
realm
);
switch_core_hash_insert
(
dmachine
->
binding_hash
,
realm
,
headp
);
}
...
...
@@ -345,6 +363,20 @@ static dm_match_t switch_ivr_dmachine_check_match(switch_ivr_dmachine_t *dmachin
}
}
if
(
!
zstr
(
dmachine
->
realm
->
terminators
))
{
char
*
p
=
dmachine
->
realm
->
terminators
;
char
*
q
;
while
(
p
&&
*
p
)
{
if
((
q
=
strrchr
(
dmachine
->
digits
,
*
p
)))
{
*
q
=
'\0'
;
is_timeout
=
1
;
break
;
}
p
++
;
}
}
for
(
bp
=
dmachine
->
realm
->
binding_list
;
bp
;
bp
=
bp
->
next
)
{
if
(
bp
->
is_regex
)
{
if
(
bp
->
rmatch
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论