Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
d140b11c
提交
d140b11c
authored
5月 27, 2010
作者:
Di-Shi Sun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Changed osp_route_N string variables.
上级
095815f8
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
24 行增加
和
9 行删除
+24
-9
mod_osp.c
src/mod/applications/mod_osp/mod_osp.c
+24
-9
没有找到文件。
src/mod/applications/mod_osp/mod_osp.c
浏览文件 @
d140b11c
...
...
@@ -42,7 +42,7 @@
/* OSP Buffer Size Constants */
#define OSP_SIZE_NORSTR 256
/* OSP normal string buffer size */
#define OSP_SIZE_KEYSTR 1024
/* OSP certificate string buffer size */
#define OSP_SIZE_ROUSTR
1024
/* OSP route buffer size */
#define OSP_SIZE_ROUSTR
2048
/* OSP route buffer size */
#define OSP_SIZE_TOKSTR 4096
/* OSP token string buffer size */
/* OSP Settings Constants */
...
...
@@ -1560,9 +1560,11 @@ static void osp_create_route(
{
osp_destination_t
*
dest
;
char
name
[
OSP_SIZE_NORSTR
];
char
value
[
OSP_SIZE_NORSTR
];
char
value
[
OSP_SIZE_ROUSTR
];
char
allparam
[
OSP_SIZE_NORSTR
];
char
eachparam
[
OSP_SIZE_NORSTR
];
char
endpoint
[
OSP_SIZE_NORSTR
];
char
tmp
[
OSP_SIZE_ROUSTR
];
char
buffer
[
OSP_SIZE_ROUSTR
];
int
i
,
len
,
count
,
size
=
sizeof
(
buffer
);
char
*
head
=
buffer
;
...
...
@@ -1581,6 +1583,7 @@ static void osp_create_route(
}
osp_build_allparam
(
results
,
head
,
size
);
switch_copy_string
(
allparam
,
head
,
sizeof
(
allparam
));
osp_adjust_len
(
head
,
size
,
len
);
for
(
count
=
0
,
i
=
0
;
i
<
results
->
numdest
;
i
++
)
{
...
...
@@ -1589,10 +1592,13 @@ static void osp_create_route(
count
++
;
osp_build_eachparam
(
i
+
1
,
dest
,
eachparam
,
sizeof
(
eachparam
));
osp_build_endpoint
(
dest
,
endpoint
,
sizeof
(
endpoint
));
switch_snprintf
(
name
,
sizeof
(
name
),
"%s%d"
,
OSP_VAR_ROUTEPRE
,
count
);
switch_snprintf
(
value
,
sizeof
(
value
),
"%s%s
"
,
eachparam
,
endpoint
);
switch_snprintf
(
value
,
sizeof
(
value
),
"%s%s
%s"
,
allparam
,
eachparam
,
endpoint
);
switch_channel_set_variable_var_check
(
channel
,
name
,
value
,
SWITCH_FALSE
);
switch_snprintf
(
head
,
size
,
"%s|"
,
value
);
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%s%s"
,
eachparam
,
endpoint
);
switch_snprintf
(
head
,
size
,
"%s|"
,
tmp
);
osp_adjust_len
(
head
,
size
,
len
);
}
}
...
...
@@ -1668,8 +1674,9 @@ static void osp_add_application(
char
allparam
[
OSP_SIZE_NORSTR
];
char
eachparam
[
OSP_SIZE_NORSTR
];
char
endpoint
[
OSP_SIZE_NORSTR
];
char
buffer
[
OSP_SIZE_ROUSTR
];
int
i
;
char
name
[
OSP_SIZE_NORSTR
];
char
value
[
OSP_SIZE_ROUSTR
];
int
i
,
count
;
if
((
*
extension
=
switch_caller_extension_new
(
session
,
results
->
called
,
results
->
called
))
==
0
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"Failed to create extension
\n
"
);
...
...
@@ -1680,15 +1687,23 @@ static void osp_add_application(
osp_build_allparam
(
results
,
allparam
,
sizeof
(
allparam
));
for
(
i
=
0
;
i
<
results
->
numdest
;
i
++
)
{
for
(
count
=
0
,
i
=
0
;
i
<
results
->
numdest
;
i
++
)
{
dest
=
&
results
->
dests
[
i
];
if
(
dest
->
supported
)
{
count
++
;
osp_build_eachparam
(
i
+
1
,
dest
,
eachparam
,
sizeof
(
eachparam
));
osp_build_endpoint
(
dest
,
endpoint
,
sizeof
(
endpoint
));
switch_snprintf
(
buffer
,
sizeof
(
buffer
),
"%s%s%s"
,
allparam
,
eachparam
,
endpoint
);
switch_caller_extension_add_application
(
session
,
*
extension
,
"bridge"
,
buffer
);
switch_snprintf
(
name
,
sizeof
(
name
),
"%s%d"
,
OSP_VAR_ROUTEPRE
,
count
);
switch_snprintf
(
value
,
sizeof
(
value
),
"%s%s%s"
,
allparam
,
eachparam
,
endpoint
);
switch_channel_set_variable_var_check
(
channel
,
name
,
value
,
SWITCH_FALSE
);
switch_caller_extension_add_application
(
session
,
*
extension
,
"bridge"
,
value
);
}
}
switch_snprintf
(
value
,
sizeof
(
value
),
"%d"
,
count
);
switch_channel_set_variable_var_check
(
channel
,
OSP_VAR_ROUTECOUNT
,
value
,
SWITCH_FALSE
);
}
/*
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论