mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
res_parking: Add dialplan function for lot channel
This commit adds a new function to res_parking. This function, PARK_GET_CHANNEL allows the retrieval of the channel name of the channel occupying the parking slot. ASTERISK-22825 #close Change-Id: Idba6ae55b8a53f734238cb3d995cedb95c0e7b74
This commit is contained in:
committed by
Richard Mudgett
parent
6d0529cd7f
commit
f7137e1230
@@ -163,6 +163,23 @@ static int retrieve_parked_user_targeted(void *obj, void *arg, int flags)
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct parked_user *parking_lot_inspect_parked_user(struct parking_lot *lot, int target)
|
||||
{
|
||||
struct parked_user *user;
|
||||
|
||||
if (target < 0) {
|
||||
user = ao2_callback(lot->parked_users, 0, NULL, NULL);
|
||||
} else {
|
||||
user = ao2_callback(lot->parked_users, 0, retrieve_parked_user_targeted, &target);
|
||||
}
|
||||
|
||||
if (!user) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
struct parked_user *parking_lot_retrieve_parked_user(struct parking_lot *lot, int target)
|
||||
{
|
||||
RAII_VAR(struct parked_user *, user, NULL, ao2_cleanup);
|
||||
|
Reference in New Issue
Block a user