Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
001a57b1
提交
001a57b1
authored
12月 19, 2012
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix double dmachine binding of the same thing resulting in unmapping
上级
2df9d2e4
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
22 行增加
和
7 行删除
+22
-7
switch_ivr_async.c
src/switch_ivr_async.c
+22
-7
没有找到文件。
src/switch_ivr_async.c
浏览文件 @
001a57b1
...
...
@@ -232,9 +232,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_bind(switch_ivr_dmachine_t *
switch_ivr_dmachine_callback_t
callback
,
void
*
user_data
)
{
switch_ivr_dmachine_binding_t
*
binding
;
switch_ivr_dmachine_binding_t
*
binding
=
NULL
,
*
ptr
;
switch_size_t
len
;
dm_binding_head_t
*
headp
;
const
char
*
msg
=
""
;
if
(
strlen
(
digits
)
>
DMACHINE_MAX_DIGIT_LEN
-
1
)
{
return
SWITCH_STATUS_FALSE
;
...
...
@@ -249,6 +250,17 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_bind(switch_ivr_dmachine_t *
switch_core_hash_insert
(
dmachine
->
binding_hash
,
realm
,
headp
);
}
for
(
ptr
=
headp
->
binding_list
;
ptr
;
ptr
=
ptr
->
next
)
{
if
((
ptr
->
is_regex
&&
!
strcmp
(
ptr
->
digits
,
digits
+
1
))
||
!
strcmp
(
ptr
->
digits
,
digits
))
{
msg
=
"Reuse Existing "
;
binding
=
ptr
;
binding
->
callback
=
callback
;
binding
->
user_data
=
user_data
;
goto
done
;
}
}
binding
=
switch_core_alloc
(
dmachine
->
pool
,
sizeof
(
*
binding
));
if
(
*
digits
==
'~'
)
{
...
...
@@ -281,12 +293,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_bind(switch_ivr_dmachine_t *
dmachine
->
max_digit_len
=
(
uint32_t
)
len
;
}
done
:
if
(
binding
->
is_regex
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Digit parser %s: binding %s/%s/%d callback: %p data: %p
\n
"
,
dmachine
->
name
,
digits
,
realm
,
key
,
(
void
*
)(
intptr_t
)
callback
,
user_data
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"
%s
Digit parser %s: binding %s/%s/%d callback: %p data: %p
\n
"
,
msg
,
dmachine
->
name
,
digits
,
realm
,
key
,
(
void
*
)(
intptr_t
)
callback
,
user_data
);
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Digit parser %s: binding %s/%s/%d callback: %p data: %p
\n
"
,
dmachine
->
name
,
digits
,
realm
,
key
,
(
void
*
)(
intptr_t
)
callback
,
user_data
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"
%s
Digit parser %s: binding %s/%s/%d callback: %p data: %p
\n
"
,
msg
,
dmachine
->
name
,
digits
,
realm
,
key
,
(
void
*
)(
intptr_t
)
callback
,
user_data
);
}
return
SWITCH_STATUS_SUCCESS
;
...
...
@@ -305,7 +319,7 @@ static dm_match_t switch_ivr_dmachine_check_match(switch_ivr_dmachine_t *dmachin
{
dm_match_t
best
=
DM_MATCH_NONE
;
switch_ivr_dmachine_binding_t
*
bp
,
*
exact_bp
=
NULL
,
*
partial_bp
=
NULL
,
*
both_bp
=
NULL
,
*
r_bp
=
NULL
;
int
pmatches
=
0
;
int
pmatches
=
0
,
ematches
=
0
;
if
(
!
dmachine
->
cur_digit_len
||
!
dmachine
->
realm
)
goto
end
;
...
...
@@ -315,6 +329,7 @@ static dm_match_t switch_ivr_dmachine_check_match(switch_ivr_dmachine_t *dmachin
}
else
{
if
(
!
strncmp
(
dmachine
->
digits
,
bp
->
digits
,
strlen
(
dmachine
->
digits
)))
{
pmatches
++
;
ematches
=
1
;
}
}
}
...
...
@@ -334,7 +349,7 @@ static dm_match_t switch_ivr_dmachine_check_match(switch_ivr_dmachine_t *dmachin
}
else
{
int
pmatch
=
!
strncmp
(
dmachine
->
digits
,
bp
->
digits
,
strlen
(
dmachine
->
digits
));
if
(
!
exact_bp
&&
pmatch
&&
(
pmatches
==
1
||
is_timeout
)
&&
!
strcmp
(
bp
->
digits
,
dmachine
->
digits
))
{
if
(
!
exact_bp
&&
pmatch
&&
(
pmatches
==
1
||
ematches
==
1
||
is_timeout
)
&&
!
strcmp
(
bp
->
digits
,
dmachine
->
digits
))
{
best
=
DM_MATCH_EXACT
;
exact_bp
=
bp
;
if
(
dmachine
->
cur_digit_len
==
dmachine
->
max_digit_len
)
break
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论