[svn-commits] rmudgett: trunk r422663 - in /trunk: ./ channels/chan_iax2.c main/devicestate.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Sep 5 12:45:07 CDT 2014


Author: rmudgett
Date: Fri Sep  5 12:45:03 2014
New Revision: 422663

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=422663
Log:
devicestate.c: Minor tweaks

* In ast_state_chan2dev() use ARRAY_LEN() instead of a sentinel value in
chan2dev[].

* Fix some comments in chan_iax2.c.
........

Merged revisions 422661 from http://svn.asterisk.org/svn/asterisk/branches/13

Modified:
    trunk/   (props changed)
    trunk/channels/chan_iax2.c
    trunk/main/devicestate.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.

Modified: trunk/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=422663&r1=422662&r2=422663
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Fri Sep  5 12:45:03 2014
@@ -5036,7 +5036,7 @@
  * password field will be set to NULL.
  *
  * \note The dial string format is:
- *       [username[:password]@]peer[:port][/exten[@@context]][/options]
+ *       [username[:password]@]peer[:port][/exten[@context]][/options]
  */
 static void parse_dial_string(char *data, struct parsed_dial_string *pds)
 {
@@ -5069,9 +5069,10 @@
 	pds->peer = strsep(&data, ":");
 	pds->port = data;
 
-	/* check for a key name wrapped in [] in the secret position, if found,
-	   move it to the key field instead
-	*/
+	/*
+	 * Check for a key name wrapped in [] in the password position.
+	 * If found, move it to the key field instead.
+	 */
 	if (pds->password && (pds->password[0] == '[')) {
 		pds->key = ast_strip_quoted(pds->password, "[", "]");
 		pds->password = NULL;

Modified: trunk/main/devicestate.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/devicestate.c?view=diff&rev=422663&r1=422662&r2=422663
==============================================================================
--- trunk/main/devicestate.c (original)
+++ trunk/main/devicestate.c Fri Sep  5 12:45:03 2014
@@ -169,7 +169,7 @@
 	{ /* 5 AST_DEVICE_UNAVAILABLE */ "Unavailable", "UNAVAILABLE" }, /*!< Unavailable (not registered) */
 	{ /* 6 AST_DEVICE_RINGING */     "Ringing",     "RINGING"     }, /*!< Ring, ring, ring */
 	{ /* 7 AST_DEVICE_RINGINUSE */   "Ring+Inuse",  "RINGINUSE"   }, /*!< Ring and in use */
-	{ /* 8 AST_DEVICE_ONHOLD */      "On Hold",      "ONHOLD"      }, /*!< On Hold */
+	{ /* 8 AST_DEVICE_ONHOLD */      "On Hold",     "ONHOLD"      }, /*!< On Hold */
 };
 
 /*!\brief Mapping for channel states to device states */
@@ -187,7 +187,6 @@
 	{ AST_STATE_BUSY,            AST_DEVICE_BUSY },
 	{ AST_STATE_DIALING_OFFHOOK, AST_DEVICE_INUSE },
 	{ AST_STATE_PRERING,         AST_DEVICE_RINGING },
-	{ -100,                      -100 },
 };
 
 /*! \brief  A device state provider (not a channel) */
@@ -251,7 +250,7 @@
 {
 	int i;
 	chanstate &= 0xFFFF;
-	for (i = 0; chan2dev[i].chan != -100; i++) {
+	for (i = 0; i < ARRAY_LEN(chan2dev); i++) {
 		if (chan2dev[i].chan == chanstate) {
 			return chan2dev[i].dev;
 		}




More information about the svn-commits mailing list