diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-13 20:30:13 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-13 20:30:13 +0000 |
commit | bf19a71d3a0fcb818945a07b9d147c195f0560f5 (patch) | |
tree | a98a5ba8ab2bf6b04c333ce346eea76a35a0091c /res | |
parent | 07aef1fe20b99952ffb3ad656ed11beee108b5cb (diff) |
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 ...
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89250 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_features.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/res/res_features.c b/res/res_features.c index ca4f6c676..c29ff25c1 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; } |