Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
78c2ed05
提交
78c2ed05
authored
6月 08, 2016
作者:
François
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-9241 Use tls_public_url instead of tls_url in INVITE Contact when NAT is detected
上级
7f623fc0
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
31 行增加
和
17 行删除
+31
-17
mod_sofia.h
src/mod/endpoints/mod_sofia/mod_sofia.h
+1
-0
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+2
-8
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+28
-9
没有找到文件。
src/mod/endpoints/mod_sofia/mod_sofia.h
浏览文件 @
78c2ed05
...
...
@@ -1028,6 +1028,7 @@ void sofia_presence_set_chat_hash(private_object_t *tech_pvt, sip_t const *sip);
switch_status_t
sofia_on_hangup
(
switch_core_session_t
*
session
);
char
*
sofia_glue_get_url_from_contact
(
char
*
buf
,
uint8_t
to_dup
);
char
*
sofia_glue_get_path_from_contact
(
char
*
buf
);
char
*
sofia_glue_get_profile_url
(
sofia_profile_t
*
profile
,
char
*
remote_ip
,
const
sofia_transport_t
transport
);
void
sofia_presence_set_hash_key
(
char
*
hash_key
,
int32_t
len
,
sip_t
const
*
sip
);
void
sofia_glue_sql_close
(
sofia_profile_t
*
profile
,
time_t
prune
);
int
sofia_glue_init_sql
(
sofia_profile_t
*
profile
);
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
78c2ed05
...
...
@@ -10046,11 +10046,9 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
user
,
ipv6
?
"["
:
""
,
host
,
ipv6
?
"]"
:
""
,
port
,
sofia_glue_transport2str
(
transport
));
if
(
sofia_glue_check_nat
(
profile
,
tech_pvt
->
mparams
.
remote_ip
))
{
url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_public_url : profile->public_url;
check_nat
=
1
;
} else {
url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_url : profile->url;
}
url
=
sofia_glue_get_profile_url
(
profile
,
tech_pvt
->
mparams
.
remote_ip
,
transport
);
if
(
!
url
)
{
if
(
check_nat
)
{
...
...
@@ -10085,11 +10083,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
}
else
{
const
char
*
url
=
NULL
;
if (sofia_glue_check_nat(profile, tech_pvt->mparams.remote_ip)) {
url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_public_url : profile->public_url;
} else {
url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_url : profile->url;
}
url
=
sofia_glue_get_profile_url
(
profile
,
tech_pvt
->
mparams
.
remote_ip
,
transport
);
if
(
url
)
{
const
char
*
brackets
=
NULL
;
...
...
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
78c2ed05
...
...
@@ -931,15 +931,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
ipv6
?
"["
:
""
,
ip_addr
,
ipv6
?
"]"
:
""
,
tech_pvt
->
profile
->
extsipport
);
}
}
else
{
if
(
sofia_glue_transport_has_tls
(
tech_pvt
->
transport
))
{
tech_pvt
->
invite_contact
=
tech_pvt
->
profile
->
tls_url
;
}
else
{
if
(
!
zstr
(
tech_pvt
->
mparams
.
remote_ip
)
&&
sofia_glue_check_nat
(
tech_pvt
->
profile
,
tech_pvt
->
mparams
.
remote_ip
))
{
tech_pvt
->
invite_contact
=
tech_pvt
->
profile
->
public_url
;
}
else
{
tech_pvt
->
invite_contact
=
tech_pvt
->
profile
->
url
;
}
}
sofia_glue_get_profile_url
(
tech_pvt
->
profile
,
tech_pvt
->
mparams
.
remote_ip
,
tech_pvt
->
transport
);
}
}
...
...
@@ -3105,6 +3097,33 @@ void sofia_glue_clear_soa(switch_core_session_t *session, switch_bool_t partner)
}
char
*
sofia_glue_get_profile_url
(
sofia_profile_t
*
profile
,
char
*
remote_ip
,
const
sofia_transport_t
transport
)
{
char
*
url
=
NULL
;
int
check_nat
=
0
;
if
(
!
zstr
(
remote_ip
)
&&
sofia_glue_check_nat
(
profile
,
remote_ip
))
{
check_nat
=
1
;
}
if
(
sofia_glue_transport_has_tls
(
transport
))
{
if
(
check_nat
&&
profile
->
tls_public_url
)
{
url
=
profile
->
tls_public_url
;
}
else
{
url
=
profile
->
tls_url
;
}
}
else
{
if
(
check_nat
&&
profile
->
public_url
)
{
url
=
profile
->
public_url
;
}
else
{
url
=
profile
->
url
;
}
}
if
(
!
url
)
url
=
profile
->
url
;
return
url
;
}
/* For Emacs:
* Local Variables:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论