diff options
author | zuul <zuul@gerrit.asterisk.org> | 2016-05-05 09:18:34 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2016-05-05 09:18:34 -0500 |
commit | 168a7b3dd8c0efd04516f60fd431fce7eac4c985 (patch) | |
tree | 2a85cd0ba9790e12a2bb5efd66575cf14f051d8c | |
parent | 8aef2c4156d64ff008cc9073f3e08c32d356be2c (diff) | |
parent | 06d4ac0355d99ce7a6caacf2e52a22078233e9c4 (diff) |
Merge "res_fax: add FAXMODE variable" into 13
-rw-r--r-- | CHANGES | 5 | ||||
-rw-r--r-- | res/res_fax.c | 8 |
2 files changed, 13 insertions, 0 deletions
@@ -12,6 +12,11 @@ --- Functionality changes from Asterisk 13.9.0 to Asterisk 13.10.0 ----------- ------------------------------------------------------------------------------ +res_fax +------------------ + * Added FAXMODE variable to let dialplan know what fax transport was used. + FAXMODE variable is set to either "audio" or "T38". + res_pjsip ------------------ * Added new status Updated to AMI event ContactStatus on update registration diff --git a/res/res_fax.c b/res/res_fax.c index ef0e27696..2fa64bc0f 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 */ |