summaryrefslogtreecommitdiff
path: root/main/global_datastores.c
diff options
context:
space:
mode:
authorTerry Wilson <twilson@digium.com>2008-03-01 01:30:37 +0000
committerTerry Wilson <twilson@digium.com>2008-03-01 01:30:37 +0000
commit7d1891d5c34367a4b17dc654a38f3c3200fc6238 (patch)
tree99aebf0c221138d2a0e289daf5c3a45463439e3a /main/global_datastores.c
parentebcefd1395e33f90188f05d482eda65eaf5a6da4 (diff)
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
Diffstat (limited to 'main/global_datastores.c')
-rw-r--r--main/global_datastores.c38
1 files changed, 34 insertions, 4 deletions
diff --git a/main/global_datastores.c b/main/global_datastores.c
index 9b87b2cb4..ca04a0fe9 100644
--- a/main/global_datastores.c
+++ b/main/global_datastores.c
@@ -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,
+};