From 827033996564555805994b70d84b5e717ca6f9ee Mon Sep 17 00:00:00 2001 From: Jeff Peeler Date: Fri, 17 Jul 2009 17:02:44 +0000 Subject: 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 --- channels/sig_analog.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'channels/sig_analog.c') 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; } -- cgit v1.2.3