[asterisk-commits] russell: trunk r64427 - in /trunk: ./ res/res_features.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue May 15 12:57:03 MST 2007


Author: russell
Date: Tue May 15 14:57:02 2007
New Revision: 64427

URL: http://svn.digium.com/view/asterisk?view=rev&rev=64427
Log:
Merged revisions 64426 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r64426 | russell | 2007-05-15 14:52:18 -0500 (Tue, 15 May 2007) | 3 lines

Properly fix a problem that occurs when you set PARKINGEXTEN to an exten where
a call is already parked.  (issue #9723, patch by me)

........

Modified:
    trunk/   (props changed)
    trunk/res/res_features.c

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

Modified: trunk/res/res_features.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_features.c?view=diff&rev=64427&r1=64426&r2=64427
==============================================================================
--- trunk/res/res_features.c (original)
+++ trunk/res/res_features.c Tue May 15 14:57:02 2007
@@ -336,23 +336,6 @@
 		return AST_DEVICE_INUSE;
 }
 
-/*!
- * \brief Check to see if a parking space is in use
- * \return non-zero if in use, zero if not in use
- * \note Assumes parking_lock is locked
- */
-static int check_parking_space_inuse(int space)
-{
-	struct parkeduser *pu;
-
-	for (pu = parkinglot; pu; pu = pu->next) {
-		if (pu->parkingnum == space)
-			return 1;
-	}
-
-	return 0;
-}
-
 /*! \brief Park a call 
  	\note We put the user in the parking list, then wake up the parking thread to be sure it looks
 	after these channels too */
@@ -373,17 +356,13 @@
 	parkingexten = pbx_builtin_getvar_helper(chan, "PARKINGEXTEN");
 	if (!ast_strlen_zero(parkingexten)) {
 		if (ast_exists_extension(NULL, parking_con, parkingexten, 1, NULL)) {
+			ast_mutex_unlock(&parking_lock);
+			free(pu);
 			ast_log(LOG_WARNING, "Requested parking extension already exists: %s@%s\n", parkingexten, parking_con);
 			return 0;	/* Continue execution if possible */
 		}
 		ast_copy_string(pu->parkingexten, parkingexten, sizeof(pu->parkingexten));
 		x = atoi(parkingexten);
-		if (check_parking_space_inuse(x)) {
-			ast_mutex_unlock(&parking_lock);
-			free(pu);
-			ast_log(LOG_WARNING, "Requested parking space %d via PARKINGEXTEN, but it is in use!\n", x);
-			return -1;
-		}
 	} else {
 		/* Select parking space within range */
 		parking_range = parking_stop - parking_start+1;



More information about the asterisk-commits mailing list