[asterisk-dev] [Code Review] 2447: res_parking: Rebuilding parking from the ground up to work with the new bridging model

jrose reviewboard at asterisk.org
Fri May 3 12:12:18 CDT 2013



> On May 2, 2013, 7:33 p.m., Mark Michelson wrote:
> > I suggest adding XXX, BUGBUG, TODO, or similar comments to areas where you know that functionality is missing. Your review description has a list of todo items, but I ran across a thing or two on here that I wasn't sure corresponded to the listed items. For instance, the Park application has a 'c' option that currently doesn't do anything. I didn't comment on these individual items I came across because I assume you already know that they're unimplemented, but seeing a comment acknowledging that functionality is unaddressed helps me to know for sure whether something is purposely missing or if there is an oversight.

Actually I had the 'c' option working for a really long time and then changed some stuff there a bit and just ended up forgetting to put it in the park common datastore.  I'll fix it though.

Added everything from the list as TODO comments.


> On May 2, 2013, 7:33 p.m., Mark Michelson wrote:
> > /team/group/bridge_construction/res/parking/res_parking.h, lines 56-57
> > <https://reviewboard.asterisk.org/r/2447/diff/4/?file=36813#file36813line56>
> >
> >     I think this parking lot mode can be removed.
> >     
> >     If I understand correctly, the way a parking lot gets marked as disabled is if a parking lot existed in configuration, had users in it, and then got removed from configuration.
> >     
> >     At this point, the parking lot is disabled. Care has to be taken to ensure that users do not get parked to this lot, and each time a user is removed from a parking lot, a check gets made to see if the disabled lot can be removed from the container of parking lots. When the parking lot is disabled and finally becomes empty, the parking lot can be removed from the container and thus be destroyed.
> >     
> >     One thing I noticed, though, was that parked users have a reference to the lot they're parked in. Because of this, you can instead change the behavior so that when a parking lot is removed from configuration, the lot is removed from the container of parking lots immediately. Then, as users are removed from the lot, their references to the lot are removed. When the final user is removed from the lot, the final reference to the lot is removed, and the lot can die. And of course if there were no users in the lot when it was removed from configuration, then removing the lot from the container immediately results in the lot's destruction.
> >     
> >     With this construct, you don't have to worry about potentially parking a user in a disabled lot, and you don't have to manually perform any destruction checks when users exit the parking lot.
> >     
> >     Also, what does "Terminal Mode doest" mean?
> 
> rmudgett wrote:
>     Removing the parking lot immediately from the parking lots container is not going to work.  You need to find the parking lot name in the container to pickup a parked call.
> 
> Mark Michelson wrote:
>     Okay, that makes sense. I don't think reviewboard will let me drop the issue, unfortunately...

Also you may still want to look at the parking lot using cli commands and such in spite of it being disabled. The 'doest' thing... it was supposed to be "Terminal mode, doesn't transition to other modes". I'm changing that a big because it sounds a little awkward.


> On May 2, 2013, 7:33 p.m., Mark Michelson wrote:
> > /team/group/bridge_construction/res/parking/res_parking.h, line 125
> > <https://reviewboard.asterisk.org/r/2447/diff/4/?file=36813#file36813line125>
> >
> >     Why do the structures and functions in res_parking.h not have ast_ prefixes on them?

None of these structures or functions are ever intended to be accessed outside of the parking module. Public-facing functionality provided by the parking module is provided through installable functions in parking.h


> On May 2, 2013, 7:33 p.m., Mark Michelson wrote:
> > /team/group/bridge_construction/res/res_parking.c, line 582
> > <https://reviewboard.asterisk.org/r/2447/diff/4/?file=36814#file36814line582>
> >
> >     Kind of nitpicky, but you have a function called parking_lot_find_by_name() that wraps around named_item_find(), so why not call it instead?

The parking lot container is only accessible in res_parking.c while this function is called from other places. Doing this keeps other stuff from needing to obtain the parking lot container directly.


> On May 2, 2013, 7:33 p.m., Mark Michelson wrote:
> > /team/group/bridge_construction/res/res_parking.c, line 219
> > <https://reviewboard.asterisk.org/r/2447/diff/4/?file=36814#file36814line219>
> >
> >     If this were to go into astobj2's core, I'd suggest adding a flags parameter to the function. That way, people could specify flags like OBJ_NODATA or OBJ_MULTIPLE if desired.

