summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2016-08-23 11:16:04 -0500
committerRichard Mudgett <rmudgett@digium.com>2016-08-25 17:13:52 -0500
commit50b2aa506fed1b28cf8b0c9f76080622097383e2 (patch)
tree40b7085c140cfaca755300a72159f0d72ca8900e /res
parent038cbc02152d4688293cadeaa17d65746d59fa44 (diff)
res_fax.c: Add chan locked precondition comments.
Change-Id: Ic10ae434536bbf7fb7055d6ab36cc50b8748a4e7
Diffstat (limited to 'res')
-rw-r--r--res/res_fax.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/res/res_fax.c b/res/res_fax.c
index be88b585e..f743dbbf1 100644
--- a/res/res_fax.c
+++ b/res/res_fax.c
@@ -2880,11 +2880,17 @@ static struct fax_gateway *fax_gateway_new(struct ast_channel *chan, struct ast_
return gateway;
}
-/*! \brief Create a fax session and start T.30<->T.38 gateway mode
+/*!
+ * \brief Create a fax session and start T.30<->T.38 gateway mode
+ *
* \param gateway a fax gateway object
* \param details fax session details
* \param chan active channel
- * \return 0 on error 1 on success*/
+ *
+ * \pre chan is locked on entry
+ *
+ * \return 0 on error 1 on success
+ */
static int fax_gateway_start(struct fax_gateway *gateway, struct ast_fax_session_details *details, struct ast_channel *chan)
{
struct ast_fax_session *s;
@@ -2928,6 +2934,7 @@ static int fax_gateway_start(struct fax_gateway *gateway, struct ast_fax_session
return 0;
}
+/*! \pre chan is locked on entry */
static struct ast_frame *fax_gateway_request_t38(struct fax_gateway *gateway, struct ast_channel *chan, struct ast_frame *f)
{
struct ast_frame *fp;
@@ -2966,6 +2973,7 @@ static struct ast_frame *fax_gateway_request_t38(struct fax_gateway *gateway, st
return fp;
}
+/*! \pre chan is locked on entry */
static struct ast_frame *fax_gateway_detect_v21(struct fax_gateway *gateway, struct ast_channel *chan, struct ast_channel *peer, struct ast_channel *active, struct ast_frame *f)
{
struct ast_channel *other = (active == chan) ? peer : chan;
@@ -3002,12 +3010,17 @@ static int fax_gateway_indicate_t38(struct ast_channel *chan, struct ast_channel
}
}
-/*! \brief T38 Gateway Negotiate t38 parameters
+/*!
+ * \brief T38 Gateway Negotiate t38 parameters
+ *
* \param gateway gateway object
* \param chan channel running the gateway
* \param peer channel im bridged too
* \param active channel the frame originated on
* \param f the control frame to process
+ *
+ * \pre chan is locked on entry
+ *
* \return processed control frame or null frame
*/
static struct ast_frame *fax_gateway_detect_t38(struct fax_gateway *gateway, struct ast_channel *chan, struct ast_channel *peer, struct ast_channel *active, struct ast_frame *f)
@@ -3250,7 +3263,8 @@ static void fax_gateway_framehook_destroy(void *data)
ao2_ref(gateway, -1);
}
-/*! \brief T.30<->T.38 gateway framehook.
+/*!
+ * \brief T.30<->T.38 gateway framehook.
*
* Intercept packets on bridged channels and determine if a T.38 gateway is
* required. If a gateway is required, start a gateway and handle T.38
@@ -3261,6 +3275,8 @@ static void fax_gateway_framehook_destroy(void *data)
* \param event framehook event
* \param data framehook data (struct fax_gateway *)
*
+ * \pre chan is locked on entry
+ *
* \return processed frame or NULL when f is NULL or a null frame
*/
static struct ast_frame *fax_gateway_framehook(struct ast_channel *chan, struct ast_frame *f, enum ast_framehook_event event, void *data)
@@ -3491,9 +3507,9 @@ static int fax_gateway_attach(struct ast_channel *chan, struct ast_fax_session_d
.disable_inheritance = 1, /* Masquerade inheritance is handled through the datastore fixup */
};
- if (global_fax_debug) {
- details->option.debug = AST_FAX_OPTFLAG_TRUE;
- }
+ if (global_fax_debug) {
+ details->option.debug = AST_FAX_OPTFLAG_TRUE;
+ }
ast_string_field_set(details, result, "SUCCESS");
ast_string_field_set(details, resultstr, "gateway operation started successfully");