From 78b836de556b1de0b7b2937d005997a6302ba6a3 Mon Sep 17 00:00:00 2001 From: martinp Date: Mon, 25 Aug 2003 21:17:38 +0000 Subject: [PATCH] Make sure that when the d-channel goes down we also clear the libpri structures with pri_destroycall git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1431 f38db490-d61c-443f-a65b-d21fe96a405b --- channels/chan_zap.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 2c8da8ddd..3c1ad5292 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -2654,11 +2654,14 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast) #ifdef ZAPATA_PRI #ifdef PRI_DESTROYCALL if (p->call) { - if (p->pri && p->pri->pri) + if (p->pri && p->pri->pri) { + pri_hangup(p->pri->pri, p->call, -1); pri_destroycall(p->pri->pri, p->call); - else + } else ast_log(LOG_WARNING, "The PRI Call have not been destroyed\n"); } + if (p->owner) + p->owner->_softhangup |= AST_SOFTHANGUP_DEV; p->call = NULL; #else #error Please "cvs update" and recompile libpri @@ -5699,14 +5702,16 @@ static void *pri_dchannel(void *vpri) for (i=0; i<=pri->channels; i++) { struct zt_pvt *p = pri->pvt[i]; if (p) { - p->owner->_softhangup |= AST_SOFTHANGUP_DEV; if (p->call) { - if (p->pri && p->pri->pri) + if (p->pri && p->pri->pri) { + pri_hangup(p->pri->pri, p->call, -1); pri_destroycall(p->pri->pri, p->call); - else - ast_log(LOG_WARNING, "The PRI Call have not been destroyed on channel %s\n",p->owner->name); + p->call = NULL; + } else + ast_log(LOG_WARNING, "The PRI Call have not been destroyed\n"); } - p->call = NULL; + if (p->owner) + p->owner->_softhangup |= AST_SOFTHANGUP_DEV; p->inalarm = 1; } }