mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-07 02:18:15 +00:00
Merged revisions 177699 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r177699 | dhubbard | 2009-02-20 14:29:00 -0600 (Fri, 20 Feb 2009) | 9 lines Make app_fax compatible with spandsp-0.0.6pre4 Prior to spandsp-0.0.6pre4 the t30_stats_t structure used a pages_transferred integer to indicate the number of pages transferred (so far) during the fax session. The spandsp-0.0.6pre4 release removed the pages_transferred integer and replaced it with two different integers - pages_tx and pages_rx. This revision uses the new integers for spandsp-0.0.6pre4 while maintaining backwards compatibility for previous spandsp releases. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@177763 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -161,6 +161,7 @@ static void phase_e_handler(t30_state_t *f, void *user_data, int result)
|
|||||||
char buf[20];
|
char buf[20];
|
||||||
fax_session *s = (fax_session *) user_data;
|
fax_session *s = (fax_session *) user_data;
|
||||||
t30_stats_t stat;
|
t30_stats_t stat;
|
||||||
|
int pages_transferred;
|
||||||
|
|
||||||
ast_debug(1, "Fax phase E handler. result=%d\n", result);
|
ast_debug(1, "Fax phase E handler. result=%d\n", result);
|
||||||
|
|
||||||
@@ -186,7 +187,12 @@ static void phase_e_handler(t30_state_t *f, void *user_data, int result)
|
|||||||
pbx_builtin_setvar_helper(s->chan, "FAXSTATUS", "SUCCESS");
|
pbx_builtin_setvar_helper(s->chan, "FAXSTATUS", "SUCCESS");
|
||||||
pbx_builtin_setvar_helper(s->chan, "FAXERROR", NULL);
|
pbx_builtin_setvar_helper(s->chan, "FAXERROR", NULL);
|
||||||
pbx_builtin_setvar_helper(s->chan, "REMOTESTATIONID", far_ident);
|
pbx_builtin_setvar_helper(s->chan, "REMOTESTATIONID", far_ident);
|
||||||
snprintf(buf, sizeof(buf), "%d", stat.pages_transferred);
|
#if SPANDSP_RELEASE_DATE >= 20090220
|
||||||
|
pages_transferred = (s->direction) ? stat.pages_tx : stat.pages_rx;
|
||||||
|
#else
|
||||||
|
pages_transferred = stat.pages_transferred;
|
||||||
|
#endif
|
||||||
|
snprintf(buf, sizeof(buf), "%d", pages_transferred);
|
||||||
pbx_builtin_setvar_helper(s->chan, "FAXPAGES", buf);
|
pbx_builtin_setvar_helper(s->chan, "FAXPAGES", buf);
|
||||||
snprintf(buf, sizeof(buf), "%d", stat.y_resolution);
|
snprintf(buf, sizeof(buf), "%d", stat.y_resolution);
|
||||||
pbx_builtin_setvar_helper(s->chan, "FAXRESOLUTION", buf);
|
pbx_builtin_setvar_helper(s->chan, "FAXRESOLUTION", buf);
|
||||||
@@ -195,7 +201,7 @@ static void phase_e_handler(t30_state_t *f, void *user_data, int result)
|
|||||||
|
|
||||||
ast_debug(1, "Fax transmitted successfully.\n");
|
ast_debug(1, "Fax transmitted successfully.\n");
|
||||||
ast_debug(1, " Remote station ID: %s\n", far_ident);
|
ast_debug(1, " Remote station ID: %s\n", far_ident);
|
||||||
ast_debug(1, " Pages transferred: %d\n", stat.pages_transferred);
|
ast_debug(1, " Pages transferred: %d\n", pages_transferred);
|
||||||
ast_debug(1, " Image resolution: %d x %d\n", stat.x_resolution, stat.y_resolution);
|
ast_debug(1, " Image resolution: %d x %d\n", stat.x_resolution, stat.y_resolution);
|
||||||
ast_debug(1, " Transfer Rate: %d\n", stat.bit_rate);
|
ast_debug(1, " Transfer Rate: %d\n", stat.bit_rate);
|
||||||
|
|
||||||
@@ -215,7 +221,7 @@ static void phase_e_handler(t30_state_t *f, void *user_data, int result)
|
|||||||
S_OR(s->chan->cid.cid_num, ""),
|
S_OR(s->chan->cid.cid_num, ""),
|
||||||
far_ident,
|
far_ident,
|
||||||
local_ident,
|
local_ident,
|
||||||
stat.pages_transferred,
|
pages_transferred,
|
||||||
stat.y_resolution,
|
stat.y_resolution,
|
||||||
stat.bit_rate,
|
stat.bit_rate,
|
||||||
s->file_name);
|
s->file_name);
|
||||||
|
|||||||
Reference in New Issue
Block a user