Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
3666029f
提交
3666029f
authored
5月 03, 2014
作者:
Russell Treleaven
提交者:
Michael Jerris
5月 16, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add auth-subscriptions flag. sofia ua can now optionally challenge subscrition requests
上级
9b1ebff8
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
42 行增加
和
0 行删除
+42
-0
sofia.conf.xml
src/mod/endpoints/mod_sofia/conf/sofia.conf.xml
+1
-0
mod_sofia.h
src/mod/endpoints/mod_sofia/mod_sofia.h
+1
-0
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+4
-0
sofia_presence.c
src/mod/endpoints/mod_sofia/sofia_presence.c
+36
-0
没有找到文件。
src/mod/endpoints/mod_sofia/conf/sofia.conf.xml
浏览文件 @
3666029f
...
...
@@ -315,6 +315,7 @@
<!-- <param name="NDLB-received-in-nat-reg-contact" value="true"/> -->
<param
name=
"auth-calls"
value=
"$${internal_auth_calls}"
/>
<!-- <param name="auth-messages" value="false"/> -->
<!-- <param name="auth-subscriptions" value="false"/> -->
<!-- Force the user and auth-user to match. -->
<param
name=
"inbound-reg-force-matching-username"
value=
"true"
/>
<!-- on authed calls, authenticate *all* the packets not just invite -->
...
...
src/mod/endpoints/mod_sofia/mod_sofia.h
浏览文件 @
3666029f
...
...
@@ -275,6 +275,7 @@ typedef enum {
PFLAG_TLS_ALWAYS_NAT
,
PFLAG_TCP_ALWAYS_NAT
,
PFLAG_ENABLE_CHAT
,
PFLAG_AUTH_SUBSCRIPTIONS
,
/* No new flags below this line */
PFLAG_MAX
}
PFLAGS
;
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
3666029f
...
...
@@ -4724,6 +4724,10 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
if
(
switch_true
(
val
))
{
sofia_set_pflag
(
profile
,
PFLAG_AUTH_MESSAGES
);
}
}
else
if
(
!
strcasecmp
(
var
,
"auth-subscriptions"
))
{
if
(
switch_true
(
val
))
{
sofia_set_pflag
(
profile
,
PFLAG_AUTH_SUBSCRIPTIONS
);
}
}
else
if
(
!
strcasecmp
(
var
,
"extended-info-parsing"
))
{
if
(
switch_true
(
val
))
{
sofia_set_pflag
(
profile
,
PFLAG_EXTENDED_INFO_PARSING
);
...
...
src/mod/endpoints/mod_sofia/sofia_presence.c
浏览文件 @
3666029f
...
...
@@ -3768,6 +3768,42 @@ void sofia_presence_handle_sip_i_subscribe(int status,
goto
end
;
}
if
((
auth_res
!=
AUTH_OK
&&
auth_res
!=
AUTH_RENEWED
))
{
nua_respond
(
nh
,
SIP_401_UNAUTHORIZED
,
NUTAG_WITH_THIS_MSG
(
de
->
data
->
e_msg
),
TAG_END
());
goto
end
;
}
}
else
if
(
sofia_test_pflag
(
profile
,
PFLAG_AUTH_SUBSCRIPTIONS
))
{
sip_authorization_t
const
*
authorization
=
NULL
;
auth_res_t
auth_res
=
AUTH_FORBIDDEN
;
char
keybuf
[
128
]
=
""
;
char
*
key
;
size_t
keylen
;
switch_event_t
*
v_event
=
NULL
;
key
=
keybuf
;
keylen
=
sizeof
(
keybuf
);
if
(
sip
->
sip_authorization
)
{
authorization
=
sip
->
sip_authorization
;
}
else
if
(
sip
->
sip_proxy_authorization
)
{
authorization
=
sip
->
sip_proxy_authorization
;
}
if
(
authorization
)
{
char
network_ip
[
80
];
int
network_port
;
sofia_glue_get_addr
(
de
->
data
->
e_msg
,
network_ip
,
sizeof
(
network_ip
),
&
network_port
);
auth_res
=
sofia_reg_parse_auth
(
profile
,
authorization
,
sip
,
de
,
(
char
*
)
sip
->
sip_request
->
rq_method_name
,
key
,
keylen
,
network_ip
,
network_port
,
NULL
,
0
,
REG_INVITE
,
NULL
,
NULL
,
NULL
,
NULL
);
}
else
if
(
sofia_reg_handle_register
(
nua
,
profile
,
nh
,
sip
,
de
,
REG_INVITE
,
key
,
(
uint32_t
)
keylen
,
&
v_event
,
NULL
,
NULL
,
NULL
))
{
if
(
v_event
)
{
switch_event_destroy
(
&
v_event
);
}
goto
end
;
}
if
((
auth_res
!=
AUTH_OK
&&
auth_res
!=
AUTH_RENEWED
))
{
nua_respond
(
nh
,
SIP_401_UNAUTHORIZED
,
NUTAG_WITH_THIS_MSG
(
de
->
data
->
e_msg
),
TAG_END
());
goto
end
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论