mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
- lock channel before looking for a channel variable
- Init the parkings list member of struct parkinglot. Thanks Sean for the explanation why this should be here. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@215622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -649,7 +649,9 @@ static struct parkeduser *park_space_reserve(struct ast_channel *chan,
|
|||||||
/* Lock parking list */
|
/* Lock parking list */
|
||||||
AST_LIST_LOCK(&parkinglot->parkings);
|
AST_LIST_LOCK(&parkinglot->parkings);
|
||||||
/* Check for channel variable PARKINGEXTEN */
|
/* Check for channel variable PARKINGEXTEN */
|
||||||
|
ast_channel_lock(chan);
|
||||||
parkingexten = pbx_builtin_getvar_helper(chan, "PARKINGEXTEN");
|
parkingexten = pbx_builtin_getvar_helper(chan, "PARKINGEXTEN");
|
||||||
|
ast_channel_unlock(chan);
|
||||||
if (!ast_strlen_zero(parkingexten)) {
|
if (!ast_strlen_zero(parkingexten)) {
|
||||||
/*!\note The API forces us to specify a numeric parking slot, even
|
/*!\note The API forces us to specify a numeric parking slot, even
|
||||||
* though the architecture would tend to support non-numeric extensions
|
* though the architecture would tend to support non-numeric extensions
|
||||||
@@ -3729,6 +3731,7 @@ static struct ast_parkinglot *create_parkinglot(char *name)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ast_copy_string(newlot->name, name, sizeof(newlot->name));
|
ast_copy_string(newlot->name, name, sizeof(newlot->name));
|
||||||
|
AST_LIST_HEAD_INIT(&newlot->parkings);
|
||||||
|
|
||||||
return newlot;
|
return newlot;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user