In chan_dahdi.conf, the user can now use length 4 patterns in addition to the usual length 2 patterns. The s
ntax remains the same and the method used to track the pattern history will only change when using the length
4 patterns.
(closes issue SWP-3250)
Code:
jrose
rmudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@312384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
/* Scans the string for the next value in the pattern. If none, it checks to see if any have been entered so far. */
if(!sscanf(v->value,"%30d",&norval)&&count_pattern==0){ast_log(LOG_ERROR,"busypattern= expects either busypattern=tonelength,quietlength or busypattern=t1length, q1length, t2length, q2length at line %d.\n",v->lineno);
break;
}
busy_cadence->pattern[count_pattern]=norval;
count_pattern++;
if(count_pattern==4){
break;
}
temp=strchr(v->value,',');
if(temp==NULL){
break;
}
v->value=temp+1;
}
busy_cadence->length=count_pattern;
if(count_pattern%2!=0){
/* The pattern length must be divisible by two */
ast_log(LOG_ERROR,"busypattern= expects either busypattern=tonelength,quietlength or busypattern=t1length, q1length, t2length, q2length at line %d.\n",v->lineno);
ast_debug(1,"dsp busy pattern set to %d,%d\n",tonelength,quietlength);
dsp->busy_cadence=*cadence;
ast_debug(1,"dsp busy pattern set to %d,%d,%d,%d\n",cadence->pattern[0],cadence->pattern[1],(cadence->length==4)?cadence->pattern[2]:0,(cadence->length==4)?cadence->pattern[3]:0);