Index: channels/chan_dahdi.c =================================================================== --- channels/chan_dahdi.c (revision 272526) +++ channels/chan_dahdi.c (working copy) @@ -1656,7 +1656,7 @@ { unsigned char buf[256]; int distMatches; - int curRingData[3]; + int curRingData[RING_PATTERNS]; int receivedRingT; int counter1; int counter; @@ -1677,7 +1677,7 @@ * distinctive ringing */ if ((checkaftercid && distinctiveringaftercid) || !checkaftercid) { /* Clear the current ring data array so we dont have old data in it. */ - for (receivedRingT = 0; receivedRingT < ARRAY_LEN(ringdata); receivedRingT++) + for (receivedRingT = 0; receivedRingT < RING_PATTERNS; receivedRingT++) ringdata[receivedRingT] = 0; receivedRingT = 0; if (checkaftercid && distinctiveringaftercid) @@ -1711,7 +1711,7 @@ break; /* Increment the ringT counter so we can match it against values in chan_dahdi.conf for distinctive ring */ - if (++receivedRingT == ARRAY_LEN(ringdata)) + if (++receivedRingT == RING_PATTERNS) break; } else if (i & DAHDI_IOMUX_READ) { res = read(p->subs[idx].dfd, buf, sizeof(buf)); Index: channels/sig_analog.c =================================================================== --- channels/sig_analog.c (revision 272526) +++ channels/sig_analog.c (working copy) @@ -2284,7 +2284,7 @@ int timeout = 10000; /* Ten seconds */ struct timeval start = ast_tvnow(); enum analog_event ev; - int curRingData[3] = { 0 }; + int curRingData[RING_PATTERNS] = { 0 }; int receivedRingT = 0; namebuf[0] = 0; @@ -2318,7 +2318,7 @@ } /* Increment the ringT counter so we can match it against values in chan_dahdi.conf for distinctive ring */ - if (++receivedRingT == ARRAY_LEN(curRingData)) { + if (++receivedRingT == RING_PATTERNS) { break; } } Index: channels/sig_analog.h =================================================================== --- channels/sig_analog.h (revision 272526) +++ channels/sig_analog.h (working copy) @@ -28,6 +28,10 @@ #include "asterisk/channel.h" #include "asterisk/frame.h" +#define ANALOG_MAX_CID 300 +#define READ_SIZE 160 +#define RING_PATTERNS 3 + /* Signalling types supported */ enum analog_sigtype { ANALOG_SIG_NONE = -1, @@ -110,8 +114,6 @@ ANALOG_CID_START_DTMF_NOALERT, }; -#define ANALOG_MAX_CID 300 - enum dialop { ANALOG_DIAL_OP_REPLACE = 2, }; @@ -221,8 +223,6 @@ -#define READ_SIZE 160 - struct analog_subchannel { struct ast_channel *owner; struct ast_frame f; /*!< One frame for each channel. How did this ever work before? */