aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-13 20:06:33 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-13 20:06:33 +0000
commitf2979833a44e248a6a6bc696e323fd1427741e4d (patch)
treedf2bbbc2ddac1ec202063b5bed9483e91990e1e3 /apps
parent1ca56439afe7b36f08bedd7f0685c770ce6981bf (diff)
Merged revisions 137496 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r137496 | qwell | 2008-08-13 15:05:50 -0500 (Wed, 13 Aug 2008) | 6 lines Add FAXMODE variable with what fax transport was used. (closes issue #13252) Patches: v1-13252.patch uploaded by dimas (license 88) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@137497 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_fax.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/apps/app_fax.c b/apps/app_fax.c
index 6d98755cc..6cb47dd1e 100644
--- a/apps/app_fax.c
+++ b/apps/app_fax.c
@@ -46,8 +46,8 @@ static char *app_sndfax_desc =
" SendFAX(filename[|options]):\n"
"Send a given TIFF file to the channel as a FAX.\n"
"The option string may contain zero or more of the following characters:\n"
-" 'a' -- makes the application behave as an answering machine\n"
-" The default behaviour is to behave as a calling machine.\n"
+" 'a' - makes the application behave as an answering machine\n"
+" The default behaviour is to behave as a calling machine.\n"
"\n"
"This application uses following variables:\n"
" LOCALSTATIONID to identify itself to the remote end.\n"
@@ -55,10 +55,12 @@ static char *app_sndfax_desc =
"\n"
"This application sets the following channel variables upon completion:\n"
" FAXSTATUS - status of operation:\n"
-" SUCCESS | FAILED\n"
-" FAXERROR - Error when FAILED\n"
+" SUCCESS | FAILED\n"
+" FAXERROR - Error when FAILED\n"
+" FAXMODE - Mode used:\n"
+" audio | T38\n"
" REMOTESTATIONID - CSID of the remote side.\n"
-" FAXPAGES - number of pages sent.\n"
+" FAXPAGES - number of pages sent.\n"
" FAXBITRATE - transmition rate.\n"
" FAXRESOLUTION - resolution.\n"
"\n"
@@ -73,7 +75,7 @@ static char *app_rcvfax_desc =
"the file if it already exists. File created will have TIFF format.\n"
"The option string may contain zero or more of the following characters:\n"
" 'c' -- makes the application behave as a calling machine\n"
-" The default behaviour is to behave as an answering machine.\n"
+" The default behaviour is to behave as an answering machine.\n"
"\n"
"This application uses following variables:\n"
" LOCALSTATIONID to identify itself to the remote end.\n"
@@ -81,10 +83,12 @@ static char *app_rcvfax_desc =
"\n"
"This application sets the following channel variables upon completion:\n"
" FAXSTATUS - status of operation:\n"
-" SUCCESS | FAILED\n"
-" FAXERROR - Error when FAILED\n"
+" SUCCESS | FAILED\n"
+" FAXERROR - Error when FAILED\n"
+" FAXMODE - Mode used:\n"
+" audio | T38\n"
" REMOTESTATIONID - CSID of the remote side.\n"
-" FAXPAGES - number of pages sent.\n"
+" FAXPAGES - number of pages sent.\n"
" FAXBITRATE - transmition rate.\n"
" FAXRESOLUTION - resolution.\n"
"\n"
@@ -575,6 +579,7 @@ static int transmit(fax_session *s)
pbx_builtin_setvar_helper(s->chan, "FAXSTATUS", "FAILED");
pbx_builtin_setvar_helper(s->chan, "FAXERROR", "Channel problems");
+ pbx_builtin_setvar_helper(s->chan, "FAXMODE", NULL);
pbx_builtin_setvar_helper(s->chan, "REMOTESTATIONID", NULL);
pbx_builtin_setvar_helper(s->chan, "FAXPAGES", NULL);
pbx_builtin_setvar_helper(s->chan, "FAXRESOLUTION", NULL);
@@ -593,6 +598,7 @@ static int transmit(fax_session *s)
s->t38state = ast_channel_get_t38_state(s->chan);
if (s->t38state != T38_STATE_NEGOTIATED) {
/* T38 is not negotiated on the channel yet. First start regular transmission. If it switches to T38, follow */
+ pbx_builtin_setvar_helper(s->chan, "FAXMODE", "audio");
res = transmit_audio(s);
if (res > 0) {
/* transmit_audio reports switchover to T38. Update t38state */
@@ -604,6 +610,7 @@ static int transmit(fax_session *s)
}
if (s->t38state == T38_STATE_NEGOTIATED) {
+ pbx_builtin_setvar_helper(s->chan, "FAXMODE", "T38");
res = transmit_t38(s);
}