Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
1fba6548
提交
1fba6548
authored
7月 01, 2010
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix parse err in originate code
上级
7898679b
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
46 行增加
和
5 行删除
+46
-5
switch_utils.h
src/include/switch_utils.h
+41
-0
switch_event.c
src/switch_event.c
+2
-2
switch_ivr_originate.c
src/switch_ivr_originate.c
+3
-3
没有找到文件。
src/include/switch_utils.h
浏览文件 @
1fba6548
...
...
@@ -92,6 +92,47 @@ static inline switch_bool_t switch_is_moh(const char *s)
return
SWITCH_TRUE
;
}
/* find a character (find) in a string (in) and return a pointer to that point in the string where the character was found
using the array (allowed) as allowed non-matching characters, when (allowed) is NULL, behaviour should be identical to strchr()
*/
static
inline
char
*
switch_strchr_strict
(
const
char
*
in
,
char
find
,
const
char
*
allowed
)
{
const
char
*
p
;
switch_assert
(
in
);
p
=
in
;
while
(
p
&&
*
p
)
{
const
char
*
a
=
allowed
;
int
found
=
0
;
if
(
!
a
)
{
found
=
1
;
}
else
{
while
(
a
&&
*
a
)
{
if
(
*
p
==
*
a
)
{
found
=
1
;
break
;
}
a
++
;
}
}
if
(
!
found
)
return
NULL
;
if
(
*
p
==
find
)
break
;
p
++
;
}
return
(
char
*
)
p
;
}
#define switch_arraylen(_a) (sizeof(_a) / sizeof(_a[0]))
#define switch_split(_data, _delim, _array) switch_separate_string(_data, _delim, _array, switch_arraylen(_array))
...
...
src/switch_event.c
浏览文件 @
1fba6548
...
...
@@ -1064,7 +1064,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_brackets(char *data, char a,
check_a
=
end
;
while
(
check_a
&&
(
check_b
=
s
trchr
(
check_a
,
a
)))
{
while
(
check_a
&&
(
check_b
=
s
witch_strchr_strict
(
check_a
,
a
,
" "
)))
{
if
((
check_b
=
switch_find_end_paren
(
check_b
,
a
,
b
)))
{
check_a
=
check_b
;
}
...
...
@@ -1090,7 +1090,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_brackets(char *data, char a,
char
*
pnext
;
*
next
++
=
'\0'
;
if
((
pnext
=
s
trchr
(
next
,
a
)))
{
if
((
pnext
=
s
witch_strchr_strict
(
next
,
a
,
" "
)))
{
next
=
pnext
+
1
;
}
}
...
...
src/switch_ivr_originate.c
浏览文件 @
1fba6548
...
...
@@ -2313,7 +2313,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
}
if
(
p
==
end
)
{
end
=
s
trchr
(
p
,
'['
);
end
=
s
witch_strchr_strict
(
p
,
'['
,
" "
);
}
p
++
;
...
...
@@ -2537,7 +2537,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
current_variable
=
NULL
;
switch_event_add_header_string
(
var_event
,
SWITCH_STACK_BOTTOM
,
"originate_early_media"
,
oglobals
.
early_ok
?
"true"
:
"false"
);
printf
(
"ASS %s
\n
"
,
vdata
);
if
(
vdata
)
{
char
*
var_array
[
1024
]
=
{
0
};
int
var_count
=
0
;
...
...
@@ -2552,7 +2552,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
char
*
pnext
;
*
next
++
=
'\0'
;
if
((
pnext
=
s
trchr
(
next
,
'['
)))
{
if
((
pnext
=
s
witch_strchr_strict
(
next
,
'['
,
" "
)))
{
next
=
pnext
+
1
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论