Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
5c15e85c
提交
5c15e85c
authored
9月 03, 2014
作者:
Giovanni Maruzzelli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mod_spandsp: added SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE on application errors
上级
1b612fec
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
8 行增加
和
0 行删除
+8
-0
mod_spandsp_fax.c
src/mod/applications/mod_spandsp/mod_spandsp_fax.c
+8
-0
没有找到文件。
src/mod/applications/mod_spandsp/mod_spandsp_fax.c
浏览文件 @
5c15e85c
...
...
@@ -1383,12 +1383,14 @@ void mod_spandsp_fax_process_fax(switch_core_session_t *session, const char *dat
if
((
switch_file_exists
(
pvt
->
filename
,
switch_core_session_get_pool
(
session
))
!=
SWITCH_STATUS_SUCCESS
))
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"Cannot send non-existant fax file [%s]
\n
"
,
switch_str_nil
(
pvt
->
filename
));
switch_channel_set_variable
(
channel
,
SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE
,
"Cannot send non-existant fax file"
);
goto
done
;
}
}
}
else
{
if
(
pvt
->
app_mode
==
FUNCTION_TX
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"Fax TX filename not set.
\n
"
);
switch_channel_set_variable
(
channel
,
SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE
,
"Fax TX filename not set"
);
goto
done
;
}
else
if
(
pvt
->
app_mode
==
FUNCTION_RX
)
{
const
char
*
prefix
;
...
...
@@ -1402,6 +1404,7 @@ void mod_spandsp_fax_process_fax(switch_core_session_t *session, const char *dat
if
(
!
(
pvt
->
filename
=
switch_core_session_sprintf
(
session
,
"%s/%s-%ld-%"
SWITCH_TIME_T_FMT
".tif"
,
spandsp_globals
.
spool
,
prefix
,
spandsp_globals
.
total_sessions
,
time
)))
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"Cannot automatically set fax RX destination file
\n
"
);
switch_channel_set_variable
(
channel
,
SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE
,
"Cannot automatically set fax RX destination file"
);
goto
done
;
}
}
else
{
...
...
@@ -1419,6 +1422,7 @@ void mod_spandsp_fax_process_fax(switch_core_session_t *session, const char *dat
if
((
spanfax_init
(
pvt
,
AUDIO_MODE
)
!=
SWITCH_STATUS_SUCCESS
))
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"Cannot initialize Fax engine
\n
"
);
switch_channel_set_variable
(
channel
,
SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE
,
"Cannot initialize Fax engine"
);
return
;
}
...
...
@@ -1454,6 +1458,7 @@ void mod_spandsp_fax_process_fax(switch_core_session_t *session, const char *dat
switch_core_session_set_read_codec
(
session
,
&
read_codec
);
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"Raw read codec activation Failed L16
\n
"
);
switch_channel_set_variable
(
channel
,
SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE
,
"Raw read codec activation Failed L16"
);
goto
done
;
}
...
...
@@ -1471,6 +1476,7 @@ void mod_spandsp_fax_process_fax(switch_core_session_t *session, const char *dat
write_frame
.
buflen
=
SWITCH_RECOMMENDED_BUFFER_SIZE
;
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"Raw write codec activation Failed L16
\n
"
);
switch_channel_set_variable
(
channel
,
SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE
,
"Raw write codec activation Failed L16"
);
goto
done
;
}
...
...
@@ -1578,12 +1584,14 @@ void mod_spandsp_fax_process_fax(switch_core_session_t *session, const char *dat
/* Pass the new incoming audio frame to the fax_rx function */
if
(
fax_rx
(
pvt
->
fax_state
,
(
int16_t
*
)
read_frame
->
data
,
read_frame
->
samples
))
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"fax_rx reported an error
\n
"
);
switch_channel_set_variable
(
channel
,
SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE
,
"fax_rx reported an error"
);
goto
done
;
}
}
if
((
tx
=
fax_tx
(
pvt
->
fax_state
,
buf
,
write_codec
.
implementation
->
samples_per_packet
))
<
0
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"fax_tx reported an error
\n
"
);
switch_channel_set_variable
(
channel
,
SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE
,
"fax_tx reported an error"
);
goto
done
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论