From 89761c426867176497abd4445ceb01b00cb2c0c9 Mon Sep 17 00:00:00 2001 From: oelewapperke Date: Thu, 13 Jan 2011 15:26:05 +0100 Subject: [PATCH] delete the dialed interfaces datastore upon channel answer or upon channel bridge --- apps/app_dial.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/apps/app_dial.c b/apps/app_dial.c index b44e0c1..6f7c307 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -895,6 +895,19 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, if (ast_test_flag64(o, DIAL_STILLGOING) && c->_state == AST_STATE_UP) { if (!peer) { ast_verb(3, "%s answered %s\n", c->name, in->name); + + /* Erase the datastore containing the list of already dialed interfaces */ + ast_channel_lock(chan); + datastore = ast_channel_datastore_find(chan, &dialed_interface_info, NULL); + if (datastore) { + ast_debug(3, "Deleting the dialed interfaces datastore\n"); + + ast_channel_datastore_remove(chan, datastore); + ast_datastore_free(datastore); + datastore = NULL; + } + ast_channel_unlock(chan); + peer = c; ast_copy_flags64(peerflags, o, OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER | -- 1.7.0.4