From 76e257a8f9ef1cb4980508432c6979125837faee Mon Sep 17 00:00:00 2001 From: Jason Parker Date: Thu, 1 May 2008 16:52:07 +0000 Subject: [PATCH] Merged revisions 114922 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r114922 | qwell | 2008-05-01 11:49:24 -0500 (Thu, 01 May 2008) | 10 lines Allow dringXrange to properly default to 10, as was done in 1.4. dringXrange is a new feature that was added, and it attempted to default, but only when the option was specified. (closes issue #12536) Reported by: bjm Patches: 12536-dringXrange.diff uploaded by qwell (license 4) Tested by: bjm ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@114923 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_zap.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 52aabbb108..c267116d1c 100644 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -8374,7 +8374,15 @@ static struct zt_pvt *mkintf(int channel, struct zt_chan_conf conf, struct zt_pr if (conf.timing.debouncetime >= 0) p.debouncetime = conf.timing.debouncetime; } - + + /* 10 is a nice default. */ + if (conf.chan.drings.ringnum[0].range == 0) + conf.chan.drings.ringnum[0].range = 10; + if (conf.chan.drings.ringnum[1].range == 0) + conf.chan.drings.ringnum[1].range = 10; + if (conf.chan.drings.ringnum[2].range == 0) + conf.chan.drings.ringnum[2].range = 10; + /* dont set parms on a pseudo-channel (or CRV) */ if (tmp->subs[SUB_REAL].zfd >= 0) { @@ -13296,19 +13304,10 @@ static int process_zap(struct zt_chan_conf *confp, struct ast_variable *v, int r ast_copy_string(confp->chan.drings.ringContext[2].contextData,v->value,sizeof(confp->chan.drings.ringContext[2].contextData)); } else if (!strcasecmp(v->name, "dring1range")) { confp->chan.drings.ringnum[0].range = atoi(v->value); - /* 10 is a nice default. */ - if (confp->chan.drings.ringnum[0].range == 0) - confp->chan.drings.ringnum[0].range = 10; } else if (!strcasecmp(v->name, "dring2range")) { confp->chan.drings.ringnum[1].range = atoi(v->value); - /* 10 is a nice default. */ - if (confp->chan.drings.ringnum[1].range == 0) - confp->chan.drings.ringnum[1].range = 10; } else if (!strcasecmp(v->name, "dring3range")) { confp->chan.drings.ringnum[2].range = atoi(v->value); - /* 10 is a nice default. */ - if (confp->chan.drings.ringnum[2].range == 0) - confp->chan.drings.ringnum[2].range = 10; } else if (!strcasecmp(v->name, "dring1")) { ringc = v->value; sscanf(ringc, "%d,%d,%d", &confp->chan.drings.ringnum[0].ring[0], &confp->chan.drings.ringnum[0].ring[1], &confp->chan.drings.ringnum[0].ring[2]);