Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
ca97a49e
提交
ca97a49e
authored
11月 30, 2011
作者:
Di-Shi Sun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed buffer overflow issue caused by max number of destinations.
上级
12f2bdf6
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
45 行增加
和
42 行删除
+45
-42
osp.conf.xml
conf/autoload_configs/osp.conf.xml
+1
-1
mod_osp.c
src/mod/applications/mod_osp/mod_osp.c
+44
-41
没有找到文件。
conf/autoload_configs/osp.conf.xml
浏览文件 @
ca97a49e
...
...
@@ -47,7 +47,7 @@
<!-- OSP service type, voice or npquery -->
<param
name=
"service-type"
value=
"voice"
/>
<!-- Max number of destinations -->
<param
name=
"max-destinations"
value=
"
5
"
/>
<param
name=
"max-destinations"
value=
"
12
"
/>
</profile>
</profiles>
</configuration>
src/mod/applications/mod_osp/mod_osp.c
浏览文件 @
ca97a49e
...
...
@@ -37,40 +37,40 @@
/* 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
2048
/* OSP route buffer size */
#define OSP_SIZE_ROUSTR
4096
/* OSP route buffer size */
#define OSP_SIZE_TOKSTR 4096
/* OSP token string buffer size */
/* OSP Settings Constants */
#define OSP_MAX_SP 8
/* Max number of OSP service points */
#define OSP_AUDIT_URL "localhost"
/* OSP default Audit URL */
#define OSP_LOCAL_VALID 1
/* OSP token validating method, locally */
#define OSP_DEF_LIFETIME 300
/* OSP default SSL lifetime */
#define OSP_
DEF_MAXCONN 20
/* OSP default
max connections */
#define OSP_M
IN_MAXCONN 1
/* OSP min
max connections */
#define OSP_
MAX_MAXCONN 1000
/* OSP max
max connections */
#define OSP_DEF_PERSIST 60
/* OSP default HTTP persistence in seconds */
#define OSP_
DEF_RETRYDELAY 0
/* OSP default retry delay in seconds
*/
#define OSP_M
IN_RETRYDELAY 0
/* OSP min
retry delay */
#define OSP_
MAX_RETRYDELAY 10
/* OSP max retry delay
*/
#define OSP_
DEF_RETRYLIMIT 2
/* OSP default
retry times */
#define OSP_M
IN_RETRYLIMIT 0
/* OSP min
retry times */
#define OSP_
MAX_RETRYLIMIT 100
/* OSP max
retry times */
#define OSP_
DEF_TIMEOUT 10000
/* OSP default
timeout in ms */
#define OSP_M
IN_TIMEOUT 200
/* OSP min
timeout in ms */
#define OSP_
MAX_TIMEOUT 60000
/* OSP max
timeout in ms */
#define OSP_CUSTOMER_ID ""
/* OSP customer ID */
#define OSP_DEVICE_ID ""
/* OSP device ID */
#define OSP_
DEF_MAXDEST 5
/* OSP default
max destinations */
#define OSP_M
IN_MAXDEST 1
/* OSP min
max destinations */
#define OSP_
MAX_MAXDEST 12
/* OSP max
max destinations */
#define OSP_DEF_PROFILE "default"
/* OSP default profile name */
#define OSP_DEF_STRING ""
/* OSP default empty string */
#define OSP_DEF_CALLID "UNDEFINED"
/* OSP default Call-ID */
#define OSP_DEF_STATS -1
/* OSP default statistics */
#define OSP_URI_DELIM '@'
/* URI delimit */
#define OSP_USER_DELIM ";:"
/* URI userinfo delimit */
#define OSP_HOST_DELIM ";>"
/* URI hostport delimit */
#define OSP_MAX_CINFO 8
/* Max number of custom info */
#define OSP_MAX_SP 8
/* Max number of OSP service points */
#define OSP_AUDIT_URL "localhost"
/* OSP default Audit URL */
#define OSP_LOCAL_VALID 1
/* OSP token validating method, locally */
#define OSP_DEF_LIFETIME 300
/* OSP default SSL lifetime */
#define OSP_
MIN_MAXCONN 1
/* OSP min
max connections */
#define OSP_M
AX_MAXCONN 1000
/* OSP max
max connections */
#define OSP_
DEF_MAXCONN 20
/* OSP default
max connections */
#define OSP_DEF_PERSIST 60
/* OSP default HTTP persistence in seconds */
#define OSP_
MIN_RETRYDELAY 0
/* OSP min retry delay
*/
#define OSP_M
AX_RETRYDELAY 10
/* OSP max
retry delay */
#define OSP_
DEF_RETRYDELAY OSP_MIN_RETRYDELAY
/* OSP default retry delay in seconds
*/
#define OSP_
MIN_RETRYLIMIT 0
/* OSP min
retry times */
#define OSP_M
AX_RETRYLIMIT 100
/* OSP max
retry times */
#define OSP_
DEF_RETRYLIMIT 2
/* OSP default
retry times */
#define OSP_
MIN_TIMEOUT 200
/* OSP min
timeout in ms */
#define OSP_M
AX_TIMEOUT 60000
/* OSP max
timeout in ms */
#define OSP_
DEF_TIMEOUT 10000
/* OSP default
timeout in ms */
#define OSP_CUSTOMER_ID ""
/* OSP customer ID */
#define OSP_DEVICE_ID ""
/* OSP device ID */
#define OSP_
MIN_MAXDEST 1
/* OSP min
max destinations */
#define OSP_M
AX_MAXDEST 12
/* OSP max
max destinations */
#define OSP_
DEF_MAXDEST OSP_MAX_MAXDEST
/* OSP default
max destinations */
#define OSP_DEF_PROFILE "default"
/* OSP default profile name */
#define OSP_DEF_STRING ""
/* OSP default empty string */
#define OSP_DEF_CALLID "UNDEFINED"
/* OSP default Call-ID */
#define OSP_DEF_STATS -1
/* OSP default statistics */
#define OSP_URI_DELIM '@'
/* URI delimit */
#define OSP_USER_DELIM ";:"
/* URI userinfo delimit */
#define OSP_HOST_DELIM ";>"
/* URI hostport delimit */
#define OSP_MAX_CINFO 8
/* Max number of custom info */
/* OSP Handle Constant */
#define OSP_INVALID_HANDLE -1
/* Invalid OSP handle, provider, transaction etc. */
...
...
@@ -207,16 +207,16 @@ typedef struct osp_destination {
}
osp_destination_t
;
typedef
struct
osp_results
{
const
char
*
profile
;
/* Profile name */
uint64_t
transid
;
/* Transaction ID */
switch_time_t
start
;
/* Call start time */
char
calling
[
OSP_SIZE_NORSTR
];
/* Original calling number */
char
called
[
OSP_SIZE_NORSTR
];
/* Original called number */
const
char
*
srcdev
;
/* Source device IP */
const
char
*
srcnid
;
/* Source network ID */
int
status
;
/* AuthReq status */
int
numdest
;
/* Number of destinations */
osp_destination_t
dests
[
OSP_MAX_
SP
];
/* Destinations */
const
char
*
profile
;
/* Profile name */
uint64_t
transid
;
/* Transaction ID */
switch_time_t
start
;
/* Call start time */
char
calling
[
OSP_SIZE_NORSTR
];
/* Original calling number */
char
called
[
OSP_SIZE_NORSTR
];
/* Original called number */
const
char
*
srcdev
;
/* Source device IP */
const
char
*
srcnid
;
/* Source network ID */
int
status
;
/* AuthReq status */
int
numdest
;
/* Number of destinations */
osp_destination_t
dests
[
OSP_MAX_
MAXDEST
];
/* Destinations */
}
osp_results_t
;
typedef
struct
osp_cookie
{
...
...
@@ -2286,11 +2286,14 @@ static switch_status_t osp_report_usage(
OSPPTransactionSetPackets
(
transaction
,
OSPC_SMETRIC_RTP
,
OSPC_SDIR_DESTREP
,
usage
->
rtpdestreppackets
);
}
/* TODO: The logic to identify the last call attempt needs improvement.
if ((cookie->destcount == cookie->desttotal) || (usage->cause == SWITCH_CAUSE_NORMAL_CLEARING)) {
OSPPTransactionSetRoleInfo(transaction, OSPC_RSTATE_STOP, OSPC_RFORMAT_OSP, OSPC_RVENDOR_FREESWITCH);
} else {
OSPPTransactionSetRoleInfo(transaction, OSPC_RSTATE_INTERIM, OSPC_RFORMAT_OSP, OSPC_RVENDOR_FREESWITCH);
}
*/
OSPPTransactionSetRoleInfo
(
transaction
,
OSPC_RSTATE_STOP
,
OSPC_RFORMAT_OSP
,
OSPC_RVENDOR_FREESWITCH
);
info
=
(
osp_threadarg_t
*
)
malloc
(
sizeof
(
osp_threadarg_t
));
info
->
transaction
=
transaction
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论