summaryrefslogtreecommitdiff
path: root/res/res_fax.c
diff options
context:
space:
mode:
authorAlexei Gradinari <alex2grad@gmail.com>2016-05-02 17:08:06 -0400
committerAlexei Gradinari <alex2grad@gmail.com>2016-05-04 09:37:15 -0500
commit380ac201acf29efb2a69a4ef668a8d7da387f47b (patch)
tree12e20d40eb0d4c014b8a99fec298957d75b939ed /res/res_fax.c
parent122895f8646031789c58abacc514367a7d1e68ee (diff)
res_fax: add FAXMODE variable
The app_fax set FAXMODE variable, but res_fax missing this feature. This patch add FAXMODE variable which is set to either "audio" or "T38". ASTERISK-25980 Change-Id: Ie3dcbfb72cc681e9e267a60202f7fb8723a51b6b
Diffstat (limited to 'res/res_fax.c')
-rw-r--r--res/res_fax.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/res/res_fax.c b/res/res_fax.c
index f171af92a..33c3f116b 100644
--- a/res/res_fax.c
+++ b/res/res_fax.c
@@ -1447,6 +1447,12 @@ static void set_channel_variables(struct ast_channel *chan, struct ast_fax_sessi
pbx_builtin_setvar_helper(chan, "FAXBITRATE", S_OR(details->transfer_rate, NULL));
pbx_builtin_setvar_helper(chan, "FAXRESOLUTION", S_OR(details->resolution, NULL));
+ if (ast_channel_get_t38_state(chan) == T38_STATE_NEGOTIATED) {
+ pbx_builtin_setvar_helper(chan, "FAXMODE", "T38");
+ } else {
+ pbx_builtin_setvar_helper(chan, "FAXMODE", "audio");
+ }
+
snprintf(buf, sizeof(buf), "%u", details->pages_transferred);
pbx_builtin_setvar_helper(chan, "FAXPAGES", buf);
}
@@ -2071,6 +2077,7 @@ static int receivefax_exec(struct ast_channel *chan, const char *data)
pbx_builtin_setvar_helper(chan, "FAXPAGES", "0");
pbx_builtin_setvar_helper(chan, "FAXBITRATE", NULL);
pbx_builtin_setvar_helper(chan, "FAXRESOLUTION", NULL);
+ pbx_builtin_setvar_helper(chan, "FAXMODE", NULL);
/* Get a FAX session details structure from the channel's FAX datastore and create one if
* it does not already exist. */
@@ -2578,6 +2585,7 @@ static int sendfax_exec(struct ast_channel *chan, const char *data)
pbx_builtin_setvar_helper(chan, "FAXPAGES", "0");
pbx_builtin_setvar_helper(chan, "FAXBITRATE", NULL);
pbx_builtin_setvar_helper(chan, "FAXRESOLUTION", NULL);
+ pbx_builtin_setvar_helper(chan, "FAXMODE", NULL);
/* Get a requirement structure and set it. This structure is used
* to tell the FAX technology module about the higher level FAX session */