Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
82034755
提交
82034755
authored
4月 26, 2012
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-4148 --resolve note: see switch_core_session_get_partner
上级
5e99d34f
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
38 行增加
和
17 行删除
+38
-17
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+1
-0
mod_sofia.h
src/mod/endpoints/mod_sofia/mod_sofia.h
+1
-0
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+36
-17
没有找到文件。
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
82034755
...
...
@@ -2399,6 +2399,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
char
*
sdp
=
(
char
*
)
msg
->
pointer_arg
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Responding with %d [%s]
\n
"
,
code
,
reason
);
sofia_clear_flag
(
tech_pvt
,
TFLAG_REINVITED
);
if
(
!
zstr
((
sdp
)))
{
if
(
!
strcasecmp
(
sdp
,
"t38"
))
{
...
...
src/mod/endpoints/mod_sofia/mod_sofia.h
浏览文件 @
82034755
...
...
@@ -331,6 +331,7 @@ typedef enum {
TFLAG_LIBERAL_DTMF
,
TFLAG_GOT_ACK
,
TFLAG_CAPTURE
,
TFLAG_REINVITED
,
/* No new flags below this line */
TFLAG_MAX
}
TFLAGS
;
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
82034755
...
...
@@ -5521,7 +5521,6 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
switch_channel_t
*
channel
=
NULL
;
private_object_t
*
tech_pvt
=
NULL
;
const
char
*
replaces_str
=
NULL
;
const
char
*
uuid
;
switch_core_session_t
*
other_session
=
NULL
;
switch_channel_t
*
other_channel
=
NULL
;
//private_object_t *other_tech_pvt = NULL;
...
...
@@ -5713,8 +5712,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
goto
done
;
}
}
if
((
uuid
=
switch_channel_get_variable
(
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
))
&&
(
other_session
=
switch_core_session_locate
(
uuid
)))
{
if
(
switch_core_session_get_partner
(
session
,
&
other_session
)
==
SWITCH_STATUS_SUCCESS
)
{
other_channel
=
switch_core_session_get_channel
(
other_session
);
if
(
!
switch_channel_get_variable
(
other_channel
,
SWITCH_B_SDP_VARIABLE
))
{
switch_channel_set_variable
(
other_channel
,
SWITCH_B_SDP_VARIABLE
,
r_sdp
);
...
...
@@ -5745,9 +5743,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if
(
r_sdp
&&
sofia_test_flag
(
tech_pvt
,
TFLAG_3PCC_INVITE
)
&&
!
sofia_test_flag
(
tech_pvt
,
TFLAG_SDP
))
{
sofia_set_flag
(
tech_pvt
,
TFLAG_SDP
);
if
((
uuid
=
switch_channel_get_variable
(
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
))
&&
(
other_session
=
switch_core_session_locate
(
uuid
)))
{
if
(
switch_core_session_get_partner
(
session
,
&
other_session
)
==
SWITCH_STATUS_SUCCESS
)
{
other_channel
=
switch_core_session_get_channel
(
other_session
);
//other_tech_pvt = switch_core_session_get_private(other_session);
...
...
@@ -5785,6 +5781,23 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
goto
done
;
case
nua_callstate_received
:
if
(
!
sofia_test_flag
(
tech_pvt
,
TFLAG_SDP
))
{
if
(
switch_core_session_get_partner
(
session
,
&
other_session
)
==
SWITCH_STATUS_SUCCESS
)
{
private_object_t
*
other_tech_pvt
=
switch_core_session_get_private
(
other_session
);
if
(
sofia_test_flag
(
other_tech_pvt
,
TFLAG_REINVITED
))
{
/* Due to a race between simultaneous reinvites to both legs of a bridge,
an earlier call to nua_invite silently failed.
So we reject the incoming invite with a 491 and redo the failed outgoing invite. */
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Other leg already handling a reinvite, so responding with 491
\n
"
);
nua_respond
(
tech_pvt
->
nh
,
SIP_491_REQUEST_PENDING
,
TAG_END
());
switch_core_session_rwunlock
(
other_session
);
sofia_glue_do_invite
(
session
);
goto
done
;
}
}
if
(
r_sdp
&&
!
sofia_test_flag
(
tech_pvt
,
TFLAG_SDP
))
{
if
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MODE
))
{
switch_channel_set_variable
(
channel
,
SWITCH_ENDPOINT_DISPOSITION_VARIABLE
,
"RECEIVED_NOMEDIA"
);
...
...
@@ -5930,8 +5943,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_NOSDP_REINVITE
);
if
((
switch_channel_test_flag
(
channel
,
CF_PROXY_MODE
)
||
switch_channel_test_flag
(
channel
,
CF_PROXY_MEDIA
))
&&
sofia_test_pflag
(
profile
,
PFLAG_3PCC_PROXY
))
{
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_3PCC
);
if
((
uuid
=
switch_channel_get_variable
(
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
))
&&
(
other_session
=
switch_core_session_locate
(
uuid
)))
{
if
(
switch_core_session_get_partner
(
session
,
&
other_session
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_core_session_message_t
*
msg
;
msg
=
switch_core_session_alloc
(
other_session
,
sizeof
(
*
msg
));
msg
->
message_id
=
SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT
;
...
...
@@ -5972,11 +5984,11 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if
(
switch_stristr
(
"m=image"
,
r_sdp
))
{
is_t38
=
1
;
}
if
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MODE
)
||
switch_channel_test_flag
(
channel
,
CF_PROXY_MEDIA
))
{
if
((
uuid
=
switch_channel_get_variable
(
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
))
&&
(
other_session
=
switch_core_session_locate
(
uuid
)))
{
if
(
switch_core_session_get_partner
(
session
,
&
other_session
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_core_session_message_t
*
msg
;
private_object_t
*
other_tech_pvt
;
if
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MODE
)
&&
!
is_t38
&&
profile
->
media_options
&
MEDIA_OPT_MEDIA_ON_HOLD
)
{
if
(
switch_stristr
(
"sendonly"
,
r_sdp
)
||
switch_stristr
(
"0.0.0.0"
,
r_sdp
))
{
...
...
@@ -6040,6 +6052,16 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
}
}
other_tech_pvt
=
switch_core_session_get_private
(
other_session
);
if
(
sofia_test_flag
(
other_tech_pvt
,
TFLAG_REINVITED
))
{
/* The other leg won the reinvite race */
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Other leg already handling reinvite, so responding with 491
\n
"
);
nua_respond
(
tech_pvt
->
nh
,
SIP_491_REQUEST_PENDING
,
TAG_END
());
switch_core_session_rwunlock
(
other_session
);
goto
done
;
}
sofia_set_flag
(
tech_pvt
,
TFLAG_REINVITED
);
msg
=
switch_core_session_alloc
(
other_session
,
sizeof
(
*
msg
));
msg
->
message_id
=
SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT
;
msg
->
from
=
__FILE__
;
...
...
@@ -6185,8 +6207,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
}
}
if
((
uuid
=
switch_channel_get_variable
(
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
))
&&
(
other_session
=
switch_core_session_locate
(
uuid
)))
{
if
(
switch_core_session_get_partner
(
session
,
&
other_session
)
==
SWITCH_STATUS_SUCCESS
)
{
other_channel
=
switch_core_session_get_channel
(
other_session
);
if
(
!
switch_channel_get_variable
(
other_channel
,
SWITCH_B_SDP_VARIABLE
))
{
switch_channel_set_variable
(
other_channel
,
SWITCH_B_SDP_VARIABLE
,
r_sdp
);
...
...
@@ -6255,8 +6276,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
switch_channel_mark_answered
(
channel
);
if
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MODE
)
||
switch_channel_test_flag
(
channel
,
CF_PROXY_MEDIA
))
{
if
((
uuid
=
switch_channel_get_variable
(
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
))
&&
(
other_session
=
switch_core_session_locate
(
uuid
)))
{
if
(
switch_core_session_get_partner
(
session
,
&
other_session
)
==
SWITCH_STATUS_SUCCESS
)
{
//other_channel = switch_core_session_get_channel(other_session);
//switch_channel_answer(other_channel);
switch_core_session_queue_indication
(
other_session
,
SWITCH_MESSAGE_INDICATE_ANSWER
);
...
...
@@ -6282,8 +6302,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
}
}
if
((
uuid
=
switch_channel_get_variable
(
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
))
&&
(
other_session
=
switch_core_session_locate
(
uuid
)))
{
if
(
switch_core_session_get_partner
(
session
,
&
other_session
)
==
SWITCH_STATUS_SUCCESS
)
{
other_channel
=
switch_core_session_get_channel
(
other_session
);
if
(
!
switch_channel_get_variable
(
other_channel
,
SWITCH_B_SDP_VARIABLE
))
{
switch_channel_set_variable
(
other_channel
,
SWITCH_B_SDP_VARIABLE
,
r_sdp
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论