[svn-commits] rizzo: branch rizzo/astobj2 r47913 - /team/rizzo/astobj2/channels/chan_sip.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed Nov 22 01:38:49 MST 2006


Author: rizzo
Date: Wed Nov 22 02:38:47 2006
New Revision: 47913

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47913
Log:
- move the definitions of enum sipregistrystate next to the
  sip_registry, as they are only used there;
- fix a comment on the creation of a sip_registry entry;
- in sip_register, explicitly initialize regstate so we
  don't rely on REG_STATE_UNREGISTERED = 0 (this is an
  undocumented assumption and an easy one to violate)


Modified:
    team/rizzo/astobj2/channels/chan_sip.c

Modified: team/rizzo/astobj2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/astobj2/channels/chan_sip.c?view=diff&rev=47913&r1=47912&r2=47913
==============================================================================
--- team/rizzo/astobj2/channels/chan_sip.c (original)
+++ team/rizzo/astobj2/channels/chan_sip.c Wed Nov 22 02:38:47 2006
@@ -342,18 +342,6 @@
 	AUTH_NOT_FOUND = -3,	/* returned by register_verify */
 	AUTH_FAKE_AUTH = -4,
 	AUTH_UNKNOWN_DOMAIN = -5,
-};
-
-/*! \brief 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 */
 };
 
 enum can_create_dialog {
@@ -1200,10 +1188,21 @@
 };
 
 
+/*! \brief 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 */
+};
 
 /*!
  * Registrations with other SIP proxies.
- * Created by sip_registry(), the entry is linked in the 'regl' list,
+ * Created by sip_register(), the entry is linked in the 'regl' list,
  * and never deleted.
  * The entry always has a pending timeout, either waiting for an ACK to
  * the REGISTER message (in which case we have to retransmit the request),
@@ -4786,6 +4785,7 @@
 		ast_string_field_set(reg, authuser, authuser);
 	if (secret)
 		ast_string_field_set(reg, secret, secret);
+	reg->regstate = REG_STATE_UNREGISTERED;
 	reg->expire = -1;
 	reg->expiry = default_expiry;
 	reg->timeout =  -1;



More information about the svn-commits mailing list