Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
bce387e5
提交
bce387e5
authored
10月 24, 2016
作者:
Anthony Minessale
提交者:
Mike Jerris
11月 16, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-9665 #resolve [Add video_pre_call_banner feature]
Conflicts: src/switch_ivr_bridge.c
上级
c57f7217
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
65 行增加
和
14 行删除
+65
-14
switch_types.h
src/include/switch_types.h
+2
-1
mod_png.c
src/mod/formats/mod_png/mod_png.c
+10
-6
switch_core_io.c
src/switch_core_io.c
+2
-2
switch_core_media.c
src/switch_core_media.c
+4
-2
switch_ivr_bridge.c
src/switch_ivr_bridge.c
+47
-3
没有找到文件。
src/include/switch_types.h
浏览文件 @
bce387e5
...
...
@@ -1498,7 +1498,8 @@ typedef enum {
CF_VIDEO_WRITING
,
CF_SLA_INTERCEPT
,
CF_VIDEO_BREAK
,
CF_AUDIO_PAUSE
,
CF_AUDIO_PAUSE_READ
,
CF_AUDIO_PAUSE_WRITE
,
CF_VIDEO_PAUSE_READ
,
CF_VIDEO_PAUSE_WRITE
,
CF_BYPASS_MEDIA_AFTER_HOLD
,
...
...
src/mod/formats/mod_png/mod_png.c
浏览文件 @
bce387e5
...
...
@@ -181,6 +181,7 @@ static switch_status_t png_file_read_video(switch_file_handle_t *handle, switch_
{
png_file_context_t
*
context
=
(
png_file_context_t
*
)
handle
->
private_info
;
switch_image_t
*
dup
=
NULL
;
int
have_frame
=
0
;
if
((
flags
&
SVR_CHECK
))
{
return
SWITCH_STATUS_BREAK
;
...
...
@@ -190,18 +191,21 @@ static switch_status_t png_file_read_video(switch_file_handle_t *handle, switch_
return
SWITCH_STATUS_FALSE
;
}
if
((
context
->
reads
++
%
20
)
==
0
)
{
if
((
flags
&&
SVR_BLOCK
))
{
switch_yield
(
33000
);
have_frame
=
1
;
}
else
if
((
context
->
reads
++
%
20
)
==
0
)
{
have_frame
=
1
;
}
if
(
have_frame
)
{
switch_img_copy
(
context
->
img
,
&
dup
);
frame
->
img
=
dup
;
context
->
sent
++
;
return
SWITCH_STATUS_SUCCESS
;
}
else
{
if
((
flags
&&
SVR_BLOCK
))
{
switch_yield
(
5000
);
}
return
SWITCH_STATUS_BREAK
;
}
return
SWITCH_STATUS_SUCCESS
;
}
typedef
struct
{
...
...
src/switch_core_io.c
浏览文件 @
bce387e5
...
...
@@ -97,7 +97,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
return
SWITCH_STATUS_SUCCESS
;
}
if
(
switch_channel_test_flag
(
session
->
channel
,
CF_AUDIO_PAUSE
))
{
if
(
switch_channel_test_flag
(
session
->
channel
,
CF_AUDIO_PAUSE
_READ
))
{
switch_yield
(
20000
);
*
frame
=
&
runtime
.
dummy_cng_frame
;
// switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Media Paused!!!!\n");
...
...
@@ -1039,7 +1039,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
}
}
if
(
switch_channel_test_flag
(
session
->
channel
,
CF_AUDIO_PAUSE
))
{
if
(
switch_channel_test_flag
(
session
->
channel
,
CF_AUDIO_PAUSE
_WRITE
))
{
return
SWITCH_STATUS_SUCCESS
;
}
...
...
src/switch_core_media.c
浏览文件 @
bce387e5
...
...
@@ -3790,7 +3790,8 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
return
0
;
}
switch_channel_clear_flag
(
channel
,
CF_AUDIO_PAUSE
);
switch_channel_clear_flag
(
channel
,
CF_AUDIO_PAUSE_READ
);
switch_channel_clear_flag
(
channel
,
CF_AUDIO_PAUSE_WRITE
);
if
(
dtls_ok
(
session
)
&&
(
tmp
=
switch_channel_get_variable
(
smh
->
session
->
channel
,
"webrtc_enable_dtls"
))
&&
switch_false
(
tmp
))
{
switch_channel_clear_flag
(
smh
->
session
->
channel
,
CF_DTLS_OK
);
...
...
@@ -5025,7 +5026,8 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
pmap
->
recv_pt
=
97
;
pmap
->
codec_ms
=
20
;
a_engine
->
cur_payload_map
=
pmap
;
switch_channel_set_flag
(
channel
,
CF_AUDIO_PAUSE
);
switch_channel_set_flag
(
channel
,
CF_AUDIO_PAUSE_READ
);
switch_channel_set_flag
(
channel
,
CF_AUDIO_PAUSE_WRITE
);
}
...
...
src/switch_ivr_bridge.c
浏览文件 @
bce387e5
...
...
@@ -55,7 +55,7 @@ static void video_bridge_thread(switch_core_session_t *session, void *obj)
switch_frame_t
*
read_frame
=
0
;
int
set_decoded_read
=
0
,
refresh_timer
=
0
;
int
refresh_cnt
=
300
;
vh
->
up
=
1
;
switch_core_session_read_lock
(
vh
->
session_a
);
...
...
@@ -107,13 +107,14 @@ static void video_bridge_thread(switch_core_session_t *session, void *obj)
}
status
=
switch_core_session_read_video_frame
(
vh
->
session_a
,
&
read_frame
,
SWITCH_IO_FLAG_NONE
,
0
);
if
(
!
SWITCH_READ_ACCEPTABLE
(
status
))
{
switch_cond_next
();
continue
;
}
}
if
(
switch_test_flag
(
read_frame
,
SFF_CNG
)
||
switch_channel_test_flag
(
channel
,
CF_LEG_HOLDING
)
||
switch_channel_test_flag
(
b_channel
,
CF_VIDEO_READ_FILE_ATTACHED
))
{
continue
;
...
...
@@ -257,6 +258,8 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj)
const
char
*
exec_app
=
NULL
;
const
char
*
exec_data
=
NULL
;
switch_codec_implementation_t
read_impl
=
{
0
};
const
char
*
banner_file
=
NULL
;
int
played_banner
=
0
,
banner_counter
=
0
;
#ifdef SWITCH_VIDEO_IN_THREADS
struct
vid_helper
vh
=
{
0
};
...
...
@@ -271,7 +274,6 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj)
switch_core_session_get_read_impl
(
session_a
,
&
read_impl
);
input_callback
=
data
->
input_callback
;
user_data
=
data
->
session_data
;
stream_id
=
data
->
stream_id
;
...
...
@@ -318,6 +320,17 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj)
goto
end_of_bridge_loop
;
}
if
(
switch_channel_test_flag
(
chan_a
,
CF_BRIDGE_ORIGINATOR
)
&&
(
banner_file
=
switch_channel_get_variable
(
chan_a
,
"video_pre_call_banner"
)))
{
switch_channel_set_flag
(
chan_a
,
CF_AUDIO_PAUSE_READ
);
switch_channel_set_flag
(
chan_b
,
CF_AUDIO_PAUSE_READ
);
switch_channel_set_flag
(
chan_a
,
CF_AUDIO_PAUSE_WRITE
);
switch_channel_set_flag
(
chan_b
,
CF_AUDIO_PAUSE_WRITE
);
switch_channel_set_flag
(
chan_a
,
CF_VIDEO_PAUSE_READ
);
switch_channel_set_flag
(
chan_b
,
CF_VIDEO_PAUSE_READ
);
}
if
(
bypass_media_after_bridge
)
{
const
char
*
source_a
=
switch_channel_get_variable
(
chan_a
,
"source"
);
const
char
*
source_b
=
switch_channel_get_variable
(
chan_b
,
"source"
);
...
...
@@ -455,6 +468,37 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj)
#endif
if
(
read_frame_count
>=
DEFAULT_LEAD_FRAMES
&&
switch_channel_media_ack
(
chan_a
))
{
if
(
!
played_banner
&&
switch_channel_test_flag
(
chan_a
,
CF_VIDEO
)
&&
switch_channel_test_flag
(
chan_b
,
CF_VIDEO
)
&&
switch_channel_test_flag
(
chan_a
,
CF_ANSWERED
)
&&
switch_channel_test_flag
(
chan_b
,
CF_ANSWERED
)
&&
++
banner_counter
>
100
&&
switch_channel_test_flag
(
chan_a
,
CF_VIDEO_READY
)
&&
switch_channel_test_flag
(
chan_b
,
CF_VIDEO_READY
)
&&
switch_channel_test_flag
(
chan_a
,
CF_BRIDGE_ORIGINATOR
)
&&
banner_file
)
{
const
char
*
b_banner_file
=
switch_channel_get_variable
(
chan_b
,
"video_pre_call_banner"
);
if
(
!
b_banner_file
)
{
b_banner_file
=
switch_channel_get_variable
(
chan_a
,
"video_pre_call_banner_bleg"
);
}
switch_channel_clear_flag
(
chan_a
,
CF_VIDEO_PAUSE_READ
);
switch_channel_clear_flag
(
chan_b
,
CF_VIDEO_PAUSE_READ
);
if
(
b_banner_file
)
{
switch_ivr_broadcast
(
switch_core_session_get_uuid
(
session_a
),
banner_file
,
SMF_ECHO_ALEG
);
switch_ivr_broadcast
(
switch_core_session_get_uuid
(
session_b
),
b_banner_file
,
SMF_ECHO_ALEG
);
}
else
{
switch_ivr_broadcast
(
switch_core_session_get_uuid
(
session_a
),
banner_file
,
SMF_ECHO_ALEG
|
SMF_ECHO_BLEG
);
}
played_banner
=
1
;
switch_channel_clear_flag
(
chan_a
,
CF_AUDIO_PAUSE_READ
);
switch_channel_clear_flag
(
chan_b
,
CF_AUDIO_PAUSE_READ
);
switch_channel_clear_flag
(
chan_a
,
CF_AUDIO_PAUSE_WRITE
);
switch_channel_clear_flag
(
chan_b
,
CF_AUDIO_PAUSE_WRITE
);
}
if
(
!
exec_check
)
{
switch_channel_execute_on
(
chan_a
,
SWITCH_CHANNEL_EXECUTE_ON_PRE_BRIDGE_VARIABLE
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论