summaryrefslogtreecommitdiff
path: root/res/res_fax.c
diff options
context:
space:
mode:
authorGregory Nietsky <gregory@distrotech.co.za>2011-05-16 14:56:53 +0000
committerGregory Nietsky <gregory@distrotech.co.za>2011-05-16 14:56:53 +0000
commit32d43ebe193a50608c2c71bff9a8e990ae0c086e (patch)
tree049c5eefc4532bc2e89c74bed647133d019c1e4c /res/res_fax.c
parent938290cf0d7d9779113fe9059fae7f0f547a71d7 (diff)
When a error in T.38 negotiation happens or its rejected on a channel the
state of the channel reverts to unknown this should be rejected. this is important for negotiating T.38 gateway see #13405 This patch adds a option T38_REJECTED that behaves as T38_DISABLED except it reports state rejected. Trivial Change to res_fax to honnor UNAVAILABLE and REJECTED states. (closes issue #18889) Reported by: irroot Tested by: irroot, darkbasic, mnicholson Review: https://reviewboard.asterisk.org/r/1115 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@319087 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_fax.c')
-rw-r--r--res/res_fax.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/res/res_fax.c b/res/res_fax.c
index 4126cef5c..e323fba65 100644
--- a/res/res_fax.c
+++ b/res/res_fax.c
@@ -991,6 +991,7 @@ static int set_fax_t38_caps(struct ast_channel *chan, struct ast_fax_session_det
case T38_STATE_UNKNOWN:
details->caps |= AST_FAX_TECH_T38;
break;
+ case T38_STATE_REJECTED:
case T38_STATE_UNAVAILABLE:
details->caps |= AST_FAX_TECH_AUDIO;
break;
@@ -1510,6 +1511,7 @@ static int receivefax_exec(struct ast_channel *chan, const char *data)
);
struct ast_flags opts = { 0, };
struct manager_event_info info;
+ enum ast_t38_state t38state;
/* initialize output channel variables */
pbx_builtin_setvar_helper(chan, "FAXSTATUS", "FAILED");
@@ -1631,7 +1633,8 @@ static int receivefax_exec(struct ast_channel *chan, const char *data)
details->option.statusevents = AST_FAX_OPTFLAG_TRUE;
}
- if ((ast_channel_get_t38_state(chan) == T38_STATE_UNAVAILABLE) ||
+ t38state = ast_channel_get_t38_state(chan);
+ if ((t38state == T38_STATE_UNAVAILABLE) || (t38state == T38_STATE_REJECTED) ||
ast_test_flag(&opts, OPT_ALLOWAUDIO) ||
ast_test_flag(&opts, OPT_FORCE_AUDIO)) {
details->option.allow_audio = AST_FAX_OPTFLAG_TRUE;
@@ -1972,6 +1975,7 @@ static int sendfax_exec(struct ast_channel *chan, const char *data)
);
struct ast_flags opts = { 0, };
struct manager_event_info info;
+ enum ast_t38_state t38state;
/* initialize output channel variables */
pbx_builtin_setvar_helper(chan, "FAXSTATUS", "FAILED");
@@ -2112,7 +2116,8 @@ static int sendfax_exec(struct ast_channel *chan, const char *data)
details->option.statusevents = AST_FAX_OPTFLAG_TRUE;
}
- if ((ast_channel_get_t38_state(chan) == T38_STATE_UNAVAILABLE) ||
+ t38state = ast_channel_get_t38_state(chan);
+ if ((t38state == T38_STATE_UNAVAILABLE) || (t38state == T38_STATE_REJECTED) ||
ast_test_flag(&opts, OPT_ALLOWAUDIO) ||
ast_test_flag(&opts, OPT_FORCE_AUDIO)) {
details->option.allow_audio = AST_FAX_OPTFLAG_TRUE;