[Asterisk-cvs] asterisk/include/asterisk pbx.h,1.50,1.51

kpfleming kpfleming
Mon Aug 29 19:52:10 CDT 2005


Update of /usr/cvsroot/asterisk/include/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv14716/include/asterisk

Modified Files:
	pbx.h 
Log Message:
massive upgrade to SUBSCRIBE, device state and messaging support (issue #3644)


Index: pbx.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/pbx.h,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- pbx.h	27 Aug 2005 23:55:14 -0000	1.50
+++ pbx.h	29 Aug 2005 23:53:29 -0000	1.51
@@ -42,11 +42,26 @@
 	/*! No device INUSE or BUSY  */
 	AST_EXTENSION_NOT_INUSE = 0,
 	/*! One or more devices INUSE */
-	AST_EXTENSION_INUSE = 1,
+	AST_EXTENSION_INUSE = 1 << 0,
 	/*! All devices BUSY */
-	AST_EXTENSION_BUSY = 2,
+	AST_EXTENSION_BUSY = 1 << 1,
 	/*! All devices UNAVAILABLE/UNREGISTERED */
-	AST_EXTENSION_UNAVAILABLE = 3,
+	AST_EXTENSION_UNAVAILABLE = 1 << 2,
+	/*! All devices RINGING */
+	AST_EXTENSION_RINGING = 1 << 3,
+};
+
+
+static const struct cfextension_states {
+	int extension_state;
+	const char * const text;
+} extension_states[] = {
+	{ AST_EXTENSION_NOT_INUSE,                     "Idle" },
+	{ AST_EXTENSION_INUSE,                         "InUse" },
+	{ AST_EXTENSION_BUSY,                          "Busy" },
+	{ AST_EXTENSION_UNAVAILABLE,                   "Unavailable" },
+	{ AST_EXTENSION_RINGING,                       "Ringing" },
+	{ AST_EXTENSION_INUSE | AST_EXTENSION_RINGING, "InUse&Ringing" }
 };
 
 struct ast_context;
@@ -257,6 +272,13 @@
  */
 int ast_extension_state(struct ast_channel *c, char *context, char *exten);
 
+/*! Return string of the state of an extension */
+/*!
+ * \param extension_state is the numerical state delivered by ast_extension_state
+ * Returns the state of an extension as string
+ */
+const char *ast_extension_state2str(int extension_state);
+
 /*! Registers a state change callback */
 /*!
  * \param context which context to look in




More information about the svn-commits mailing list