[asterisk-commits] branch oej/siptransfer r16707 - in /team/oej/siptransfer: ./ channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Mar 31 09:04:43 MST 2006


Author: oej
Date: Fri Mar 31 10:04:42 2006
New Revision: 16707

URL: http://svn.digium.com/view/asterisk?rev=16707&view=rev
Log:
Update

Modified:
    team/oej/siptransfer/   (props changed)
    team/oej/siptransfer/channels/chan_sip.c

Propchange: team/oej/siptransfer/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Mar 31 10:04:42 2006
@@ -1,1 +1,1 @@
-/trunk:1-16689
+/trunk:1-16706

Modified: team/oej/siptransfer/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/channels/chan_sip.c?rev=16707&r1=16706&r2=16707&view=diff
==============================================================================
--- team/oej/siptransfer/channels/chan_sip.c (original)
+++ team/oej/siptransfer/channels/chan_sip.c Fri Mar 31 10:04:42 2006
@@ -234,6 +234,19 @@
 	PROXY_AUTH,
 	WWW_AUTH,
 };
+
+/* States for outbound registrations (with register= lines in sip.conf */
+enum sipregistrystate {
+	REG_STATE_UNREGISTERED = 0,	/*!< We are not registred */
+	REG_STATE_REGSENT,	/*!< Registration request sent */
+	REG_STATE_AUTHSENT,	/*!< We have tried to authenticate */
+	REG_STATE_REGISTERED,	/*!< Registred and done */
+	REG_STATE_REJECTED,	/*!< Registration rejected */
+	REG_STATE_TIMEOUT,	/*!< Registration timed out */
+	REG_STATE_NOAUTH,	/*!< We have no accepted credentials */
+	REG_STATE_FAILED,	/*!< Registration failed after several tries */
+};
+
 
 /*! XXX Note that sip_methods[i].id == i must hold or the code breaks */
 static const struct  cfsip_methods { 
@@ -582,9 +595,9 @@
 /* NAT settings */
 #define SIP_NAT			(3 << 18)	/*!< four settings, uses two bits */
 #define SIP_NAT_NEVER		(0 << 18)	/*!< No nat support */
-#define SIP_NAT_RFC3581		(1 << 18)
-#define SIP_NAT_ROUTE		(2 << 18)
-#define SIP_NAT_ALWAYS		(3 << 18)
+#define SIP_NAT_RFC3581		(1 << 18)	/*!< NAT RFC3581 */
+#define SIP_NAT_ROUTE		(2 << 18)	/*!< NAT Only ROUTE */
+#define SIP_NAT_ALWAYS		(3 << 18)	/*!< NAT Both ROUTE and RFC3581 */
 /* re-INVITE related settings */
 #define SIP_REINVITE		(3 << 20)	/*!< two bits used */
 #define SIP_CAN_REINVITE	(1 << 20)	/*!< allow peers to be reinvited to send media directly p2p */
@@ -603,14 +616,10 @@
 #define SIP_OSPAUTH_GATEWAY	(1 << 26)
 #define SIP_OSPAUTH_PROXY	(2 << 26)
 #define SIP_OSPAUTH_EXCLUSIVE	(3 << 26)
-/* Call states */
-#define SIP_CALL_ONHOLD		(1 << 28)	 
-#define SIP_CALL_LIMIT		(1 << 29)
-
-/* Remote Party-ID Support */
-#define SIP_SENDRPID		(1 << 30)
-/* Did this connection increment the counter of in-use calls? */
-#define SIP_INC_COUNT		(1 << 31)
+#define SIP_CALL_ONHOLD		(1 << 28)	/*!< Call states */
+#define SIP_CALL_LIMIT		(1 << 29)	/*!< Call limit enforced for this call */
+#define SIP_SENDRPID		(1 << 30)	/*!< Remote Party-ID Support */
+#define SIP_INC_COUNT		(1 << 31)	/*!< Did this connection increment the counter of in-use calls? */
 
 /* RTP NAT Support */
 /* #define RTP_FORCE_NAT	(1 << 31) */
@@ -916,16 +925,6 @@
 };
 
 
-/* States for outbound registrations (with register= lines in sip.conf */
-#define REG_STATE_UNREGISTERED		0	/*!< We are not registred */
-#define REG_STATE_REGSENT		1	/*!< Registration request sent */
-#define REG_STATE_AUTHSENT		2	/*!< We have tried to authenticate */
-#define REG_STATE_REGISTERED		3	/*!< Registred and done */
-#define REG_STATE_REJECTED		4	/*!< Registration rejected */
-#define REG_STATE_TIMEOUT		5	/*!< Registration timed out */
-#define REG_STATE_NOAUTH		6	/*!< We have no accepted credentials */
-#define REG_STATE_FAILED		7	/*!< Registration failed after several tries */
-
 
 /*! \brief Registrations with other SIP proxies */
 struct sip_registry {
@@ -951,7 +950,7 @@
 	int timeout; 			/*!< sched id of sip_reg_timeout */
 	int refresh;			/*!< How often to refresh */
 	struct sip_pvt *call;		/*!< create a sip_pvt structure for each outbound "registration dialog" in progress */
-	int regstate;			/*!< Registration state (see above) */
+	enum sipregistrystate regstate;	/*!< Registration state (see above) */
 	int callid_valid;		/*!< 0 means we haven't chosen callid for this registry yet. */
 	unsigned int ocseq;		/*!< Sequence number we got to for REGISTERs for this registry */
 	struct sockaddr_in us;		/*!< Who the server thinks we are */
@@ -5749,7 +5748,7 @@
 }
 
 /*! \build Convert registration state status to string */
-static char *regstate2str(int regstate)
+static char *regstate2str(enum sipregistrystate regstate)
 {
 	switch(regstate) {
 	case REG_STATE_FAILED:
@@ -6028,7 +6027,7 @@
 		ast_verbose("REGISTER %d headers, %d lines\n", p->initreq.headers, p->initreq.lines);
 	}
 	determine_firstline_parts(&p->initreq);
-	r->regstate=auth?REG_STATE_AUTHSENT:REG_STATE_REGSENT;
+	r->regstate = auth ? REG_STATE_AUTHSENT : REG_STATE_REGSENT;
 	r->regattempts++;	/* Another attempt */
 	if (option_debug > 3)
 		ast_verbose("REGISTER attempt %d to %s@%s\n", r->regattempts, r->username, r->hostname);
@@ -10432,7 +10431,7 @@
 			return 0;
 		}
 
-		r->regstate=REG_STATE_REGISTERED;
+		r->regstate = REG_STATE_REGISTERED;
 		manager_event(EVENT_FLAG_SYSTEM, "Registry", "Channel: SIP\r\nDomain: %s\r\nStatus: %s\r\n", r->hostname, regstate2str(r->regstate));
 		r->regattempts = 0;
 		ast_log(LOG_DEBUG, "Registration successful\n");



More information about the asterisk-commits mailing list