Summary:ASTERISK-05955: [branch] Enhance parking to allow multiple parking lots
Reporter:Olle Johansson (oej)Labels:
Date Opened:2006-01-02 13:52:10.000-0600Date Closed:2008-04-21 18:37:45
Versions:Frequency of
Environment:Attachments:( 0) astdebug
Description:I've added multiple parking lots to res_features.

The current default configuration sets up a "default" parking lot. Additional sections in features.conf will configure additional parking lots.

Setting a channel variable PARKINGLOT will make a channel use a secondary parking lot. This can be set in the channel configuration for the device or within the dial plan.

The CLI command show features will list all parking lots.


All parking lots currently use the same extension for parking.

Need help testing this!

The test code can be downloaded from this branch


You can view it at

Comments:By: Olle Johansson (oej) 2006-01-02 13:54:44.000-0600

All changes are in res_features.c and the features.conf.sample

By: Olle Johansson (oej) 2006-01-09 02:35:12.000-0600

Updated to current svn trunk.

Please test!

By: Olle Johansson (oej) 2006-01-18 15:34:19.000-0600

Needs some thinking, there's a problem in this architecture... It works, but has some architecture flaws.. :-)

By: Olle Johansson (oej) 2006-01-19 14:57:50.000-0600

Fixed the issue by implementing a configuration option in sip.conf and iax.conf. Setting a channel variable will override any settings in configs.

Now, calls will be parked in the transferers parking lot.

By: Olle Johansson (oej) 2006-03-08 14:49:28.000-0600

The wonders of community feedback. Seems like I am the only one interested in this feature :-)

By: Olle Johansson (oej) 2006-03-08 14:50:11.000-0600

btw: Included in test-this-branch for testing

By: Olle Johansson (oej) 2006-03-29 11:35:25.000-0600

Updated to stringfields in the ast_channel structure.

By: Moises Silva (moy) 2006-03-29 14:02:19.000-0600

im interested :) however i still dont have the time to test it

keep the hard work !


By: sohosys (sohosys) 2006-04-27 10:59:51

oej - any feedback on this that has not been posted here, I too am very interested in this feature, but share your concern that it appears not many others are. Is there a patch that can be run against current release or does it require SVN trunk?

The problem with testing such a feature is that the environments that can really test it are either hard to create in a lab, or are production environments that will not tolerate the possbility of a significant bug...

if there was at least some feedback that it had been tested in a small environment, and there was a patch that will work with a current "release" I could test it on one of our multi-tennant servers.

By: opsys (opsys) 2006-04-29 00:43:56

Olle, I have tried and is working for me but I have a few comments.

COuld we make the ParkedCall and Park accept arguments for LOT. IE

700,1,Park(red) or Idealy, _7XX,1,Park(${EXTEN}@red)


Otherwise it is working for me in a multi-company setup.

By: Andrew Lindh (andrew) 2006-05-01 10:17:42

How can I generate a patch to add to a 1.2 system so I can run this?
I have a good system, but it's not trunk, just the 1.2 branch....

Is there a simple SVN command to generate a diff between your version and trunk to generate a diff patch to fix an apply to 1.2?

By: Serge Vecher (serge-v) 2006-05-04 12:55:10

andrew, Olle actually has two branches:

1) http://svn.digium.com/view/asterisk/team/oej/multiparking/
2) http://svn.digium.com/view/asterisk/team/oej/multiparking-trunk

So, it seems that the first one is based on 1.2.

Please try it out and provide much needed feedback!

By: dimitripietro (dimitripietro) 2006-05-17 22:59:27

I'm gonna start doing some test too. Anything specific you would like me test ?

-- I got an error compiling it : make: *** Pas de règle pour fabriquer la cible « configure », nécessaire pour « config.status ». Arrêt.

Anything special I must do ?

By: David L. West (dlwest) 2006-05-22 12:29:07

Trying to compile the code here:


And when I run MAKE it compiled a bunch of files and then started asterisk CLI. What, if anything, am I supposed to do then?

