mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-19 11:13:09 +00:00
Asterisk, when parking can drop rights a caller when a parking timeout occurs. Also, when doing built-in attended transfers, sometimes incorrectly passes rights from the transferrer to the transferee. This patch tries to fixes the parking issue and lays some groundwork for later fixing the transfer issue.
(closes issue #11520) Reported by: pliew Tested by: otherwiseguy git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105477 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -35,8 +35,9 @@ static void dialed_interface_destroy(void *data)
|
||||
struct ast_dialed_interface *di = NULL;
|
||||
AST_LIST_HEAD(, ast_dialed_interface) *dialed_interface_list = data;
|
||||
|
||||
if (!dialed_interface_list)
|
||||
if (!dialed_interface_list) {
|
||||
return;
|
||||
}
|
||||
|
||||
AST_LIST_LOCK(dialed_interface_list);
|
||||
while ((di = AST_LIST_REMOVE_HEAD(dialed_interface_list, list)))
|
||||
@@ -53,11 +54,13 @@ static void *dialed_interface_duplicate(void *data)
|
||||
AST_LIST_HEAD(, ast_dialed_interface) *old_list;
|
||||
AST_LIST_HEAD(, ast_dialed_interface) *new_list = NULL;
|
||||
|
||||
if(!(old_list = data))
|
||||
if(!(old_list = data)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(!(new_list = ast_calloc(1, sizeof(*new_list))))
|
||||
if(!(new_list = ast_calloc(1, sizeof(*new_list)))) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
AST_LIST_HEAD_INIT(new_list);
|
||||
AST_LIST_LOCK(old_list);
|
||||
@@ -76,8 +79,35 @@ static void *dialed_interface_duplicate(void *data)
|
||||
return new_list;
|
||||
}
|
||||
|
||||
|
||||
static void *dial_features_duplicate(void *data)
|
||||
{
|
||||
struct ast_dial_features *df = data, *df_copy;
|
||||
|
||||
if (!(df_copy = ast_calloc(1, sizeof(*df)))) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memcpy(df_copy, df, sizeof(*df));
|
||||
|
||||
return df_copy;
|
||||
}
|
||||
|
||||
static void dial_features_destroy(void *data) {
|
||||
struct ast_dial_features *df = data;
|
||||
if (df) {
|
||||
ast_free(df);
|
||||
}
|
||||
}
|
||||
|
||||
const struct ast_datastore_info dialed_interface_info = {
|
||||
.type ="dialed-interface",
|
||||
.type = "dialed-interface",
|
||||
.destroy = dialed_interface_destroy,
|
||||
.duplicate = dialed_interface_duplicate,
|
||||
};
|
||||
|
||||
const struct ast_datastore_info dial_features_info = {
|
||||
.type = "dial-features",
|
||||
.destroy = dial_features_destroy,
|
||||
.duplicate = dial_features_duplicate,
|
||||
};
|
||||
|
Reference in New Issue
Block a user