Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
c3dcc603
提交
c3dcc603
authored
7月 15, 2010
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fifo update
上级
395dc14a
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
152 行增加
和
107 行删除
+152
-107
switch_core_pvt.h
src/include/private/switch_core_pvt.h
+1
-0
switch_core.h
src/include/switch_core.h
+6
-0
mod_dptools.c
src/mod/applications/mod_dptools/mod_dptools.c
+10
-8
mod_fifo.c
src/mod/applications/mod_fifo/mod_fifo.c
+110
-99
switch_core_session.c
src/switch_core_session.c
+25
-0
没有找到文件。
src/include/private/switch_core_pvt.h
浏览文件 @
c3dcc603
...
...
@@ -166,6 +166,7 @@ struct switch_core_session {
uint32_t
track_duration
;
uint32_t
track_id
;
switch_log_level_t
loglevel
;
uint32_t
soft_lock
;
};
struct
switch_media_bug
{
...
...
src/include/switch_core.h
浏览文件 @
c3dcc603
...
...
@@ -483,6 +483,7 @@ SWITCH_DECLARE(unsigned int) switch_core_session_started(_In_ switch_core_sessio
SWITCH_DECLARE
(
void
*
)
switch_core_perform_permanent_alloc
(
_In_
switch_size_t
memory
,
_In_z_
const
char
*
file
,
_In_z_
const
char
*
func
,
_In_
int
line
);
/*!
\brief Allocate memory from the main pool with no intention of returning it
\param _memory the number of bytes to allocate
...
...
@@ -698,6 +699,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_loglevel(switch_core_ses
*/
SWITCH_DECLARE
(
switch_log_level_t
)
switch_core_session_get_loglevel
(
switch_core_session_t
*
session
);
SWITCH_DECLARE
(
void
)
switch_core_session_soft_lock
(
switch_core_session_t
*
session
,
uint32_t
sec
);
SWITCH_DECLARE
(
void
)
switch_core_session_soft_unlock
(
switch_core_session_t
*
session
);
/*!
\brief Retrieve the unique identifier from the core
\return a string representing the uuid
...
...
src/mod/applications/mod_dptools/mod_dptools.c
浏览文件 @
c3dcc603
...
...
@@ -2688,20 +2688,22 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
}
switch_event_create
(
&
params
,
SWITCH_EVENT_REQUEST_PARAMS
);
switch_assert
(
params
);
switch_event_add_header_string
(
params
,
SWITCH_STACK_BOTTOM
,
"as_channel"
,
"true"
);
switch_event_add_header_string
(
params
,
SWITCH_STACK_BOTTOM
,
"action"
,
"user_call"
);
if
(
var_event
)
{
switch_event_merge
(
params
,
var_event
);
}
if
(
var_event
&&
(
skip
=
switch_event_get_header
(
var_event
,
"user_recurse_variables"
))
&&
switch_false
(
skip
))
{
if
((
var
=
switch_event_get_header
(
var_event
,
SWITCH_CALL_TIMEOUT_VARIABLE
))
||
(
var
=
switch_event_get_header
(
var_event
,
"leg_timeout"
)))
{
timelimit
=
atoi
(
var
);
}
var_event
=
NULL
;
}
switch_event_create
(
&
params
,
SWITCH_EVENT_REQUEST_PARAMS
);
switch_assert
(
params
);
switch_event_add_header_string
(
params
,
SWITCH_STACK_BOTTOM
,
"as_channel"
,
"true"
);
switch_event_add_header_string
(
params
,
SWITCH_STACK_BOTTOM
,
"action"
,
"user_call"
);
if
(
switch_xml_locate_user
(
"id"
,
user
,
domain
,
NULL
,
&
xml
,
&
x_domain
,
&
x_user
,
&
x_group
,
params
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_WARNING
,
"Can't find user [%s@%s]
\n
"
,
user
,
domain
);
cause
=
SWITCH_CAUSE_SUBSCRIBER_ABSENT
;
...
...
src/mod/applications/mod_fifo/mod_fifo.c
浏览文件 @
c3dcc603
差异被折叠。
点击展开。
src/switch_core_session.c
浏览文件 @
c3dcc603
...
...
@@ -38,6 +38,16 @@
struct
switch_session_manager
session_manager
;
SWITCH_DECLARE
(
void
)
switch_core_session_soft_lock
(
switch_core_session_t
*
session
,
uint32_t
sec
)
{
session
->
soft_lock
=
sec
;
}
SWITCH_DECLARE
(
void
)
switch_core_session_soft_unlock
(
switch_core_session_t
*
session
)
{
session
->
soft_lock
=
0
;
}
#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
...
...
@@ -1174,6 +1184,21 @@ static void *SWITCH_THREAD_FUNC switch_core_session_thread(switch_thread_t *thre
switch_core_session_run
(
session
);
switch_core_media_bug_remove_all
(
session
);
if
(
session
->
soft_lock
)
{
uint32_t
loops
=
session
->
soft_lock
*
10
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Session %"
SWITCH_SIZE_T_FMT
" (%s) Soft-Locked, "
"Waiting %u for external entities
\n
"
,
session
->
id
,
switch_channel_get_name
(
session
->
channel
),
session
->
soft_lock
);
while
(
--
loops
>
0
)
{
if
(
!
session
->
soft_lock
)
break
;
switch_yield
(
100000
);
}
}
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Session %"
SWITCH_SIZE_T_FMT
" (%s) Locked, Waiting on external entities
\n
"
,
session
->
id
,
switch_channel_get_name
(
session
->
channel
));
switch_core_session_write_lock
(
session
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论