[Asterisk-code-review] res fax: add FAXMODE variable (asterisk[13])

Alexei Gradinari asteriskteam at digium.com
Mon May 2 16:14:54 CDT 2016


Alexei Gradinari has uploaded a new change for review.

  https://gerrit.asterisk.org/2743

Change subject: res_fax: add FAXMODE variable
......................................................................

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
---
M res/res_fax.c
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/43/2743/1

diff --git a/res/res_fax.c b/res/res_fax.c
index ef0e276..cc0228e 100644
--- a/res/res_fax.c
+++ b/res/res_fax.c
@@ -1447,6 +1447,12 @@
 	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 @@
 	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 @@
 	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 */

-- 
To view, visit https://gerrit.asterisk.org/2743
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie3dcbfb72cc681e9e267a60202f7fb8723a51b6b
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>



More information about the asterisk-code-review mailing list