By: Richard Miller (ulogic) 2006-07-13 15:13:26

I have downloaded the latest source from this branch as I am interested in using this feature. I can't get it build completely.  In res_features.c, there are some obvious problems. At the top of the file, parkedplay is defined twice, and that was easy enough to fix. In 4 different functions, parking_con is referenced. In the original code, parking_con is a static character string that in scope for the entire file. In the multiparking branch, parking_con is a member of the ast_parkinglot structure.  The code in those 4 functions does not have a pointer reference such as in default_parkinglot->parking_con.  I have looked at the source in the metermaid branch which does have the pointer reference, but I can't get that version to compile either.  I could spend the time fixing the code in this branch, but it looks like it would be a duplication of effort.

I have plenty of programming experience, but none with the concurrent subversion method of distributed development.  I realize that new branches have beta version code and are likely to contain bugs, but it common practice to commit code that won't even cleanly compile?  Should I fix the code in this branch, or pick up the code in the metermaid branch and try to correct the other problems there.  Please point me in the right direction.

By: Serge Vecher (serge-v) 2006-07-13 15:45:03

Looks like the automerge process that keeps a development branch in sync with the main trunk has encountered a conflict. Usually such conflicts are resolved fairly quickly, but oej is very busy ATM, with impending 1.4 branch release and all. Please monitor the commit list http://lists.digium.com/pipermail/svn-commits/2006-July/date.html if you are interested in finding out when he brings it up to current status. Thanks!

By: Olle Johansson (oej) 2006-07-13 15:53:07

Yes, the branches are killing me here with problems with the external resources. I think I have three branches and still can't get it to work properly... Will try again after this week's SIP master class.

By: Vadim Berezniker (kryptolus) 2006-08-08 13:10:17

