diff options
author | Jeff Peeler <jpeeler@digium.com> | 2009-07-17 17:02:44 +0000 |
---|---|---|
committer | Jeff Peeler <jpeeler@digium.com> | 2009-07-17 17:02:44 +0000 |
commit | 827033996564555805994b70d84b5e717ca6f9ee (patch) | |
tree | 350acc395c3bb7c0ce368a150dfddfe45eb78b12 /channels/sig_analog.c | |
parent | 0ce3fa1c22cc67610c52cc828f7d7dd6253b61ac (diff) |
Fix segfault in sig_analog when using callwaiting, respect callwaiting options
Sig_analog handles allocating the sub channel for callwaiting, so no longer try
to do it in chan_dahdi. Modified analog_alloc_sub to only mark the sub as
allocated upon success of the alloc_sub callback, which was responsible for the
segfault. Also, the callwaiting and callwaitingcallerid options were being
unconditionally set to true. Now, the options are properly set from
chan_dahdi.conf.
(closes issue #15508)
Reported by: elguero
Tested by: elguero
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@206998 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sig_analog.c')
-rw-r--r-- | channels/sig_analog.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/channels/sig_analog.c b/channels/sig_analog.c index 3488c7f55..49b9c6bd5 100644 --- a/channels/sig_analog.c +++ b/channels/sig_analog.c @@ -289,9 +289,13 @@ static void analog_swap_subs(struct analog_pvt *p, enum analog_sub a, enum analo static int analog_alloc_sub(struct analog_pvt *p, enum analog_sub x) { - p->subs[x].allocd = 1; - if (p->calls->allocate_sub) - return p->calls->allocate_sub(p->chan_pvt, x); + if (p->calls->allocate_sub) { + int res; + res = p->calls->allocate_sub(p->chan_pvt, x); + if (!res) + p->subs[x].allocd = 1; + return res; + } return 0; } |