diff --git a/CHANGES b/CHANGES index bde8bb60a63a75f24277b3340d523948dd93fa05..1ec628d29a0e5b8c748b696a0afa54393af6de8c 100644 --- a/CHANGES +++ b/CHANGES @@ -255,6 +255,9 @@ Call Features (res_features) Changes 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 ------------------------ diff --git a/res/res_features.c b/res/res_features.c index ca4f6c676a1187b85d1df2974eecf9549672f8d2..c29ff25c184758d25ba1fddd52ea24aa8ce786a0 100644 --- a/res/res_features.c +++ b/res/res_features.c @@ -138,7 +138,8 @@ static char *descrip = "ParkedCall(exten): " "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 @@ static int park_exec(struct ast_channel *chan, void *data) 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; }