summaryrefslogtreecommitdiff
path: root/channels/chan_dahdi.c
diff options
context:
space:
mode:
authorMoises Silva <moises.silva@gmail.com>2009-08-20 03:26:59 +0000
committerMoises Silva <moises.silva@gmail.com>2009-08-20 03:26:59 +0000
commit8a2302e11848d54245934077427752d1c1d9ed7a (patch)
treea540eae95199614b0dfe558f7a6849562c5fc1f2 /channels/chan_dahdi.c
parent8b707e913b54cdbe4457475eba7a0dee5b516405 (diff)
fixed bug caused by calling ast_request without calling ast_call on an R2 channel, ie, CHANISAVAIL
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@213216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_dahdi.c')
-rw-r--r--channels/chan_dahdi.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 2fa7ccaec..74cf4f719 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -4619,6 +4619,7 @@ static int dahdi_call(struct ast_channel *ast, char *rdest, int timeout)
if (p->mfcr2) {
openr2_calling_party_category_t chancat;
int callres = 0;
+ char *c, *l;
c = strchr(dest, '/');
if (c) {
@@ -5255,7 +5256,7 @@ static int dahdi_hangup(struct ast_channel *ast)
}
#endif
#ifdef HAVE_OPENR2
- if (p->mfcr2) {
+ if (p->mfcr2 && p->mfcr2call && openr2_chan_get_direction(p->r2chan) != OR2_DIR_STOPPED) {
ast_log(LOG_DEBUG, "disconnecting MFC/R2 call on chan %d\n", p->channel);
/* If it's an incoming call, check the mfcr2_forced_release setting */
if (openr2_chan_get_direction(p->r2chan) == OR2_DIR_BACKWARD && p->mfcr2_forced_release) {
@@ -5268,6 +5269,9 @@ static int dahdi_hangup(struct ast_channel *ast)
openr2_chan_disconnect_call(p->r2chan, r2cause);
}
dahdi_r2_update_monitor_count(p->mfcr2, 1);
+ } else if (p->mfcr2call) {
+ ast_log(LOG_DEBUG, "Clearing call request on channel %d\n", p->channel);
+ p->mfcr2call = 0;
}
#endif
switch (p->sig) {
@@ -11510,6 +11514,9 @@ static struct ast_channel *dahdi_request(const char *type, int format, const str
tmp->cdrflags |= AST_CDR_CALLWAIT;
break;
}
+#ifdef HAVE_OPENR2
+next:
+#endif
if (backwards) {
p = p->prev;
if (!p)