diff options
author | jpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-07-17 17:02:44 +0000 |
---|---|---|
committer | jpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-07-17 17:02:44 +0000 |
commit | 1fa59dc194f8a89003501aba9dc90b6846b8e1a1 (patch) | |
tree | 350acc395c3bb7c0ce368a150dfddfe45eb78b12 /channels/sig_analog.c | |
parent | f7e5b0d061e357d0bf56130b5746a509c940540a (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: http://svn.digium.com/svn/asterisk/trunk@206998 f38db490-d61c-443f-a65b-d21fe96a405b
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; } |