diff options
author | Jonathan Rose <jrose@digium.com> | 2013-08-05 16:00:01 +0000 |
---|---|---|
committer | Jonathan Rose <jrose@digium.com> | 2013-08-05 16:00:01 +0000 |
commit | 98b02d98f389d922da568882cd3f350fe28b473d (patch) | |
tree | 57611025b10e29a395a353c86327c7bdf370f46b /res/parking/parking_bridge.c | |
parent | 357b275239d2e461cd2a3dbaf4d091932824abd4 (diff) |
res_parking: Unit tests
Adds the following unit tests:
* create_lot: tests adding and removal of a new parking lot (baseline)
* park_extensions: creates a parking lot that registers extensions and
then confirms that all of the expected extensions exist
* extensions_conflicts: creates numerous parking lots to test that
extension conflicts in parking lots result in parking lot
creation failing
* dynamic_parking_variables: Tests that the creation of dynamic
parking lots respects the related channel variables set on the
channel that requests them.
* park_call: Tests adding a channel to a parking lot's holding bridge
by standard parking functions.
* retrieve_call: Tests pulling a channel out of a parking lot's
holding bridge via parked call retrieval functions.
(closes issue ASTERISK-22138)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2714/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396175 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/parking/parking_bridge.c')
-rw-r--r-- | res/parking/parking_bridge.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/res/parking/parking_bridge.c b/res/parking/parking_bridge.c index 55d853386..d0bdfa098 100644 --- a/res/parking/parking_bridge.c +++ b/res/parking/parking_bridge.c @@ -359,7 +359,10 @@ static void bridge_parking_pull(struct ast_bridge_parking *self, struct ast_brid } ao2_unlock(pu); - parking_notify_metermaids(pu->parking_space, self->lot->cfg->parking_con, AST_DEVICE_NOT_INUSE); + /* Pull can still happen after the bridge starts dissolving, so make sure we still have a lot before trying to notify metermaids. */ + if (self->lot) { + parking_notify_metermaids(pu->parking_space, self->lot->cfg->parking_con, AST_DEVICE_NOT_INUSE); + } switch (pu->resolution) { case PARK_UNSET: |