diff options
author | martinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-08-25 21:17:38 +0000 |
---|---|---|
committer | martinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-08-25 21:17:38 +0000 |
commit | 78b836de556b1de0b7b2937d005997a6302ba6a3 (patch) | |
tree | 60350c2c26b5a69e098991d9f53455fe242b902a | |
parent | fd4014849f8e5f54c8826d89023bbe49551b177c (diff) |
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
-rwxr-xr-x | channels/chan_zap.c | 19 |
1 files 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; } } |