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/chan_dahdi.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'channels/chan_dahdi.c') diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 1890bbb3d..9bfddae2f 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -10999,7 +10999,7 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf, analog_p->polarityonanswerdelay = conf->chan.polarityonanswerdelay; analog_p->answeronpolarityswitch = conf->chan.answeronpolarityswitch; analog_p->hanguponpolarityswitch = conf->chan.hanguponpolarityswitch; - analog_p->permcallwaiting = 1; + analog_p->permcallwaiting = conf->chan.callwaiting; /* permcallwaiting possibly modified in analog_config_complete */ analog_p->callreturn = conf->chan.callreturn; analog_p->cancallforward = conf->chan.cancallforward; analog_p->canpark = conf->chan.canpark; @@ -11016,7 +11016,7 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf, analog_p->cid_signalling = conf->chan.cid_signalling; analog_p->stripmsd = conf->chan.stripmsd; analog_p->cid_start = ANALOG_CID_START_RING; - tmp->callwaitingcallerid = analog_p->callwaitingcallerid = 1; + analog_p->callwaitingcallerid = conf->chan.callwaitingcallerid; analog_p->usedistinctiveringdetection = conf->chan.usedistinctiveringdetection; analog_p->ringt = conf->chan.ringt; analog_p->ringt_base = ringt_base; @@ -11322,12 +11322,6 @@ static struct ast_channel *dahdi_request(const char *type, int format, const str break; } } - if (p->owner) { - if (alloc_sub(p, SUB_CALLWAIT)) { - p = NULL; - break; - } - } p->outgoing = 1; if (analog_lib_handles(p->sig, p->radio, p->oprmode)) { tmp = analog_request(p->sig_pvt, &callwait, requestor); -- cgit v1.2.3