AST_LIST_TRAVERSE(&parkinglots, curlot, list) {
   pu = curlot->occupiedlots;

It doesn't seem correct to clear the fd set on every iteration over the parking lots. This will cause you to miss fds and in the worst case, nothing will get done at all.
The code in do_parking_thread probably needs to be refactored as well.

By: Sergio Serrano (srsergio) 2006-10-20 07:05:45

I try http://svn.digium.com/view/asterisk/team/oej/multiparking/  res_features.c for SVN-tag- No problem when I compile and my features.conf is the next:
parkext => 500
parkpos => 520-530
context => parkedcalls
parkingtime => 45    

automon => *1
atxfer => *2


context => otro
parkpos => 531-540
;findslot => next

I used Park(otro) but nothing occurs. All calls are parked in default parkinglot.
It's sure that I made some errors. Any idea?

By: Sergio Serrano (srsergio) 2006-10-26 04:42:39

I answer myself. The problem was that 1.2 svn version hasn't CHANNEL function.

By: jmls (jmls) 2006-11-18 14:39:47.000-0600

ping: so where are we with this ?

By: Blake van Eekeren (blake) 2006-12-21 15:47:13.000-0600

ping: Is anyone working on this?

By: Olle Johansson (oej) 2007-02-18 08:09:22.000-0600

updated branch today.

By: Serge Vecher (serge-v) 2007-02-19 12:10:43.000-0600

please report your test results!

By: Blake van Eekeren (blake) 2007-02-20 11:11:17.000-0600

Compiled without issue... Working on testing right now... Will post shortly...

By: Blake van Eekeren (blake) 2007-02-20 12:59:09.000-0600

Debug here: http://bugs.digium.com/file_download.php?file_id=13151&type=bug

Reload Error:

*** DEFAULT FEATURES FILE *** features.conf
parkext => 700              
parkpos => 701-720
context => parkedcalls

;context => edvinapark
;parkpos => 800-850
;findslot => next

************* ISSUING RELOAD COMMAND *******************
Asterisk Ready.
*CLI> reload
 == Parsing '/etc/asterisk/cdr.conf': Found
[Feb 20 09:00:30] NOTICE[7160]: cdr.c:1098 do_reload: CDR simple logging enabled.
 == Parsing '/etc/asterisk/dnsmgr.conf': Found
 == Parsing '/etc/asterisk/extconfig.conf': Found
 == Parsing '/etc/asterisk/enum.conf': Found
 == Parsing '/etc/asterisk/manager.conf': Found
 == Parsing '/etc/asterisk/rtp.conf': Found
 == RTP Allocating from port range 10000 -> 20000
 == Parsing '/etc/asterisk/http.conf': Found
   -- Reloading module 'res_musiconhold.so' (Music On Hold Resource)
 == Parsing '/etc/asterisk/musiconhold.conf': Found
   -- Reloading module 'res_adsi.so' (ADSI Resource)
 == Parsing '/etc/asterisk/adsi.conf': Found
   -- Reloading module 'res_crypto.so' (Cryptographic Digital Signatures)
   -- Reloading module 'res_features.so' (Call Features Resource)
 == Parsing '/etc/asterisk/features.conf': Found
   -- Added extension '700' priority 1 to parkedcalls

After the reload is issued the terminal locks up indefinitely (no change after 3 minutes)... Subsequent commands are futile as I must kill * in order to regain control of the term...  Individual reloads of sip/iax/extensions files work without a hitch... Obviously some sort of error parsing the features.conf file... I have tried to run with all parking contexts commented out yet the same result occurs...


By: Olle Johansson (oej) 2007-02-21 02:38:30.000-0600

Found a bug yesterday. Please run "svn update" and test again. THanks!

By: Afshin Mashayekhi (afshin) 2007-03-28 21:06:29

I'm really interested in this functionality,
I've tried to merge this feature with asterisk 1.4.2 and add this multiparking to it. it wasn't too bad but the problem is when I parke the call I can NOT get it back.
   -- Executing [1@cpm-phones:1] ParkedCall("SIP/CPM-302-098ad360", "1") in new stack
   -- <SIP/CPM-302-098ad360> Playing 'pbx-invalidpark' (language 'en')                                                                    

I've tried the SVN version separately but I got the same error.
include => parked_cpm-phones
switch => Realtime

parkext => 0
parkpos => 1-20
context => parkedcalls
parkingtime => 120

context => parked_cpm-phones
parkpos => 1-5
;findslot => next

AND I'm setting PARKINGLOT=parkinglot_cpm-phones before I dial.

By: Afshin Mashayekhi (afshin) 2007-05-07 02:50:56

I managed to get it working with setting parkinglots on dial. but after timeout reached when the call should dial back to the extension who parked the call, it does not happen...

exten => 4011,1,Set(PARKINGLOT=parkinglot_cpm-phones)
exten => 4011,n,NoCDR()
exten => 4011,n,Dial(LOCAL/304@cpm-phones,10,Tt)
exten => 4011,n,Hangup

exten => _X,1,NoOp(pickup call ${EXTEN})
exten => _X,1,NoCDR()
exten => _X,n,Set(PARKINGLOT=parkinglot_cpm-phones)
exten => _X,n,ParkedCall(${EXTEN})

Also there is another minor problem for parking positions:
it keeps increasing until it loops back itself, even when there is no more parked call.
park first call
prk pos: 1
pickup first call

park second call
prk pos: 2 rather than 1
pickup second call

By: Afshin Mashayekhi (afshin) 2007-05-07 19:06:25

There is also the problem of the DTMF not working after you pickup the call.
I'm pretty sure this is related to bug ASTERISK-8564

Also if you accidently set PARKINGLOT wrong it will make asterisk segfault rather than gracefully handling it

I think this can be easily fixed by adding some checking within

static const char *findparkinglotname(struct ast_channel *chan)

In which it should check if the parkinglot matches any that have been defined if not assign the default parkinglot.

Thus stopping the problem of a segfault when you try to get a parkinglot which does not exist when it is called from within
static int park_exec_full(struct ast_channel *chan, void *data, struct ast_parkinglot *parkinglot)

I have time to test any new versions of this multiparking lot feature

By: Afshin Mashayekhi (afshin) 2007-05-09 18:47:05


By: Olle Johansson (oej) 2007-05-10 01:35:59

This is not high on my priority list right now, but I will look into it when I have some free time. Thanks for the feedback!

By: german aracil boned (tecnoxarxa) 2007-09-27 08:55:06

I'm really very interested in this functionality

I merged this to asterisk 1.4.10, but if I press ASTERISK-68 for park any call, always park to default context.

I think the best for make this option is with current dialplan context and automatic.

If you park from context [section1] in extensions.conf, you park to section1 park slot. And when you recover call, res_features.c search for current context and parkedcall number send from user.

I think work for this feature.

By: german aracil boned (tecnoxarxa) 2007-09-27 18:51:43


I have a good change for parkedcalls manager, but in version. Parkcalls manager have automatic parking by context when call to park() function, it add context for park. Only users of this context, can get a parkedcall.

sv3*CLI> show parkedcalls
Contexts: pbx1, default,
Num        Channel (Context         Extension    Pri ) Timeout
800         SIP/Tecnoxarxa4-b6d0e6f0 (pbx1                    1   )    160s
800         SIP/trunk_1-b6d20190 (default                     1   )    177s
2 parked calls.

Now, context is add to park. Only use one lot and config definition for all. I dont need change features.conf file.

If user from context default, get a parkedcall 800, do not get parked call from 800@pbx1 context, don't see it. Only can get from her context.

I think this is a very good option for parkcalls. Easy to conf, easy to manager. And automatic adjustament for users.

Only, you can't put extensions in context where parkcalls range get extensions. But this is not a problem. I have range of extensions from 800 to 900 for parking calls. Only need no use this range for dialplan in all contexts.

I can put this option to trunk version only, if this is a good idea for all.

patch: http://bugs.digium.com/view.php?id=10836


By: VladimirB (vladb) 2007-11-27 15:47:16.000-0600

I just tried last patch from http://bugs.digium.com/bug_view_advanced_page.php?bug_id=10836 on 1.4.14 and it seams to be working using park() to do parking.
But always after call is picked up by dialing parked ext (ex 701 ) I get a warning:
[Nov 27 14:19:09] WARNING[22950]: res_features.c:1933 park_exec: Whoa, failed to remove the extension !
this is the 3’d warning you can find in res_features.c

By: yema (yem) 2007-12-19 14:36:11.000-0600

I'm trying to use http://svn.digium.com/svn/asterisk/team/oej/multiparking/res/res_features.c and integrate it in 1.4.16, although I get a compile error.
Is there a magic trick ?
I'm definitely interested in testing that feature as many people are asking for it.

I get:

  [CC] res_features.c -> res_features.o
res_features.c: In function 'findparkinglotname':
res_features.c:344: error: 'struct ast_channel' has no member named 'parkinglot'
res_features.c:345: error: 'struct ast_channel' has no member named 'parkinglot'
res_features.c: At top level:
res_features.c:368: error: return type is an incomplete type
res_features.c: In function 'metermaidstate':
res_features.c:369: error: variable 'res' has initializer but incomplete type
res_features.c:369: error: storage size of 'res' isn't known
res_features.c:375: warning: 'return' with a value, in function returning void
res_features.c:383: warning: 'return' with a value, in function returning void
res_features.c:385: warning: 'return' with a value, in function returning void
res_features.c:369: warning: unused variable 'res'
res_features.c: In function 'builtin_automonitor':
res_features.c:663: error: too few arguments to function 'ast_stream_and_wait'
res_features.c: In function 'builtin_blindtransfer':
res_features.c:768: error: too few arguments to function 'ast_stream_and_wait'
res_features.c:829: error: too few arguments to function 'ast_stream_and_wait'
res_features.c: In function 'builtin_atxfer':
res_features.c:879: error: too few arguments to function 'ast_stream_and_wait'
res_features.c:896: error: too few arguments to function 'ast_stream_and_wait'
res_features.c:905: error: too few arguments to function 'ast_stream_and_wait'
res_features.c:922: error: too few arguments to function 'ast_stream_and_wait'
res_features.c:924: error: too few arguments to function 'ast_stream_and_wait'
res_features.c:937: error: too few arguments to function 'ast_stream_and_wait'
res_features.c:982: error: too few arguments to function 'ast_stream_and_wait'
res_features.c:999: error: too few arguments to function 'ast_stream_and_wait'
res_features.c:1074: error: too few arguments to function 'ast_stream_and_wait'
res_features.c: At top level:
res_features.c:1092: warning: initialization from incompatible pointer type
res_features.c:1093: warning: initialization from incompatible pointer type
res_features.c:1094: warning: initialization from incompatible pointer type
res_features.c:1095: warning: initialization from incompatible pointer type
res_features.c:1096: warning: initialization from incompatible pointer type
res_features.c:1155: warning: no previous prototype for 'ast_rdlock_call_features'
res_features.c:1160: warning: no previous prototype for 'ast_unlock_call_features'
res_features.c:1166: warning: no previous prototype for 'ast_find_call_feature'
res_features.c: In function 'ast_feature_interpret':
res_features.c:1294: error: too few arguments to function 'builtin_features[x].operation'
res_features.c:1318: error: too few arguments to function 'feature->operation'
res_features.c: In function 'park_exec_full':
res_features.c:2174: error: too few arguments to function 'ast_stream_and_wait'
res_features.c:2176: error: too few arguments to function 'ast_stream_and_wait'
res_features.c:2233: error: too few arguments to function 'ast_stream_and_wait'
res_features.c: In function 'load_config':
res_features.c:3007: warning: assignment from incompatible pointer type
res_features.c: In function 'load_module':
res_features.c:3269: warning: passing argument 2 of 'ast_devstate_prov_add' from incompatible pointer type
make[1]: *** [res_features.o] Error 1
make: *** [res] Error 2

By: Bryant Zimmerman (zktech) 2008-02-01 17:29:27.000-0600

Is there any way that I can merge this into the 1.4.17 branch version so I can test it in my pre-production env.  I really want to help get this feature working as I need it.   Can anyone give me a how to on merging this.  I am primarly a windows guy but have done enought with asterisk on linux I can follow directions.


By: Michiel van Baak (mvanbaak) 2008-02-01 17:45:45.000-0600

oej: can you comment on the interest to get this branch up to date again ?
last commit (automerge) to the branch is 8 months old.

By: VladimirB (vladb) 2008-02-01 17:57:48.000-0600

zktech with some corrections we managed to make it going in on development system with ast 1.4.17. seems to be working. We run into a BLF issue. when you restart asterisk other context's then default(parkinglots) are coming up with lights on till the first use then it is working ok. Something is wrong with initialization's.
For some reason there is other bug report id for the same thing like here, see:
if would be possible to integrate this in to main release would be really nice.

By: skin256 (skin256) 2008-02-13 15:17:42.000-0600

I would be interested in trying to get this functionality and posting my results if some one would be so kind as to maybe explain or link me to directions on how to patch what I need to.

I have spent the last few weeks at looking how to achieve this and it seems to be either non existent or very hackish the examples on the net.

We have 2 production 1.4.11 systems. Would most likely test against these builds.

Awaiting response. Thank You.

By: yema (yem) 2008-02-14 10:12:33.000-0600

I'm interested as well to test that in pre-production running 14.17 or 14.18.
I just can't get it to compile.

By: Bryant Zimmerman (zktech) 2008-02-14 10:47:59.000-0600

I too am a Linux Lightweight. Can anyone provide directions on how to merge this into the 1.4.17 and 1.4.18 builds.


By: Michiel van Baak (mvanbaak) 2008-02-16 02:42:38.000-0600

@yem: the code is no longer in res_features only.
You need to alter channels.h and all channeldrivers as well.

By: Michiel van Baak (mvanbaak) 2008-02-16 03:05:20.000-0600

I'm working to get things updated and running again.
Since it's a new feature it will be for trunk only.

Once I have it running here I'll report the new location etc.

By: Olle Johansson (oej) 2008-02-16 04:04:43.000-0600

I appreciate that someone jumps in to complete this work.

We need to make the parking spaces "astobj"ects to avoid the situation where you delete a parkinglot in the configuration, reload and there's parked calls hanging in the lot you just removed going into parked call heaven for eternity.

By: skin256 (skin256) 2008-02-18 14:22:22.000-0600


When you say alter, what do you mean? I am trying to compile as well and receiving the same error as @yem.

By: Michiel van Baak (mvanbaak) 2008-02-18 14:25:11.000-0600

I mean the changes are no longer in res_features.c alone.
There are a lot more files that need patching to get this to work.

And in it's current state it wont work at all. it wont compile and is lagging 8 months.
I'm working to get it to work again and after that the whole thing should be converted to use astobjects as per oej's comment.

By: Sergey Tamkovich (sergee) 2008-02-19 04:37:24.000-0600

mvanbaak, what is your progress? if you didn't start yet, or progress is very small, i can dedicate a few days of my time to update this feature to trunk.

By: dtyoo (dtyoo) 2008-03-04 17:36:49.000-0600

I'm very interested in seeing this feature get included into a release.  While I can't contribute any code, I can help test anything you folks come up with.  Let me know if / when there is something for me to test, and I'll be happy to post back my results.

By: David Rodman (djrodman) 2008-03-17 19:26:58

I have implemented multiparking.  It's a small patch to res_features.c - everything else is handled in features.conf and extensions.conf.  Each context (company, in a multi-company environment) has its parked calls segregated - parked calls can only be unparked from the context they were parked in.

This has been tested with 1.4.17 and 1.4.18.

Here it is: http://redroad.com/multiparking

By: Michiel van Baak (mvanbaak) 2008-03-19 17:26:10

@djrodman: your setup is based on parked numbers.
This setup is totally different:
- it uses seperate parkinglots you can pick by setting channel variables
- it uses astobj to store the parkinglots
Basically, it's more in line with the rest of asterisk (think extenions and queues)

The current state of the branch is that it compiles, it runs, and the main/features.c cli commands can handle the parking lots.
It's now time to store the channel variable to set the parkinglot and start testing it.

There's also a todo note on converting it from astobj to astobj2 but right now my main concern is to get it working correctly as it is now.

My feeling is that it's very close to done, but maybe oej (who did the initial work some time ago) or some other core dev can have a look at it and give feedback.

For reference, the branch is here: http://svn.digium.com/svn/asterisk/team/group/multiparking

By: Digium Subversion (svnbot) 2008-04-21 18:37:36

Repository: asterisk
Revision: 114487

U   trunk/apps/app_dumpchan.c
U   trunk/channels/chan_console.c
U   trunk/channels/chan_gtalk.c
U   trunk/channels/chan_iax2.c
U   trunk/channels/chan_jingle.c
U   trunk/channels/chan_mgcp.c
U   trunk/channels/chan_sip.c
U   trunk/channels/chan_skinny.c
U   trunk/channels/chan_unistim.c
U   trunk/channels/chan_zap.c
U   trunk/configs/features.conf.sample
U   trunk/configs/iax.conf.sample
U   trunk/configs/sip.conf.sample
U   trunk/funcs/func_channel.c
U   trunk/include/asterisk/channel.h
U   trunk/main/features.c

r114487 | jpeeler | 2008-04-21 18:37:34 -0500 (Mon, 21 Apr 2008) | 9 lines

(closes issue ASTERISK-5955)
Reported by: oej
Tested by: jpeeler

This patch implements multiple parking lots for parked calls. The default parkinglot is used by default, however setting the channel variable PARKINGLOT in the dialplan will allow use of any other configured parkinglot. See configs/features.conf.sample for more details on setting up another non-default parkinglot. Also, one can (currently) set the default parkinglot to use in the driver configuration file via the parkinglot option.

Patch initially written by oej, brought up to date and finalized by mvanbaak, and then stabilized and converted to astobj2 by me.