Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
e5b891ee
提交
e5b891ee
authored
11月 03, 2010
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add separate reg timeout from retry sec
上级
fc4d290c
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
17 行增加
和
3 行删除
+17
-3
mod_sofia.h
src/mod/endpoints/mod_sofia/mod_sofia.h
+2
-0
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+13
-1
sofia_reg.c
src/mod/endpoints/mod_sofia/sofia_reg.c
+2
-2
没有找到文件。
src/mod/endpoints/mod_sofia/mod_sofia.h
浏览文件 @
e5b891ee
...
...
@@ -414,6 +414,7 @@ struct sofia_gateway {
time_t
expires
;
time_t
retry
;
time_t
ping
;
time_t
reg_timeout
;
int
pinging
;
sofia_gateway_status_t
status
;
uint32_t
ping_freq
;
...
...
@@ -422,6 +423,7 @@ struct sofia_gateway {
int
ping_min
;
uint8_t
flags
[
REG_FLAG_MAX
];
int32_t
retry_seconds
;
int32_t
reg_timeout_seconds
;
int32_t
failure_status
;
reg_state_t
state
;
switch_memory_pool_t
*
pool
;
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
e5b891ee
...
...
@@ -1874,6 +1874,7 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
*
context
=
profile
->
context
,
*
expire_seconds
=
"3600"
,
*
retry_seconds
=
"30"
,
*
timeout_seconds
=
"60"
,
*
from_user
=
""
,
*
from_domain
=
NULL
,
*
outbound_proxy
=
NULL
,
*
register_proxy
=
NULL
,
*
contact_host
=
NULL
,
*
contact_params
=
NULL
,
*
params
=
NULL
,
*
register_transport
=
NULL
;
...
...
@@ -1982,6 +1983,8 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
expire_seconds
=
val
;
}
else
if
(
!
strcmp
(
var
,
"retry-seconds"
))
{
retry_seconds
=
val
;
}
else
if
(
!
strcmp
(
var
,
"timeout-seconds"
))
{
timeout_seconds
=
val
;
}
else
if
(
!
strcmp
(
var
,
"retry_seconds"
))
{
// support typo for back compat
retry_seconds
=
val
;
}
else
if
(
!
strcmp
(
var
,
"from-user"
))
{
...
...
@@ -2081,13 +2084,22 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
}
gateway
->
retry_seconds
=
atoi
(
retry_seconds
);
if
(
gateway
->
retry_seconds
<
5
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"Invalid retry-seconds of %d on gateway %s, using the value of 30 instead.
\n
"
,
gateway
->
retry_seconds
,
name
);
gateway
->
retry_seconds
=
30
;
}
gateway
->
reg_timeout_seconds
=
atoi
(
timeout_seconds
);
if
(
gateway
->
retry_seconds
<
5
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"Invalid timeout-seconds of %d on gateway %s, using the value of 60 instead.
\n
"
,
gateway
->
reg_timeout_seconds
,
name
);
gateway
->
reg_timeout_seconds
=
30
;
}
gateway
->
register_scheme
=
switch_core_strdup
(
gateway
->
pool
,
scheme
);
gateway
->
register_context
=
switch_core_strdup
(
gateway
->
pool
,
context
);
gateway
->
register_realm
=
switch_core_strdup
(
gateway
->
pool
,
realm
);
...
...
src/mod/endpoints/mod_sofia/sofia_reg.c
浏览文件 @
e5b891ee
...
...
@@ -363,7 +363,7 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now)
NUTAG_REGISTRAR
(
gateway_ptr
->
register_proxy
),
NUTAG_OUTBOUND
(
"no-options-keepalive"
),
NUTAG_OUTBOUND
(
"no-validate"
),
NUTAG_KEEPALIVE
(
0
),
TAG_NULL
());
}
gateway_ptr
->
re
try
=
now
+
gateway_ptr
->
retry
_seconds
;
gateway_ptr
->
re
g_timeout
=
now
+
gateway_ptr
->
reg_timeout
_seconds
;
gateway_ptr
->
state
=
REG_STATE_TRYING
;
switch_safe_free
(
user_via
);
user_via
=
NULL
;
...
...
@@ -408,7 +408,7 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now)
}
break
;
case
REG_STATE_TRYING
:
if
(
!
gateway_ptr
->
retry
||
now
>=
gateway_ptr
->
retry
)
{
if
(
now
>=
gateway_ptr
->
reg_timeout
)
{
gateway_ptr
->
state
=
REG_STATE_TIMEOUT
;
}
break
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论