diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-10-23 11:50:04 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-10-23 11:50:04 +0000 |
commit | 143e25b83a8c4a31226df1cd2d6728bf853e4108 (patch) | |
tree | 736a339d49c2267340c59b566522032ba297624e /channels/chan_modem.c | |
parent | 5b9e1b51b200a4b887628516691cae72cc7fd2dc (diff) |
Add missing fixup (bug #2667)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4057 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_modem.c')
-rwxr-xr-x | channels/chan_modem.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/channels/chan_modem.c b/channels/chan_modem.c index a911f41e1..c6a27f1a4 100755 --- a/channels/chan_modem.c +++ b/channels/chan_modem.c @@ -510,6 +510,18 @@ static int modem_write(struct ast_channel *ast, struct ast_frame *frame) return res; } +static int modem_fixup(struct ast_channel *oldchan, struct ast_channel *newchan) +{ + struct ast_modem_pvt *p = newchan->pvt->pvt; +ast_log(LOG_WARNING, "fixup called\n"); + if (p->owner!=oldchan) { + ast_log(LOG_WARNING, "old channel wasn't %p but was %p\n",oldchan,p->owner); + return -1; + } + p->owner = newchan; + return 0; +} + struct ast_channel *ast_modem_new(struct ast_modem_pvt *i, int state) { struct ast_channel *tmp; @@ -529,6 +541,7 @@ struct ast_channel *ast_modem_new(struct ast_modem_pvt *i, int state) tmp->pvt->answer = modem_answer; tmp->pvt->read = modem_read; tmp->pvt->write = modem_write; + tmp->pvt->fixup = modem_fixup; strncpy(tmp->context, i->context, sizeof(tmp->context)-1); if (!ast_strlen_zero(i->cid_num)) |