Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
d86c7156
提交
d86c7156
authored
3月 15, 2019
作者:
Chris Rienzo
提交者:
Chris Rienzo
3月 19, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-11706 [core] protect session stack count with mutex
上级
1a5ce0eb
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
17 行增加
和
11 行删除
+17
-11
switch_core_session.c
src/switch_core_session.c
+13
-8
switch_ivr.c
src/switch_ivr.c
+4
-3
没有找到文件。
src/switch_core_session.c
浏览文件 @
d86c7156
...
@@ -2811,10 +2811,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_exec(switch_core_session_t *
...
@@ -2811,10 +2811,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_exec(switch_core_session_t *
if
(
switch_core_test_flag
(
SCF_DIALPLAN_TIMESTAMPS
)
)
{
if
(
switch_core_test_flag
(
SCF_DIALPLAN_TIMESTAMPS
)
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"EXECUTE [depth=%d] %s %s(%s)
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"EXECUTE [depth=%d] %s %s(%s)
\n
"
,
s
ession
->
stack_count
,
switch_channel_get_name
(
session
->
channel
),
app
,
switch_str_nil
(
expanded
));
s
witch_core_session_stack_count
(
session
,
0
)
,
switch_channel_get_name
(
session
->
channel
),
app
,
switch_str_nil
(
expanded
));
}
else
{
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG_CLEAN
(
session
),
SWITCH_LOG_DEBUG
,
"EXECUTE [depth=%d] %s %s(%s)
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG_CLEAN
(
session
),
SWITCH_LOG_DEBUG
,
"EXECUTE [depth=%d] %s %s(%s)
\n
"
,
s
ession
->
stack_count
,
switch_channel_get_name
(
session
->
channel
),
app
,
switch_str_nil
(
expanded
));
s
witch_core_session_stack_count
(
session
,
0
)
,
switch_channel_get_name
(
session
->
channel
),
app
,
switch_str_nil
(
expanded
));
}
}
if
((
var
=
switch_channel_get_variable
(
session
->
channel
,
"verbose_presence"
))
&&
switch_true
(
var
))
{
if
((
var
=
switch_channel_get_variable
(
session
->
channel
,
"verbose_presence"
))
&&
switch_true
(
var
))
{
...
@@ -2905,10 +2905,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_exec(switch_core_session_t *
...
@@ -2905,10 +2905,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_exec(switch_core_session_t *
SWITCH_DECLARE
(
uint32_t
)
switch_core_session_stack_count
(
switch_core_session_t
*
session
,
int
x
)
SWITCH_DECLARE
(
uint32_t
)
switch_core_session_stack_count
(
switch_core_session_t
*
session
,
int
x
)
{
{
uint32_t
stack_count
=
0
;
switch_mutex_lock
(
session
->
mutex
);
if
(
x
>
0
)
session
->
stack_count
++
;
if
(
x
>
0
)
session
->
stack_count
++
;
else
if
(
x
<
0
)
session
->
stack_count
--
;
else
if
(
x
<
0
)
session
->
stack_count
--
;
return
session
->
stack_count
;
stack_count
=
session
->
stack_count
;
switch_mutex_unlock
(
session
->
mutex
);
return
stack_count
;
}
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_execute_exten
(
switch_core_session_t
*
session
,
const
char
*
exten
,
const
char
*
dialplan
,
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_execute_exten
(
switch_core_session_t
*
session
,
const
char
*
exten
,
const
char
*
dialplan
,
...
@@ -2917,6 +2921,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_se
...
@@ -2917,6 +2921,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_se
char
*
dp
[
25
];
char
*
dp
[
25
];
char
*
dpstr
;
char
*
dpstr
;
int
argc
,
x
,
count
=
0
;
int
argc
,
x
,
count
=
0
;
uint32_t
stack_count
=
0
;
switch_caller_profile_t
*
profile
,
*
new_profile
,
*
pp
=
NULL
;
switch_caller_profile_t
*
profile
,
*
new_profile
,
*
pp
=
NULL
;
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
switch_dialplan_interface_t
*
dialplan_interface
=
NULL
;
switch_dialplan_interface_t
*
dialplan_interface
=
NULL
;
...
@@ -2927,13 +2932,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_se
...
@@ -2927,13 +2932,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_se
return
SWITCH_STATUS_FALSE
;
return
SWITCH_STATUS_FALSE
;
}
}
if
(
session
->
stack_count
>
SWITCH_MAX_STACKS
)
{
if
(
(
stack_count
=
switch_core_session_stack_count
(
session
,
0
))
>
SWITCH_MAX_STACKS
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"Error %s too many stacked extensions [depth=%d]
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"Error %s too many stacked extensions [depth=%d]
\n
"
,
switch_channel_get_name
(
session
->
channel
),
s
ession
->
s
tack_count
);
switch_channel_get_name
(
session
->
channel
),
stack_count
);
return
SWITCH_STATUS_FALSE
;
return
SWITCH_STATUS_FALSE
;
}
}
s
ession
->
stack_count
++
;
s
witch_core_session_stack_count
(
session
,
1
)
;
new_profile
=
switch_caller_profile_clone
(
session
,
profile
);
new_profile
=
switch_caller_profile_clone
(
session
,
profile
);
new_profile
->
destination_number
=
switch_core_strdup
(
new_profile
->
pool
,
exten
);
new_profile
->
destination_number
=
switch_core_strdup
(
new_profile
->
pool
,
exten
);
...
@@ -2998,7 +3003,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_se
...
@@ -2998,7 +3003,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_se
while
(
switch_channel_ready
(
channel
)
&&
extension
->
current_application
)
{
while
(
switch_channel_ready
(
channel
)
&&
extension
->
current_application
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_NOTICE
,
"Execute [depth=%d] %s(%s)
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_NOTICE
,
"Execute [depth=%d] %s(%s)
\n
"
,
s
ession
->
stack_count
,
s
witch_core_session_stack_count
(
session
,
0
)
,
extension
->
current_application
->
application_name
,
switch_str_nil
(
extension
->
current_application
->
application_data
));
extension
->
current_application
->
application_name
,
switch_str_nil
(
extension
->
current_application
->
application_data
));
if
(
switch_core_session_execute_application
(
session
,
if
(
switch_core_session_execute_application
(
session
,
...
@@ -3013,7 +3018,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_se
...
@@ -3013,7 +3018,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_se
done
:
done
:
switch_channel_set_hunt_caller_profile
(
channel
,
NULL
);
switch_channel_set_hunt_caller_profile
(
channel
,
NULL
);
s
ession
->
stack_count
--
;
s
witch_core_session_stack_count
(
session
,
-
1
)
;
return
status
;
return
status
;
}
}
...
...
src/switch_ivr.c
浏览文件 @
d86c7156
...
@@ -902,14 +902,15 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_next_signal_data(switch_core_se
...
@@ -902,14 +902,15 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_next_signal_data(switch_core_se
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_parse_all_events
(
switch_core_session_t
*
session
)
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_parse_all_events
(
switch_core_session_t
*
session
)
{
{
switch_channel_t
*
channel
;
switch_channel_t
*
channel
;
if
(
switch_core_session_stack_count
(
session
,
0
)
>
SWITCH_MAX_STACKS
)
{
uint32_t
stack_count
=
0
;
if
((
stack_count
=
switch_core_session_stack_count
(
session
,
0
))
>
SWITCH_MAX_STACKS
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"Error %s too many stacked extensions [depth=%d]
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"Error %s too many stacked extensions [depth=%d]
\n
"
,
switch_core_session_get_name
(
session
),
s
witch_core_session_stack_count
(
session
,
0
)
);
switch_core_session_get_name
(
session
),
s
tack_count
);
return
SWITCH_STATUS_FALSE
;
return
SWITCH_STATUS_FALSE
;
}
}
switch_core_session_stack_count
(
session
,
1
);
switch_core_session_stack_count
(
session
,
1
);
switch_ivr_parse_all_messages
(
session
);
switch_ivr_parse_all_messages
(
session
);
channel
=
switch_core_session_get_channel
(
session
);
channel
=
switch_core_session_get_channel
(
session
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论