[Asterisk-cvs] asterisk/channels chan_iax2.c,1.361,1.362

russell russell
Wed Oct 26 12:25:36 CDT 2005


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

Modified Files:
	chan_iax2.c 
Log Message:
use an enum instead of #define'd integers in a couple of places


Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.361
retrieving revision 1.362
diff -u -d -r1.361 -r1.362
--- chan_iax2.c	24 Oct 2005 20:12:05 -0000	1.361
+++ chan_iax2.c	26 Oct 2005 16:18:25 -0000	1.362
@@ -363,19 +363,23 @@
 	unsigned char *buf;
 };
 
-#define REG_STATE_UNREGISTERED	0
-#define REG_STATE_REGSENT	1
-#define REG_STATE_AUTHSENT 	2
-#define REG_STATE_REGISTERED 	3
-#define REG_STATE_REJECTED	4
-#define REG_STATE_TIMEOUT	5
-#define REG_STATE_NOAUTH	6
+enum iax_reg_state {
+	REG_STATE_UNREGISTERED = 0,
+	REG_STATE_REGSENT,
+	REG_STATE_AUTHSENT,
+	REG_STATE_REGISTERED,
+	REG_STATE_REJECTED,
+	REG_STATE_TIMEOUT,
+	REG_STATE_NOAUTH
+};
 
-#define TRANSFER_NONE		0
-#define TRANSFER_BEGIN		1
-#define TRANSFER_READY		2
-#define TRANSFER_RELEASED	3
-#define TRANSFER_PASSTHROUGH	4
+enum iax_transfer_state {
+	TRANSFER_NONE = 0,
+	TRANSFER_BEGIN,
+	TRANSFER_READY,
+	TRANSFER_RELEASED,
+	TRANSFER_PASSTHROUGH
+};
 
 struct iax2_registry {
 	struct sockaddr_in addr;		/* Who we connect to for registration purposes */
@@ -384,7 +388,7 @@
 	char random[80];
 	int expire;				/* Sched ID of expiration */
 	int refresh;				/* How often to refresh */
-	int regstate;
+	enum iax_reg_state regstate;
 	int messages;				/* Message count */
 	int callno;				/* Associated call number if applicable */
 	struct sockaddr_in us;			/* Who the server thinks we are */
@@ -541,7 +545,7 @@
 	unsigned int flags;
 
 	/* Transferring status */
-	int transferring;
+	enum iax_transfer_state transferring;
 	/* Transfer identifier */
 	int transferid;
 	/* Who we are IAX transfering to */




More information about the svn-commits mailing list