For now it isn't to keep the commit from touching too many core files, but I'll keep that in mind.


- jrose


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2447/#review8423
-----------------------------------------------------------


On April 30, 2013, 6:44 p.m., jrose wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2447/
> -----------------------------------------------------------
> 
> (Updated April 30, 2013, 6:44 p.m.)
> 
> 
> Review request for Asterisk Developers, David Lee, kmoore, Matt Jordan, Mark Michelson, and rmudgett.
> 
> 
> Bugs: ASTERISK-21059, ASTERISK-21272 and ASTERISK-21353
>     https://issues.asterisk.org/jira/browse/ASTERISK-21059
>     https://issues.asterisk.org/jira/browse/ASTERISK-21272
>     https://issues.asterisk.org/jira/browse/ASTERISK-21353
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> As a result of all the new bridging changes, certain applications such as parking, queues, confbridge, and a few others require significant reworking within Asterisk to make usable.
> Parking was less than salvagable, so I've rebuilt it from the ground up to use a lot of new stuff including config hooks, the new bridging architecture, stasis, and just generally to
> be an independent module with its own scope that doesn't get tangled into a giant morass within features.c
> 
> Parking configuration works somewhat differently now and extensions aren't necessarily automatically generated (it's optional and hasn't been implemented), but the intention with the final result is that if you were using parking before without too much additional dialplan manipulation, that should all just work once your parking lots are migrated to the new configuration file.
> 
> Currently supported:
> parking from the PBX with the Park application (all arguments are supported)
> parking within a call using the one touch parking feature
> parking within a call using DTMF blind transfers (attended transfers work, but it's basically just like they called the application itself).
> Picking up parked calls using the PBX
> Multiple parking lots
> All options available to parking lots are currently configurable. Some aren't currently doing anything, namely parkext and hints.
> 
> To do list:
> * Dialplan generation for parking lots with parkext (included 'Park' and 'ParkedCall' applications)
> * Dialplan generation for comebacktoorigin (park-dial extensions)
> * Hints
> * Implement 'Park' manager action
> * Dynamic parking lots and the default parking lot
> * Scraping the greasy remnants of parking out of features.c
> * CEL events
> * Unit tests and testsuite tests
> 
> 
> Diffs
> -----
> 
>   /team/group/bridge_construction/include/asterisk/parking.h PRE-CREATION 
>   /team/group/bridge_construction/main/bridging.c 387012 
>   /team/group/bridge_construction/main/bridging_roles.c 387012 
>   /team/group/bridge_construction/main/config_options.c 387012 
>   /team/group/bridge_construction/main/features.c 387012 
>   /team/group/bridge_construction/main/parking.c PRE-CREATION 
>   /team/group/bridge_construction/res/Makefile 387012 
>   /team/group/bridge_construction/res/parking/parking_applications.c PRE-CREATION 
>   /team/group/bridge_construction/include/asterisk/config_options.h 387012 
>   /team/group/bridge_construction/include/asterisk/bridging.h 387012 
>   /team/group/bridge_construction/configs/res_parking.conf.sample PRE-CREATION 
>   /team/group/bridge_construction/bridges/bridge_builtin_features.c 387012 
>   /team/group/bridge_construction/CHANGES 387012 
>   /team/group/bridge_construction/res/parking/parking_bridge.c PRE-CREATION 
>   /team/group/bridge_construction/res/parking/parking_bridge_features.c PRE-CREATION 
>   /team/group/bridge_construction/res/parking/parking_controller.c PRE-CREATION 
>   /team/group/bridge_construction/res/parking/parking_manager.c PRE-CREATION 
>   /team/group/bridge_construction/res/parking/parking_ui.c PRE-CREATION 
>   /team/group/bridge_construction/res/parking/res_parking.h PRE-CREATION 
>   /team/group/bridge_construction/res/res_parking.c PRE-CREATION 
> 
> Diff: https://reviewboard.asterisk.org/r/2447/diff/
> 
> 
> Testing
> -------
> 
> This is currently being tested as it's developed and breaks in minor ways frequently. Unit tests and testsuite tests are on the to do list.
> 
> 
> Thanks,
> 
> jrose
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130503/d1790c80/attachment-0001.htm>


More information about the asterisk-dev mailing list