Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
24456954
提交
24456954
authored
11月 19, 2006
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@3415
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
da2397d0
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
25 行增加
和
33 行删除
+25
-33
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+25
-33
没有找到文件。
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
24456954
...
@@ -4120,6 +4120,8 @@ static void sip_r_register(int status,
...
@@ -4120,6 +4120,8 @@ static void sip_r_register(int status,
char
const
*
scheme
=
NULL
;
char
const
*
scheme
=
NULL
;
int
index
;
int
index
;
char
*
cur
;
char
*
cur
;
char
authentication
[
256
]
=
""
;
int
ss_state
;
if
(
session
)
{
if
(
session
)
{
private_object_t
*
tech_pvt
;
private_object_t
*
tech_pvt
;
...
@@ -4129,6 +4131,15 @@ static void sip_r_register(int status,
...
@@ -4129,6 +4131,15 @@ static void sip_r_register(int status,
}
}
}
}
if
(
sofia_private
&&
sofia_private
->
oreg
)
{
oreg
=
sofia_private
->
oreg
;
if
(
oreg
&&
status
==
200
)
{
oreg
->
state
=
REG_STATE_REGISTER
;
return
;
}
}
if
(
status
==
401
||
status
==
407
)
{
if
(
status
==
401
||
status
==
407
)
{
if
(
sip
->
sip_www_authenticate
)
{
if
(
sip
->
sip_www_authenticate
)
{
authenticate
=
sip
->
sip_www_authenticate
;
authenticate
=
sip
->
sip_www_authenticate
;
...
@@ -4152,13 +4163,8 @@ static void sip_r_register(int status,
...
@@ -4152,13 +4163,8 @@ static void sip_r_register(int status,
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"No scheme and realm!
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"No scheme and realm!
\n
"
);
return
;
return
;
}
}
}
if
(
sofia_private
)
{
if
(
profile
)
{
if
(
sofia_private
->
oreg
)
{
oreg
=
sofia_private
->
oreg
;
}
else
if
(
profile
)
{
outbound_reg_t
*
oregp
;
outbound_reg_t
*
oregp
;
if
((
duprealm
=
strdup
(
realm
)))
{
if
((
duprealm
=
strdup
(
realm
)))
{
...
@@ -4167,6 +4173,7 @@ static void sip_r_register(int status,
...
@@ -4167,6 +4173,7 @@ static void sip_r_register(int status,
while
(
*
qrealm
&&
*
qrealm
==
'"'
)
{
while
(
*
qrealm
&&
*
qrealm
==
'"'
)
{
qrealm
++
;
qrealm
++
;
}
}
if
((
p
=
strchr
(
qrealm
,
'"'
)))
{
if
((
p
=
strchr
(
qrealm
,
'"'
)))
{
*
p
=
'\0'
;
*
p
=
'\0'
;
}
}
...
@@ -4186,38 +4193,23 @@ static void sip_r_register(int status,
...
@@ -4186,38 +4193,23 @@ static void sip_r_register(int status,
return
;
return
;
}
}
}
}
}
if
(
!
oreg
)
{
return
;
}
if
(
status
==
200
)
{
oreg
->
state
=
REG_STATE_REGISTER
;
}
else
if
(
authenticate
)
{
char
authentication
[
256
]
=
""
;
int
ss_state
;
if
(
realm
)
{
snprintf
(
authentication
,
sizeof
(
authentication
),
"%s:%s:%s:%s"
,
scheme
,
realm
,
oreg
->
register_username
,
oreg
->
register_password
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Authenticating '%s' with '%s'.
\n
"
,
snprintf
(
authentication
,
sizeof
(
authentication
),
"%s:%s:%s:%s"
,
scheme
,
realm
,
profile
->
username
,
authentication
);
oreg
->
register_username
,
oreg
->
register_password
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Authenticating '%s' with '%s'.
\n
"
,
profile
->
username
,
authentication
);
ss_state
=
nua_callstate_authenticating
;
tl_gets
(
tags
,
ss_state
=
nua_callstate_authenticating
;
NUTAG_CALLSTATE_REF
(
ss_state
),
SIPTAG_WWW_AUTHENTICATE_REF
(
authenticate
),
TAG_END
());
tl_gets
(
tags
,
NUTAG_CALLSTATE_REF
(
ss_state
),
nua_authenticate
(
nh
,
SIPTAG_EXPIRES_STR
(
oreg
->
expires_str
),
NUTAG_AUTH
(
authentication
),
TAG_END
());
SIPTAG_WWW_AUTHENTICATE_REF
(
authenticate
),
}
TAG_END
());
nua_authenticate
(
nh
,
SIPTAG_EXPIRES_STR
(
oreg
->
expires_str
),
NUTAG_AUTH
(
authentication
),
TAG_END
());
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论