summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2016-08-26 14:02:59 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-08-26 14:02:59 -0500
commit383b35fca746cbd64f3dc490f5dfb8153b696265 (patch)
tree9fed1db5c4a30f483e9384da00fe9f998d509a3c
parent25e9356bb9013dee27d6abffba769652e6acbbb4 (diff)
parentedca14c8a50e940e8d3be470d136cafa406dd596 (diff)
Merge "res_fax.c: Fix deadlock in fax_gateway_indicate_t38()."
-rw-r--r--res/res_fax.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/res/res_fax.c b/res/res_fax.c
index 94c512de3..5bbc896c8 100644
--- a/res/res_fax.c
+++ b/res/res_fax.c
@@ -3001,12 +3001,15 @@ static struct ast_frame *fax_gateway_detect_v21(struct fax_gateway *gateway, str
return f;
}
-static int fax_gateway_indicate_t38(struct ast_channel *chan, struct ast_channel *active, struct ast_control_t38_parameters *control_params)
+/*! \pre chan is locked on entry */
+static void fax_gateway_indicate_t38(struct ast_channel *chan, struct ast_channel *active, struct ast_control_t38_parameters *control_params)
{
if (active == chan) {
- return ast_indicate_data(chan, AST_CONTROL_T38_PARAMETERS, control_params, sizeof(*control_params));
+ ast_channel_unlock(chan);
+ ast_indicate_data(chan, AST_CONTROL_T38_PARAMETERS, control_params, sizeof(*control_params));
+ ast_channel_lock(chan);
} else {
- return ast_queue_control_data(chan, AST_CONTROL_T38_PARAMETERS, control_params, sizeof(*control_params));
+ ast_queue_control_data(chan, AST_CONTROL_T38_PARAMETERS, control_params, sizeof(*control_params));
}
}