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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Nov 13 14:30:14 CST 2007


Author: russell
Date: Tue Nov 13 14:30:13 2007
New Revision: 89250

URL: http://svn.digium.com/view/asterisk?view=rev&rev=89250
Log:
Update the ParkedCall application to grab the first available parked call if no
parked extension is provided as an argument.

(closes issue #10803)
Reported by: outtolunc
Patches: 
      res_features-parkedcall-any.diff4 uploaded by outtolunc (license 237)
	  - modified by me to work a bit differently ...

Modified:
    trunk/CHANGES
    trunk/res/res_features.c

Modified: trunk/CHANGES
URL: http://svn.digium.com/view/asterisk/trunk/CHANGES?view=diff&rev=89250&r1=89249&r2=89250
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Tue Nov 13 14:30:13 2007
@@ -255,6 +255,9 @@
      features.conf.  This means that features can be written a single time, and
      then mapped into groups of features for different key mappings or easier
      access control.
+  * Updated the ParkedCall application to allow you to not specify a parking
+     extension.  If you don't specify a parking space to pick up, it will grab
+     the first one available.
 
 Language Support Changes
 ------------------------

Modified: trunk/res/res_features.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_features.c?view=diff&rev=89250&r1=89249&r2=89250
==============================================================================
--- trunk/res/res_features.c (original)
+++ trunk/res/res_features.c Tue Nov 13 14:30:13 2007
@@ -138,7 +138,8 @@
 "Used to connect to a parked call.  This application is always\n"
 "registered internally and does not need to be explicitly added\n"
 "into the dialplan, although you should include the 'parkedcalls'\n"
-"context.\n";
+"context.  If no extension is provided, then the first available\n"
+"parked call will be acquired.\n";
 
 static char *parkcall = "Park";
 
@@ -2254,22 +2255,17 @@
 	struct ast_channel *peer=NULL;
 	struct parkeduser *pu;
 	struct ast_context *con;
-
-	int park;
+	int park = 0;
 	struct ast_bridge_config config;
 
-	if (!data) {
-		ast_log(LOG_WARNING, "Parkedcall requires an argument (extension number)\n");
-		return -1;
-	}
-	
 	u = ast_module_user_add(chan);
 
-	park = atoi((char *)data);
+	if (park)
+		park = atoi((char *)data);
 
 	AST_LIST_LOCK(&parkinglot);
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&parkinglot, pu, list) {
-		if (pu->parkingnum == park) {
+		if (!data || pu->parkingnum == park) {
 			AST_LIST_REMOVE_CURRENT(list);
 			break;
 		}




More information about the asterisk-commits mailing list