Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
49c12191
提交
49c12191
authored
8月 15, 2012
作者:
Anthony Minessale
提交者:
Ken Rice
9月 11, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug lost read lock
上级
1ffda2e5
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
21 行增加
和
29 行删除
+21
-29
switch_core.h
src/include/switch_core.h
+9
-14
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+8
-5
switch_core_session.c
src/switch_core_session.c
+4
-10
没有找到文件。
src/include/switch_core.h
浏览文件 @
49c12191
...
...
@@ -742,13 +742,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_codec_slin(switch_core_s
*/
SWITCH_DECLARE
(
char
*
)
switch_core_get_uuid
(
void
);
#ifdef SWITCH_DEBUG_RWLOCKS
SWITCH_DECLARE
(
switch_core_session_t
*
)
switch_core_session_perform_locate
(
const
char
*
uuid_str
,
const
char
*
file
,
const
char
*
func
,
int
line
);
#endif
#ifdef SWITCH_DEBUG_RWLOCKS
SWITCH_DECLARE
(
switch_core_session_t
*
)
switch_core_session_perform_locate
(
const
char
*
uuid_str
,
const
char
*
file
,
const
char
*
func
,
int
line
);
SWITCH_DECLARE
(
switch_core_session_t
*
)
switch_core_session_perform_force_locate
(
const
char
*
uuid_str
,
const
char
*
file
,
const
char
*
func
,
int
line
);
#endif
/*!
\brief Locate a session based on it's uuid
...
...
@@ -756,11 +753,8 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_perform_force_locate
\return the session or NULL
\note if the session was located it will have a read lock obtained which will need to be released with switch_core_session_rwunlock()
*/
#ifdef SWITCH_DEBUG_RWLOCKS
#define switch_core_session_locate(uuid_str) switch_core_session_perform_locate(uuid_str, __FILE__, __SWITCH_FUNC__, __LINE__)
#else
SWITCH_DECLARE
(
switch_core_session_t
*
)
switch_core_session_locate
(
_In_z_
const
char
*
uuid_str
);
#endif
/*!
\brief Locate a session based on it's uuid even if the channel is not ready
...
...
@@ -768,11 +762,9 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_locate(_In_z_ const
\return the session or NULL
\note if the session was located it will have a read lock obtained which will need to be released with switch_core_session_rwunlock()
*/
#ifdef SWITCH_DEBUG_RWLOCKS
#define switch_core_session_force_locate(uuid_str) switch_core_session_perform_force_locate(uuid_str, __FILE__, __SWITCH_FUNC__, __LINE__)
#else
SWITCH_DECLARE
(
switch_core_session_t
*
)
switch_core_session_force_locate
(
_In_z_
const
char
*
uuid_str
);
#endif
/*!
\brief Retrieve a global variable from the core
...
...
@@ -831,7 +823,10 @@ SWITCH_DECLARE(void) switch_core_session_hupall_endpoint(const switch_endpoint_i
\param partner [out] The session's partner, or NULL if it wasnt found
\return SWITCH_STATUS_SUCCESS or SWITCH_STATUS_FALSE if this session isn't bridged
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_get_partner
(
switch_core_session_t
*
session
,
switch_core_session_t
**
partner
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_perform_get_partner
(
switch_core_session_t
*
session
,
switch_core_session_t
**
partner
,
const
char
*
file
,
const
char
*
func
,
int
line
);
#define switch_core_session_get_partner(_session, _partner) switch_core_session_perform_get_partner(_session, _partner, __FILE__, __SWITCH_FUNC__, __LINE__)
/*!
\brief Send a message to another session using it's uuid
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
49c12191
...
...
@@ -6240,16 +6240,18 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
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
);
int
r
=
sofia_test_flag
(
other_tech_pvt
,
TFLAG_REINVITED
);
switch_core_session_rwunlock
(
other_session
);
if
(
sofia_test_flag
(
other_tech_pvt
,
TFLAG_REINVITED
))
{
if
(
r
)
{
/* 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
"
);
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
;
}
...
...
@@ -6498,6 +6500,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
switch_yield
(
250000
);
launch_media_on_hold
(
session
);
switch_core_session_rwunlock
(
other_session
);
goto
done
;
}
}
...
...
@@ -6516,7 +6519,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
/* 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
);
switch_core_session_rwunlock
(
other_session
);
goto
done
;
}
sofia_set_flag
(
tech_pvt
,
TFLAG_REINVITED
);
...
...
src/switch_core_session.c
浏览文件 @
49c12191
...
...
@@ -105,11 +105,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_codec_slin(switch_core_s
}
#ifdef SWITCH_DEBUG_RWLOCKS
SWITCH_DECLARE
(
switch_core_session_t
*
)
switch_core_session_perform_locate
(
const
char
*
uuid_str
,
const
char
*
file
,
const
char
*
func
,
int
line
)
#else
SWITCH_DECLARE
(
switch_core_session_t
*
)
switch_core_session_locate
(
const
char
*
uuid_str
)
#endif
{
switch_core_session_t
*
session
=
NULL
;
...
...
@@ -139,11 +135,8 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_locate(const char *u
#ifdef SWITCH_DEBUG_RWLOCKS
SWITCH_DECLARE
(
switch_core_session_t
*
)
switch_core_session_perform_force_locate
(
const
char
*
uuid_str
,
const
char
*
file
,
const
char
*
func
,
int
line
)
#else
SWITCH_DECLARE
(
switch_core_session_t
*
)
switch_core_session_force_locate
(
const
char
*
uuid_str
)
#endif
{
switch_core_session_t
*
session
=
NULL
;
switch_status_t
status
;
...
...
@@ -180,12 +173,13 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_force_locate(const c
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_get_partner
(
switch_core_session_t
*
session
,
switch_core_session_t
**
partner
)
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_perform_get_partner
(
switch_core_session_t
*
session
,
switch_core_session_t
**
partner
,
const
char
*
file
,
const
char
*
func
,
int
line
)
{
const
char
*
uuid
;
if
((
uuid
=
switch_channel_get_partner_uuid
(
session
->
channel
)))
{
if
((
*
partner
=
switch_core_session_
locate
(
uuid
)))
{
if
((
*
partner
=
switch_core_session_
perform_locate
(
uuid
,
file
,
func
,
line
)))
{
return
SWITCH_STATUS_SUCCESS
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论