Merged revisions 109575 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r109575 | mmichelson | 2008-03-18 12:58:11 -0500 (Tue, 18 Mar 2008) | 6 lines

Make sure an agent doesn't try to send dtmf to a NULL channel

closes issue #12242
Reported by Yourname


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109576 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Michelson
2008-03-18 17:59:18 +00:00
parent 4232cef812
commit f1181cb04e

View File

@@ -595,7 +595,9 @@ static int agent_digit_begin(struct ast_channel *ast, char digit)
{ {
struct agent_pvt *p = ast->tech_pvt; struct agent_pvt *p = ast->tech_pvt;
ast_mutex_lock(&p->lock); ast_mutex_lock(&p->lock);
if (p->chan) {
ast_senddigit_begin(p->chan, digit); ast_senddigit_begin(p->chan, digit);
}
ast_mutex_unlock(&p->lock); ast_mutex_unlock(&p->lock);
return 0; return 0;
} }
@@ -604,7 +606,9 @@ static int agent_digit_end(struct ast_channel *ast, char digit, unsigned int dur
{ {
struct agent_pvt *p = ast->tech_pvt; struct agent_pvt *p = ast->tech_pvt;
ast_mutex_lock(&p->lock); ast_mutex_lock(&p->lock);
if (p->chan) {
ast_senddigit_end(p->chan, digit, duration); ast_senddigit_end(p->chan, digit, duration);
}
ast_mutex_unlock(&p->lock); ast_mutex_unlock(&p->lock);
return 0; return 0;
} }