Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
221b82f1
提交
221b82f1
authored
3月 29, 2012
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-4053 try this
上级
13fbaf7e
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
30 行增加
和
6 行删除
+30
-6
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+9
-5
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+21
-1
没有找到文件。
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
221b82f1
...
@@ -495,12 +495,16 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
...
@@ -495,12 +495,16 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
val
=
switch_channel_get_variable
(
tech_pvt
->
channel
,
"disable_q850_reason"
);
val
=
switch_channel_get_variable
(
tech_pvt
->
channel
,
"disable_q850_reason"
);
if
(
!
val
||
switch_false
(
val
))
{
if
(
!
val
||
switch_false
(
val
))
{
if
(
switch_channel_test_flag
(
channel
,
CF_INTERCEPT
)
||
cause
==
SWITCH_CAUSE_PICKED_OFF
||
cause
==
SWITCH_CAUSE_LOSE_RACE
)
{
if
((
val
=
switch_channel_get_variable
(
tech_pvt
->
channel
,
"sip_reason_str"
)))
{
switch_snprintf
(
reason
,
sizeof
(
reason
),
"SIP;cause=200;text=
\"
Call completed elsewhere
\"
"
);
switch_snprintf
(
reason
,
sizeof
(
reason
),
"%s"
,
val
);
}
else
if
(
cause
>
0
&&
cause
<
128
)
{
switch_snprintf
(
reason
,
sizeof
(
reason
),
"Q.850;cause=%d;text=
\"
%s
\"
"
,
cause
,
switch_channel_cause2str
(
cause
));
}
else
{
}
else
{
switch_snprintf
(
reason
,
sizeof
(
reason
),
"%s;cause=%d;text=
\"
%s
\"
"
,
tech_pvt
->
profile
->
username
,
cause
,
switch_channel_cause2str
(
cause
));
if
(
switch_channel_test_flag
(
channel
,
CF_INTERCEPT
)
||
cause
==
SWITCH_CAUSE_PICKED_OFF
||
cause
==
SWITCH_CAUSE_LOSE_RACE
)
{
switch_snprintf
(
reason
,
sizeof
(
reason
),
"SIP;cause=200;text=
\"
Call completed elsewhere
\"
"
);
}
else
if
(
cause
>
0
&&
cause
<
128
)
{
switch_snprintf
(
reason
,
sizeof
(
reason
),
"Q.850;cause=%d;text=
\"
%s
\"
"
,
cause
,
switch_channel_cause2str
(
cause
));
}
else
{
switch_snprintf
(
reason
,
sizeof
(
reason
),
"%s;cause=%d;text=
\"
%s
\"
"
,
tech_pvt
->
profile
->
username
,
cause
,
switch_channel_cause2str
(
cause
));
}
}
}
}
}
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
221b82f1
...
@@ -581,6 +581,14 @@ void sofia_handle_sip_i_bye(switch_core_session_t *session, int status,
...
@@ -581,6 +581,14 @@ void sofia_handle_sip_i_bye(switch_core_session_t *session, int status,
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_BYE
);
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_BYE
);
call_info
=
switch_channel_get_variable
(
channel
,
"presence_call_info_full"
);
call_info
=
switch_channel_get_variable
(
channel
,
"presence_call_info_full"
);
if
(
sip
->
sip_reason
)
{
char
*
reason_header
=
sip_header_as_string
(
nh
->
nh_home
,
(
void
*
)
sip
->
sip_reason
);
if
(
!
zstr
(
reason_header
))
{
switch_channel_set_variable_partner
(
channel
,
"sip_reason"
,
reason_header
);
}
}
if
(
sip
->
sip_reason
&&
sip
->
sip_reason
->
re_protocol
&&
(
!
strcasecmp
(
sip
->
sip_reason
->
re_protocol
,
"Q.850"
)
if
(
sip
->
sip_reason
&&
sip
->
sip_reason
->
re_protocol
&&
(
!
strcasecmp
(
sip
->
sip_reason
->
re_protocol
,
"Q.850"
)
||
!
strcasecmp
(
sip
->
sip_reason
->
re_protocol
,
"FreeSWITCH"
)
||
!
strcasecmp
(
sip
->
sip_reason
->
re_protocol
,
"FreeSWITCH"
)
||
!
strcasecmp
(
sip
->
sip_reason
->
re_protocol
,
profile
->
username
))
&&
sip
->
sip_reason
->
re_cause
)
{
||
!
strcasecmp
(
sip
->
sip_reason
->
re_protocol
,
profile
->
username
))
&&
sip
->
sip_reason
->
re_cause
)
{
...
@@ -981,7 +989,6 @@ static void our_sofia_event_callback(nua_event_t event,
...
@@ -981,7 +989,6 @@ static void our_sofia_event_callback(nua_event_t event,
case
nua_r_unregister
:
case
nua_r_unregister
:
case
nua_r_unsubscribe
:
case
nua_r_unsubscribe
:
case
nua_r_publish
:
case
nua_r_publish
:
case
nua_i_cancel
:
case
nua_i_error
:
case
nua_i_error
:
case
nua_i_active
:
case
nua_i_active
:
case
nua_i_terminated
:
case
nua_i_terminated
:
...
@@ -989,6 +996,19 @@ static void our_sofia_event_callback(nua_event_t event,
...
@@ -989,6 +996,19 @@ static void our_sofia_event_callback(nua_event_t event,
case
nua_i_prack
:
case
nua_i_prack
:
case
nua_r_prack
:
case
nua_r_prack
:
break
;
break
;
case
nua_i_cancel
:
if
(
sip
&&
channel
&&
sip
->
sip_reason
)
{
char
*
reason_header
=
sip_header_as_string
(
nh
->
nh_home
,
(
void
*
)
sip
->
sip_reason
);
if
(
!
zstr
(
reason_header
))
{
switch_channel_set_variable_partner
(
channel
,
"sip_reason"
,
reason_header
);
}
}
break
;
case
nua_r_cancel
:
case
nua_r_cancel
:
{
{
if
(
status
>
299
&&
nh
)
{
if
(
status
>
299
&&
nh
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论