Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
687ae1b3
提交
687ae1b3
authored
4月 12, 2008
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@8098
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
1177be68
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
46 行增加
和
11 行删除
+46
-11
switch_ivr.h
src/include/switch_ivr.h
+4
-1
mod_dptools.c
src/mod/applications/mod_dptools/mod_dptools.c
+13
-9
switch_ivr_async.c
src/switch_ivr_async.c
+29
-1
没有找到文件。
src/include/switch_ivr.h
浏览文件 @
687ae1b3
...
...
@@ -211,7 +211,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_c
\return SWITCH_STATUS_SUCCESS if all is well
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_record_session
(
switch_core_session_t
*
session
,
char
*
file
,
uint32_t
limit
,
switch_file_handle_t
*
fh
);
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_eavesdrop_session
(
switch_core_session_t
*
session
,
const
char
*
uuid
,
switch_eavesdrop_flag_t
flags
);
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_eavesdrop_session
(
switch_core_session_t
*
session
,
const
char
*
uuid
,
const
char
*
require_group
,
switch_eavesdrop_flag_t
flags
);
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_displace_session
(
switch_core_session_t
*
session
,
const
char
*
file
,
uint32_t
limit
,
const
char
*
flags
);
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_stop_displace_session
(
switch_core_session_t
*
session
,
const
char
*
file
);
...
...
src/mod/applications/mod_dptools/mod_dptools.c
浏览文件 @
687ae1b3
...
...
@@ -146,18 +146,20 @@ SWITCH_STANDARD_APP(eavesdrop_function)
if
(
switch_strlen_zero
(
data
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Usage: %s
\n
"
,
eavesdrop_SYNTAX
);
}
else
{
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
const
char
*
require_group
=
switch_channel_get_variable
(
channel
,
"eavesdrop_require_group"
);
if
(
!
strcasecmp
((
char
*
)
data
,
"all"
))
{
switch_core_db_t
*
db
=
switch_core_db_handle
();
char
*
errmsg
=
NULL
;
struct
e_data
e_data
=
{{
0
}};
char
*
sql
=
switch_mprintf
(
"select uuid from channels where uuid != '%q'"
,
switch_core_session_get_uuid
(
session
));
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
const
char
*
file
=
NULL
;
int
x
=
0
;
char
buf
[
2
]
=
""
;
switch_size_t
buflen
=
sizeof
(
buf
);
char
terminator
;
switch_status_t
status
;
while
(
switch_channel_ready
(
channel
))
{
for
(
x
=
0
;
x
<
MAX_SPY
;
x
++
)
{
switch_safe_free
(
e_data
.
uuid_list
[
x
]);
...
...
@@ -179,12 +181,14 @@ SWITCH_STANDARD_APP(eavesdrop_function)
if
((
file
=
switch_channel_get_variable
(
channel
,
"eavesdrop_indicate_new"
)))
{
switch_ivr_play_file
(
session
,
NULL
,
file
,
NULL
);
}
if
(
switch_ivr_eavesdrop_session
(
session
,
e_data
.
uuid_list
[
x
],
ED_DTMF
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Spy: %s Failed
\n
"
,
e_data
.
uuid_list
[
x
]);
if
((
file
=
switch_channel_get_variable
(
channel
,
"eavesdrop_indicate_failed"
)))
{
switch_ivr_play_file
(
session
,
NULL
,
file
,
NULL
);
if
((
status
=
switch_ivr_eavesdrop_session
(
session
,
e_data
.
uuid_list
[
x
],
require_group
,
ED_DTMF
))
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
status
!=
SWITCH_STATUS_BREAK
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Spy: %s Failed
\n
"
,
e_data
.
uuid_list
[
x
]);
if
((
file
=
switch_channel_get_variable
(
channel
,
"eavesdrop_indicate_failed"
)))
{
switch_ivr_play_file
(
session
,
NULL
,
file
,
NULL
);
}
switch_ivr_collect_digits_count
(
session
,
buf
,
buflen
,
1
,
"*"
,
&
terminator
,
5000
,
0
,
0
);
}
switch_ivr_collect_digits_count
(
session
,
buf
,
buflen
,
1
,
"*"
,
&
terminator
,
5000
,
0
,
0
);
}
}
}
else
{
...
...
@@ -202,7 +206,7 @@ SWITCH_STANDARD_APP(eavesdrop_function)
switch_core_db_close
(
db
);
}
else
{
switch_ivr_eavesdrop_session
(
session
,
data
,
ED_DTMF
);
switch_ivr_eavesdrop_session
(
session
,
data
,
require_group
,
ED_DTMF
);
}
}
}
...
...
@@ -214,7 +218,7 @@ SWITCH_STANDARD_APP(three_way_function)
if
(
switch_strlen_zero
(
data
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Usage: %s
\n
"
,
threeway_SYNTAX
);
}
else
{
switch_ivr_eavesdrop_session
(
session
,
data
,
ED_MUX_READ
|
ED_MUX_WRITE
);
switch_ivr_eavesdrop_session
(
session
,
data
,
NULL
,
ED_MUX_READ
|
ED_MUX_WRITE
);
}
}
...
...
src/switch_ivr_async.c
浏览文件 @
687ae1b3
...
...
@@ -489,7 +489,10 @@ static switch_bool_t eavesdrop_callback(switch_media_bug_t *bug, void *user_data
return
SWITCH_TRUE
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_eavesdrop_session
(
switch_core_session_t
*
session
,
const
char
*
uuid
,
switch_eavesdrop_flag_t
flags
)
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_eavesdrop_session
(
switch_core_session_t
*
session
,
const
char
*
uuid
,
const
char
*
require_group
,
switch_eavesdrop_flag_t
flags
)
{
switch_core_session_t
*
tsession
;
switch_status_t
status
=
SWITCH_STATUS_FALSE
;
...
...
@@ -505,11 +508,36 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_session(switch_core_session
int16_t
buf
[
SWITCH_RECOMMENDED_BUFFER_SIZE
/
2
];
switch_codec_t
*
tread_codec
=
switch_core_session_get_read_codec
(
tsession
);
uint32_t
tlen
;
const
char
*
macro_name
=
"eavesdrop_announce"
;
const
char
*
id_name
=
NULL
;
if
(
!
switch_channel_media_ready
(
channel
))
{
goto
end
;
}
if
(
!
switch_channel_media_ready
(
tchannel
))
{
goto
end
;
}
if
((
id_name
=
switch_channel_get_variable
(
tchannel
,
"eavesdrop_announce_id"
)))
{
const
char
*
tmp
=
switch_channel_get_variable
(
tchannel
,
"eavesdrop_annnounce_macro"
);
if
(
tmp
)
{
macro_name
=
tmp
;
}
switch_ivr_phrase_macro
(
session
,
macro_name
,
id_name
,
NULL
,
NULL
);
}
if
(
!
switch_strlen_zero
(
require_group
))
{
const
char
*
group_name
=
switch_channel_get_variable
(
tchannel
,
"eavesdrop_group"
);
if
(
!
group_name
||
strcmp
(
group_name
,
require_group
))
{
status
=
SWITCH_STATUS_BREAK
;
goto
end
;
}
}
ep
=
switch_core_session_alloc
(
session
,
sizeof
(
*
ep
));
tlen
=
tread_codec
->
implementation
->
bytes_per_frame
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论