aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-05 16:56:11 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-05 16:56:11 +0000
commit0891b8a53c15aa09b50404299c22413cbf586943 (patch)
treed6b2d0850bac2afae7026e0560ca97c249f82d66 /apps
parent6c7e27ae2521df1506a0774c9b275433580f6c40 (diff)
make datastore creation and destruction a generic API since it is not really channel related, and add the ability to add/find/remove datastores to manager sessions
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@135680 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_chanspy.c4
-rw-r--r--apps/app_dial.c8
-rw-r--r--apps/app_queue.c10
-rw-r--r--apps/app_speech_utils.c2
-rw-r--r--apps/app_stack.c4
5 files changed, 14 insertions, 14 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index 4c5ab3333..b59b03f69 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -560,7 +560,7 @@ static struct chanspy_ds *chanspy_ds_free(struct chanspy_ds *chanspy_ds)
/* chanspy_ds->chan is NULL after this call */
chanspy_ds_destroy(datastore->data);
datastore->data = NULL;
- ast_channel_datastore_free(datastore);
+ ast_datastore_free(datastore);
}
ast_channel_unlock(chan);
}
@@ -576,7 +576,7 @@ static struct chanspy_ds *setup_chanspy_ds(struct ast_channel *chan, struct chan
ast_mutex_lock(&chanspy_ds->lock);
- if (!(datastore = ast_channel_datastore_alloc(&chanspy_ds_info, chanspy_ds->unique_id))) {
+ if (!(datastore = ast_datastore_alloc(&chanspy_ds_info, chanspy_ds->unique_id))) {
ast_mutex_unlock(&chanspy_ds->lock);
chanspy_ds = chanspy_ds_free(chanspy_ds);
ast_channel_unlock(chan);
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 9b5fe44df..07cbf51ee 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -1354,7 +1354,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
ast_copy_flags64(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID | OPT_CALLER_HANGUP | OPT_IGNORE_FORWARDING);
/* Create datastore for channel dial features for caller */
- if (!(ds_caller_features = ast_channel_datastore_alloc(&dial_features_info, NULL))) {
+ if (!(ds_caller_features = ast_datastore_alloc(&dial_features_info, NULL))) {
ast_log(LOG_WARNING, "Unable to create channel datastore for dial features. Aborting!\n");
goto out;
}
@@ -1416,7 +1416,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
if (datastore)
dialed_interfaces = datastore->data;
else {
- if (!(datastore = ast_channel_datastore_alloc(&dialed_interface_info, NULL))) {
+ if (!(datastore = ast_datastore_alloc(&dialed_interface_info, NULL))) {
ast_log(LOG_WARNING, "Unable to create channel datastore for dialed interfaces. Aborting!\n");
ast_free(tmp);
goto out;
@@ -1522,7 +1522,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
ast_copy_string(tc->exten, chan->exten, sizeof(tc->exten));
/* Save callee features */
- if (!(ds_callee_features = ast_channel_datastore_alloc(&dial_features_info, NULL))) {
+ if (!(ds_callee_features = ast_datastore_alloc(&dial_features_info, NULL))) {
ast_log(LOG_WARNING, "Unable to create channel datastore for dial features. Aborting!\n");
ast_free(tmp);
goto out;
@@ -1624,7 +1624,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
* datastore again, causing a crash
*/
if (!ast_channel_datastore_remove(chan, datastore))
- ast_channel_datastore_free(datastore);
+ ast_datastore_free(datastore);
if (!peer) {
if (result) {
res = result;
diff --git a/apps/app_queue.c b/apps/app_queue.c
index eb7cf0f78..e32442bca 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -3120,7 +3120,7 @@ static void queue_transfer_fixup(void *data, struct ast_channel *old_chan, struc
}
ast_channel_datastore_remove(new_chan, datastore);
- ast_channel_datastore_free(datastore);
+ ast_datastore_free(datastore);
}
/*! \brief mechanism to tell if a queue caller was atxferred by a queue member.
@@ -3147,7 +3147,7 @@ static void setup_transfer_datastore(struct queue_ent *qe, struct member *member
}
ast_channel_lock(qe->chan);
- if (!(ds = ast_channel_datastore_alloc(&queue_transfer_info, NULL))) {
+ if (!(ds = ast_datastore_alloc(&queue_transfer_info, NULL))) {
ast_channel_unlock(qe->chan);
ast_log(LOG_WARNING, "Unable to create transfer datastore. queue_log will not show attended transfer\n");
return;
@@ -3321,7 +3321,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
goto out;
}
if (!datastore) {
- if (!(datastore = ast_channel_datastore_alloc(&dialed_interface_info, NULL))) {
+ if (!(datastore = ast_datastore_alloc(&dialed_interface_info, NULL))) {
ao2_ref(cur, -1);
ao2_unlock(qe->parent);
if (use_weight)
@@ -3423,7 +3423,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
* datastore again, causing a crash
*/
if (datastore && !ast_channel_datastore_remove(qe->chan, datastore)) {
- ast_channel_datastore_free(datastore);
+ ast_datastore_free(datastore);
}
ao2_lock(qe->parent);
if (qe->parent->strategy == QUEUE_STRATEGY_RRMEMORY) {
@@ -3845,7 +3845,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
transfer_ds = ast_channel_datastore_find(qe->chan, &queue_transfer_info, NULL);
if (transfer_ds) {
ast_channel_datastore_remove(qe->chan, transfer_ds);
- ast_channel_datastore_free(transfer_ds);
+ ast_datastore_free(transfer_ds);
}
ast_channel_unlock(qe->chan);
}
diff --git a/apps/app_speech_utils.c b/apps/app_speech_utils.c
index 568c01bc3..939a92f58 100644
--- a/apps/app_speech_utils.c
+++ b/apps/app_speech_utils.c
@@ -364,7 +364,7 @@ static int speech_create(struct ast_channel *chan, void *data)
return 0;
}
- datastore = ast_channel_datastore_alloc(&speech_datastore, NULL);
+ datastore = ast_datastore_alloc(&speech_datastore, NULL);
if (datastore == NULL) {
ast_speech_destroy(speech);
pbx_builtin_setvar_helper(chan, "ERROR", "1");
diff --git a/apps/app_stack.c b/apps/app_stack.c
index 669f7f4e7..4c42a0158 100644
--- a/apps/app_stack.c
+++ b/apps/app_stack.c
@@ -242,7 +242,7 @@ static int gosub_exec(struct ast_channel *chan, void *data)
if (!stack_store) {
ast_debug(1, "Channel %s has no datastore, so we're allocating one.\n", chan->name);
- stack_store = ast_channel_datastore_alloc(&stack_info, NULL);
+ stack_store = ast_datastore_alloc(&stack_info, NULL);
if (!stack_store) {
ast_log(LOG_ERROR, "Unable to allocate new datastore. Gosub will fail.\n");
return -1;
@@ -251,7 +251,7 @@ static int gosub_exec(struct ast_channel *chan, void *data)
oldlist = ast_calloc(1, sizeof(*oldlist));
if (!oldlist) {
ast_log(LOG_ERROR, "Unable to allocate datastore list head. Gosub will fail.\n");
- ast_channel_datastore_free(stack_store);
+ ast_datastore_free(stack_store);
return -1;
}