Merged revisions 316224 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r316224 | rmudgett | 2011-05-03 14:18:30 -0500 (Tue, 03 May 2011) | 16 lines The dahdi_hangup() call does not clean up the channel fully. After dahdi_hangup() has supposedly hungup an ISDN channel there is still traffic on the S0-bus because the channel was not cleaned up fully. Shuffled the hangup code to include some missing cleanup. Also fixed some code formatting in the area. I think the primary missing clean up code was the call to tone_zone_play_tone() to turn off any active tones on the channel. (closes issue #19188) Reported by: jg1234 Patches: issue19188_v1.8.patch uploaded by rmudgett (license 664) Tested by: jg1234 ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@316240 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
1cbc0e418c
commit
39277e4ddd
|
@ -6135,46 +6135,73 @@ static int dahdi_hangup(struct ast_channel *ast)
|
||||||
p->cid_subaddr[0] = '\0';
|
p->cid_subaddr[0] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_PRI
|
#if defined(HAVE_PRI)
|
||||||
if (dahdi_sig_pri_lib_handles(p->sig)) {
|
if (dahdi_sig_pri_lib_handles(p->sig)) {
|
||||||
x = 1;
|
x = 1;
|
||||||
ast_channel_setoption(ast,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0);
|
ast_channel_setoption(ast, AST_OPTION_AUDIO_MODE, &x, sizeof(char), 0);
|
||||||
dahdi_confmute(p, 0);
|
|
||||||
p->muting = 0;
|
dahdi_confmute(p, 0);
|
||||||
restore_gains(p);
|
p->muting = 0;
|
||||||
if (p->dsp) {
|
restore_gains(p);
|
||||||
ast_dsp_free(p->dsp);
|
if (p->dsp) {
|
||||||
p->dsp = NULL;
|
ast_dsp_free(p->dsp);
|
||||||
}
|
p->dsp = NULL;
|
||||||
p->ignoredtmf = 0;
|
}
|
||||||
revert_fax_buffers(p, ast);
|
p->ignoredtmf = 0;
|
||||||
dahdi_setlinear(p->subs[SUB_REAL].dfd, 0);
|
|
||||||
p->law = p->law_default;
|
/* Real channel, do some fixup */
|
||||||
law = p->law_default;
|
p->subs[SUB_REAL].owner = NULL;
|
||||||
res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_SETLAW, &law);
|
p->subs[SUB_REAL].needbusy = 0;
|
||||||
dahdi_disable_ec(p);
|
dahdi_setlinear(p->subs[SUB_REAL].dfd, 0);
|
||||||
update_conf(p);
|
|
||||||
reset_conf(p);
|
p->owner = NULL;
|
||||||
sig_pri_hangup(p->sig_pvt, ast);
|
p->cid_tag[0] = '\0';
|
||||||
p->subs[SUB_REAL].owner = NULL;
|
p->ringt = 0;/* Probably not used in this mode. Reset anyway. */
|
||||||
p->subs[SUB_REAL].needbusy = 0;
|
p->distinctivering = 0;/* Probably not used in this mode. Reset anyway. */
|
||||||
p->owner = NULL;
|
p->confirmanswer = 0;/* Probably not used in this mode. Reset anyway. */
|
||||||
p->cid_tag[0] = '\0';
|
p->outgoing = 0;
|
||||||
p->ringt = 0;/* Probably not used in this mode. Reset anyway. */
|
p->digital = 0;
|
||||||
p->distinctivering = 0;/* Probably not used in this mode. Reset anyway. */
|
p->faxhandled = 0;
|
||||||
p->confirmanswer = 0;/* Probably not used in this mode. Reset anyway. */
|
p->pulsedial = 0;/* Probably not used in this mode. Reset anyway. */
|
||||||
p->outgoing = 0;
|
|
||||||
p->digital = 0;
|
revert_fax_buffers(p, ast);
|
||||||
p->faxhandled = 0;
|
|
||||||
p->pulsedial = 0;/* Probably not used in this mode. Reset anyway. */
|
p->law = p->law_default;
|
||||||
goto hangup_out;
|
law = p->law_default;
|
||||||
}
|
res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_SETLAW, &law);
|
||||||
#endif
|
if (res < 0) {
|
||||||
|
ast_log(LOG_WARNING, "Unable to set law on channel %d to default: %s\n",
|
||||||
#if defined(HAVE_SS7)
|
p->channel, strerror(errno));
|
||||||
if (p->sig == SIG_SS7) {
|
}
|
||||||
x = 1;
|
|
||||||
ast_channel_setoption(ast,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0);
|
sig_pri_hangup(p->sig_pvt, ast);
|
||||||
|
|
||||||
|
tone_zone_play_tone(p->subs[SUB_REAL].dfd, -1);
|
||||||
|
dahdi_disable_ec(p);
|
||||||
|
|
||||||
|
x = 0;
|
||||||
|
ast_channel_setoption(ast, AST_OPTION_TDD, &x, sizeof(char), 0);
|
||||||
|
p->didtdd = 0;/* Probably not used in this mode. Reset anyway. */
|
||||||
|
|
||||||
|
p->rdnis[0] = '\0';
|
||||||
|
update_conf(p);
|
||||||
|
reset_conf(p);
|
||||||
|
|
||||||
|
/* Restore data mode */
|
||||||
|
x = 0;
|
||||||
|
ast_channel_setoption(ast, AST_OPTION_AUDIO_MODE, &x, sizeof(char), 0);
|
||||||
|
|
||||||
|
if (num_restart_pending == 0) {
|
||||||
|
restart_monitor();
|
||||||
|
}
|
||||||
|
goto hangup_out;
|
||||||
|
}
|
||||||
|
#endif /* defined(HAVE_PRI) */
|
||||||
|
|
||||||
|
#if defined(HAVE_SS7)
|
||||||
|
if (p->sig == SIG_SS7) {
|
||||||
|
x = 1;
|
||||||
|
ast_channel_setoption(ast, AST_OPTION_AUDIO_MODE, &x, sizeof(char), 0);
|
||||||
|
|
||||||
dahdi_confmute(p, 0);
|
dahdi_confmute(p, 0);
|
||||||
p->muting = 0;
|
p->muting = 0;
|
||||||
|
@ -6188,7 +6215,6 @@ static int dahdi_hangup(struct ast_channel *ast)
|
||||||
/* Real channel, do some fixup */
|
/* Real channel, do some fixup */
|
||||||
p->subs[SUB_REAL].owner = NULL;
|
p->subs[SUB_REAL].owner = NULL;
|
||||||
p->subs[SUB_REAL].needbusy = 0;
|
p->subs[SUB_REAL].needbusy = 0;
|
||||||
p->polarity = POLARITY_IDLE;
|
|
||||||
dahdi_setlinear(p->subs[SUB_REAL].dfd, 0);
|
dahdi_setlinear(p->subs[SUB_REAL].dfd, 0);
|
||||||
|
|
||||||
p->owner = NULL;
|
p->owner = NULL;
|
||||||
|
@ -6205,28 +6231,30 @@ static int dahdi_hangup(struct ast_channel *ast)
|
||||||
p->law = p->law_default;
|
p->law = p->law_default;
|
||||||
law = p->law_default;
|
law = p->law_default;
|
||||||
res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_SETLAW, &law);
|
res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_SETLAW, &law);
|
||||||
if (res < 0)
|
if (res < 0) {
|
||||||
ast_log(LOG_WARNING, "Unable to set law on channel %d to default: %s\n", p->channel, strerror(errno));
|
ast_log(LOG_WARNING, "Unable to set law on channel %d to default: %s\n",
|
||||||
|
p->channel, strerror(errno));
|
||||||
|
}
|
||||||
|
|
||||||
sig_ss7_hangup(p->sig_pvt, ast);
|
sig_ss7_hangup(p->sig_pvt, ast);
|
||||||
|
|
||||||
tone_zone_play_tone(p->subs[SUB_REAL].dfd, -1);
|
tone_zone_play_tone(p->subs[SUB_REAL].dfd, -1);
|
||||||
dahdi_disable_ec(p);
|
dahdi_disable_ec(p);
|
||||||
|
|
||||||
x = 0;
|
x = 0;
|
||||||
ast_channel_setoption(ast,AST_OPTION_TONE_VERIFY,&x,sizeof(char),0);
|
ast_channel_setoption(ast, AST_OPTION_TDD, &x, sizeof(char), 0);
|
||||||
ast_channel_setoption(ast,AST_OPTION_TDD,&x,sizeof(char),0);
|
|
||||||
p->didtdd = 0;/* Probably not used in this mode. Reset anyway. */
|
p->didtdd = 0;/* Probably not used in this mode. Reset anyway. */
|
||||||
|
|
||||||
update_conf(p);
|
update_conf(p);
|
||||||
reset_conf(p);
|
reset_conf(p);
|
||||||
|
|
||||||
/* Restore data mode */
|
/* Restore data mode */
|
||||||
x = 0;
|
x = 0;
|
||||||
ast_channel_setoption(ast,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0);
|
ast_channel_setoption(ast, AST_OPTION_AUDIO_MODE, &x, sizeof(char), 0);
|
||||||
|
|
||||||
if (num_restart_pending == 0)
|
if (num_restart_pending == 0) {
|
||||||
restart_monitor();
|
restart_monitor();
|
||||||
|
}
|
||||||
ast->tech_pvt = NULL;
|
|
||||||
goto hangup_out;
|
goto hangup_out;
|
||||||
}
|
}
|
||||||
#endif /* defined(HAVE_SS7) */
|
#endif /* defined(HAVE_SS7) */
|
||||||
|
@ -6440,6 +6468,7 @@ static int dahdi_hangup(struct ast_channel *ast)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
tone_zone_play_tone(p->subs[SUB_REAL].dfd, -1);
|
tone_zone_play_tone(p->subs[SUB_REAL].dfd, -1);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (p->sig)
|
if (p->sig)
|
||||||
dahdi_disable_ec(p);
|
dahdi_disable_ec(p);
|
||||||
|
@ -6473,8 +6502,8 @@ static int dahdi_hangup(struct ast_channel *ast)
|
||||||
p->cidcwexpire = 0;
|
p->cidcwexpire = 0;
|
||||||
p->cid_suppress_expire = 0;
|
p->cid_suppress_expire = 0;
|
||||||
p->oprmode = 0;
|
p->oprmode = 0;
|
||||||
ast->tech_pvt = NULL;
|
|
||||||
hangup_out:
|
hangup_out:
|
||||||
|
ast->tech_pvt = NULL;
|
||||||
ast_free(p->cidspill);
|
ast_free(p->cidspill);
|
||||||
p->cidspill = NULL;
|
p->cidspill = NULL;
|
||||||
|
|
||||||
|
|
|
@ -1470,7 +1470,6 @@ int analog_hangup(struct analog_pvt *p, struct ast_channel *ast)
|
||||||
}
|
}
|
||||||
|
|
||||||
analog_stop_callwait(p);
|
analog_stop_callwait(p);
|
||||||
ast->tech_pvt = NULL;
|
|
||||||
|
|
||||||
ast_verb(3, "Hanging up on '%s'\n", ast->name);
|
ast_verb(3, "Hanging up on '%s'\n", ast->name);
|
||||||
|
|
||||||
|
|
|
@ -7179,8 +7179,6 @@ int sig_pri_hangup(struct sig_pri_chan *p, struct ast_channel *ast)
|
||||||
|
|
||||||
sig_pri_span_devstate_changed(p->pri);
|
sig_pri_span_devstate_changed(p->pri);
|
||||||
pri_rel(p->pri);
|
pri_rel(p->pri);
|
||||||
|
|
||||||
ast->tech_pvt = NULL;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue