[asterisk-commits] channel api: Create is t38 active accessor functions. (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 29 18:00:19 CST 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: channel api: Create is_t38_active accessor functions.
......................................................................


channel api: Create is_t38_active accessor functions.

ASTERISK-25582

Change-Id: I69451920b122de7ee18d15bb231c80ea7067a22b
---
M include/asterisk/channel.h
M main/channel_internal_api.c
2 files changed, 67 insertions(+), 3 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, approved
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index fe669ef..4cc210d 100644
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -1616,6 +1616,42 @@
 void ast_channel_set_unbridged_nolock(struct ast_channel *chan, int value);
 
 /*!
+ * \brief This function will check if T.38 is active on the channel.
+ *
+ * \param chan Channel on which to check the unbridge_eval flag
+ *
+ * \return Returns 0 if the flag is down or 1 if the flag is up.
+ */
+int ast_channel_is_t38_active(struct ast_channel *chan);
+
+/*!
+ * \brief ast_channel_is_t38_active variant. Use this if the channel
+ *         is already locked prior to calling.
+ *
+ * \param chan Channel on which to check the is_t38_active flag
+ *
+ * \return Returns 0 if the flag is down or 1 if the flag is up.
+ */
+int ast_channel_is_t38_active_nolock(struct ast_channel *chan);
+
+/*!
+ * \brief Sets the is_t38_active flag
+ *
+ * \param chan Which channel is having its is_t38_active value set
+ * \param is_t38_active Non-zero if T.38 is active
+ */
+void ast_channel_set_is_t38_active(struct ast_channel *chan, int is_t38_active);
+
+/*!
+ * \brief Variant of ast_channel_set_is_t38_active. Use this if the channel
+ *         is already locked prior to calling.
+ *
+ * \param chan Which channel is having its is_t38_active value set
+ * \param is_t38_active Non-zero if T.38 is active
+ */
+void ast_channel_set_is_t38_active_nolock(struct ast_channel *chan, int is_t38_active);
+
+/*!
  * \brief Lock the given channel, then request softhangup on the channel with the given causecode
  * \param chan channel on which to hang up
  * \param causecode cause code to use (Zero if don't use cause code)
diff --git a/main/channel_internal_api.c b/main/channel_internal_api.c
index db5f3c0..51d49c2 100644
--- a/main/channel_internal_api.c
+++ b/main/channel_internal_api.c
@@ -173,8 +173,6 @@
 							 *   See \arg \ref AstFileDesc */
 	int softhangup;				/*!< Whether or not we have been hung up...  Do not set this value
 							 *   directly, use ast_softhangup() */
-	int unbridged;              /*!< If non-zero, the bridge core needs to re-evaluate the current
-	                                 bridging technology which is in use by this channel's bridge. */
 	int fdno;					/*!< Which fd had an event detected on */
 	int streamid;					/*!< For streaming playback, the schedule ID */
 	int vstreamid;					/*!< For streaming video playback, the schedule ID */
@@ -216,6 +214,9 @@
 	char exten[AST_MAX_EXTENSION];			/*!< Dialplan: Current extension number */
 	char macrocontext[AST_MAX_CONTEXT];		/*!< Macro: Current non-macro context. See app_macro.c */
 	char macroexten[AST_MAX_EXTENSION];		/*!< Macro: Current non-macro extension. See app_macro.c */
+	char unbridged;							/*!< non-zero if the bridge core needs to re-evaluate the current
+											 bridging technology which is in use by this channel's bridge. */
+	char is_t38_active;						/*!< non-zero if T.38 is active on this channel. */
 	char dtmf_digit_to_emulate;			/*!< Digit being emulated */
 	char sending_dtmf_digit;			/*!< Digit this channel is currently sending out. (zero if not sending) */
 	struct timeval sending_dtmf_tv;		/*!< The time this channel started sending the current digit. (Invalid if sending_dtmf_digit is zero.) */
@@ -1152,7 +1153,7 @@
 
 void ast_channel_set_unbridged_nolock(struct ast_channel *chan, int value)
 {
-	chan->unbridged = value;
+	chan->unbridged = !!value;
 	ast_queue_frame(chan, &ast_null_frame);
 }
 
@@ -1163,6 +1164,33 @@
 	ast_channel_unlock(chan);
 }
 
+int ast_channel_is_t38_active_nolock(struct ast_channel *chan)
+{
+	return chan->is_t38_active;
+}
+
+int ast_channel_is_t38_active(struct ast_channel *chan)
+{
+	int res;
+
+	ast_channel_lock(chan);
+	res = ast_channel_is_t38_active_nolock(chan);
+	ast_channel_unlock(chan);
+	return res;
+}
+
+void ast_channel_set_is_t38_active_nolock(struct ast_channel *chan, int is_t38_active)
+{
+	chan->is_t38_active = !!is_t38_active;
+}
+
+void ast_channel_set_is_t38_active(struct ast_channel *chan, int is_t38_active)
+{
+	ast_channel_lock(chan);
+	ast_channel_set_is_t38_active_nolock(chan, is_t38_active);
+	ast_channel_unlock(chan);
+}
+
 void ast_channel_callid_cleanup(struct ast_channel *chan)
 {
 	if (chan->callid) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I69451920b122de7ee18d15bb231c80ea7067a22b
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-commits mailing list