Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
d6d18748
提交
d6d18748
authored
10月 24, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-3624 --resolve
上级
bad5964b
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
24 行增加
和
12 行删除
+24
-12
mod_spandsp.c
src/mod/applications/mod_spandsp/mod_spandsp.c
+19
-9
mod_spandsp.h
src/mod/applications/mod_spandsp/mod_spandsp.h
+1
-1
mod_spandsp_fax.c
src/mod/applications/mod_spandsp/mod_spandsp_fax.c
+4
-2
没有找到文件。
src/mod/applications/mod_spandsp/mod_spandsp.c
浏览文件 @
d6d18748
...
...
@@ -74,25 +74,35 @@ SWITCH_STANDARD_APP(stop_dtmf_session_function)
SWITCH_STANDARD_APP
(
spandsp_fax_detect_session_function
)
{
int
argc
=
0
;
char
*
argv
[
3
]
=
{
0
};
char
*
argv
[
4
]
=
{
0
};
char
*
dupdata
;
const
char
*
app
=
NULL
,
*
arg
=
NULL
;
int
timeout
=
0
;
int
tone_type
=
MODEM_CONNECT_TONES_FAX_CNG
;
if
(
!
zstr
(
data
)
&&
(
dupdata
=
switch_core_session_strdup
(
session
,
data
)))
{
if
((
argc
=
switch_split
(
dupdata
,
' '
,
argv
))
==
3
)
{
if
((
argc
=
switch_split
(
dupdata
,
' '
,
argv
))
>=
2
)
{
app
=
argv
[
0
];
arg
=
argv
[
1
];
timeout
=
atoi
(
argv
[
2
]);
if
(
timeout
<
0
)
{
timeout
=
0
;
}
if
(
argc
>
2
)
{
timeout
=
atoi
(
argv
[
2
]);
if
(
timeout
<
0
)
{
timeout
=
0
;
}
}
if
(
argc
>
3
)
{
if
(
!
strcmp
(
argv
[
3
],
"ced"
))
{
tone_type
=
MODEM_CONNECT_TONES_FAX_CED_OR_PREAMBLE
;
}
else
{
tone_type
=
MODEM_CONNECT_TONES_FAX_CNG
;
}
}
}
}
if
(
app
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_NOTICE
,
"Enabling fax detection '%s' '%s'
\n
"
,
argv
[
0
],
argv
[
1
]);
spandsp_fax_detect_session
(
session
,
"rw"
,
timeout
,
1
,
app
,
arg
,
NULL
);
spandsp_fax_detect_session
(
session
,
"rw"
,
timeout
,
tone_type
,
1
,
app
,
arg
,
NULL
);
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"Cannot Enable fax detection '%s' '%s'
\n
"
,
argv
[
0
],
argv
[
1
]);
}
...
...
@@ -151,7 +161,7 @@ SWITCH_STANDARD_APP(t38_gateway_function)
}
//switch_ivr_tone_detect_session(session, "t38", "1100.0", "rw", timeout, 1, direction, NULL, t38_gateway_start);
spandsp_fax_detect_session
(
session
,
"rw"
,
timeout
,
1
,
direction
,
NULL
,
t38_gateway_start
);
spandsp_fax_detect_session
(
session
,
"rw"
,
timeout
,
MODEM_CONNECT_TONES_FAX_CED_OR_PREAMBLE
,
1
,
direction
,
NULL
,
t38_gateway_start
);
}
}
...
...
@@ -270,7 +280,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_spandsp_init)
SWITCH_ADD_APP
(
app_interface
,
"spandsp_start_dtmf"
,
"Detect dtmf"
,
"Detect inband dtmf on the session"
,
dtmf_session_function
,
""
,
SAF_MEDIA_TAP
);
SWITCH_ADD_APP
(
app_interface
,
"spandsp_start_fax_detect"
,
"start fax detect"
,
"start fax detect"
,
spandsp_fax_detect_session_function
,
"<app>[ <arg>][ <timeout
>]"
,
SAF_NONE
);
"<app>[ <arg>][ <timeout>][ <tone_type
>]"
,
SAF_NONE
);
SWITCH_ADD_APP
(
app_interface
,
"spandsp_stop_fax_detect"
,
"stop fax detect"
,
"stop fax detect"
,
spandsp_stop_fax_detect_session_function
,
""
,
SAF_NONE
);
...
...
src/mod/applications/mod_spandsp/mod_spandsp.h
浏览文件 @
d6d18748
...
...
@@ -70,7 +70,7 @@ switch_status_t callprogress_detector_start(switch_core_session_t *session, cons
switch_status_t
callprogress_detector_stop
(
switch_core_session_t
*
session
);
switch_status_t
spandsp_fax_detect_session
(
switch_core_session_t
*
session
,
const
char
*
flags
,
int
timeout
,
const
char
*
flags
,
int
timeout
,
int
tone_type
,
int
hits
,
const
char
*
app
,
const
char
*
data
,
switch_tone_detect_callback_t
callback
);
switch_status_t
spandsp_fax_stop_detect_session
(
switch_core_session_t
*
session
);
src/mod/applications/mod_spandsp/mod_spandsp_fax.c
浏览文件 @
d6d18748
...
...
@@ -1861,6 +1861,7 @@ typedef struct {
char
*
data
;
char
*
key
;
int
up
;
int
tone_type
;
int
total_hits
;
int
hits
;
int
sleep
;
...
...
@@ -1910,7 +1911,7 @@ static switch_bool_t tone_detect_callback(switch_media_bug_t *bug, void *user_da
case
SWITCH_ABC_TYPE_INIT
:
if
(
cont
)
{
cont
->
bug_running
=
1
;
modem_connect_tones_rx_init
(
&
cont
->
rx_tones
,
MODEM_CONNECT_TONES_FAX_CED_OR_PREAMBLE
,
NULL
,
NULL
);
modem_connect_tones_rx_init
(
&
cont
->
rx_tones
,
cont
->
tone_type
,
NULL
,
NULL
);
}
break
;
case
SWITCH_ABC_TYPE_CLOSE
:
...
...
@@ -2018,7 +2019,7 @@ switch_status_t spandsp_fax_stop_detect_session(switch_core_session_t *session)
}
switch_status_t
spandsp_fax_detect_session
(
switch_core_session_t
*
session
,
const
char
*
flags
,
int
timeout
,
const
char
*
flags
,
int
timeout
,
int
tone_type
,
int
hits
,
const
char
*
app
,
const
char
*
data
,
switch_tone_detect_callback_t
callback
)
{
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
...
...
@@ -2051,6 +2052,7 @@ switch_status_t spandsp_fax_detect_session(switch_core_session_t *session,
cont
->
data
=
switch_core_session_strdup
(
session
,
data
);
}
cont
->
tone_type
=
tone_type
;
cont
->
callback
=
callback
;
cont
->
up
=
1
;
cont
->
session
=
session
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论