Use defined AST_MAX_ACCOUNT_CODE (bug #4350)
authorMark Spencer <markster@digium.com>
Wed, 25 May 2005 17:18:05 +0000 (17:18 +0000)
committerMark Spencer <markster@digium.com>
Wed, 25 May 2005 17:18:05 +0000 (17:18 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5765 65c4cc65-6c06-0410-ace0-fbb531ad65f3

cdr.c
channels/chan_iax2.c
channels/chan_mgcp.c
channels/chan_sip.c
channels/chan_skinny.c
channels/chan_zap.c
channels/h323/chan_h323.h
include/asterisk/cdr.h
include/asterisk/channel.h

diff --git a/cdr.c b/cdr.c
index 76559d0..c2c2c2f 100755 (executable)
--- a/cdr.c
+++ b/cdr.c
@@ -29,7 +29,7 @@
 #include "asterisk/utils.h"
 
 int ast_default_amaflags = AST_CDR_DOCUMENTATION;
-char ast_default_accountcode[20] = "";
+char ast_default_accountcode[AST_MAX_ACCOUNT_CODE] = "";
 
 struct ast_cdr_beitem {
        char name[20];
index cd20df7..266c297 100755 (executable)
@@ -196,7 +196,7 @@ static int test_jit = 0;
 static int test_jitpct = 0;
 #endif /* IAXTESTS */
 
-static char accountcode[20];
+static char accountcode[AST_MAX_ACCOUNT_CODE];
 static int amaflags = 0;
 static int delayreject = 0;
 static int iax2_encryption = 0;
@@ -249,7 +249,7 @@ struct iax2_user {
        char dbsecret[80];
        int authmethods;
        int encmethods;
-       char accountcode[20];
+       char accountcode[AST_MAX_ACCOUNT_CODE];
        char inkeys[80];                                /* Key(s) this user can use to authenticate to us */
        char language[MAX_LANGUAGE];
        int amaflags;
@@ -544,7 +544,7 @@ struct chan_iax2_pvt {
        int calling_tns;
        int calling_pres;
        char dproot[AST_MAX_EXTENSION];
-       char accountcode[20];
+       char accountcode[AST_MAX_ACCOUNT_CODE];
        int amaflags;
        struct iax2_dpcache *dpentries;
        struct ast_variable *vars;
index ba6c7e5..acac065 100755 (executable)
@@ -211,7 +211,7 @@ static int canreinvite = CANREINVITE;
 
 /*static int callprogress = 0;*/
 
-static char accountcode[20] = "";
+static char accountcode[AST_MAX_ACCOUNT_CODE] = "";
 
 static char mailbox[AST_MAX_EXTENSION];
 
@@ -361,7 +361,7 @@ struct mgcp_endpoint {
        ast_mutex_t lock;
        char name[80];
        struct mgcp_subchannel *sub;            /* pointer to our current connection, channel and stuff */
-       char accountcode[20];
+       char accountcode[AST_MAX_ACCOUNT_CODE];
        char exten[AST_MAX_EXTENSION];          /* Extention where to start */
        char context[AST_MAX_EXTENSION];
        char language[MAX_LANGUAGE];
index db64a63..90663be 100755 (executable)
@@ -446,7 +446,7 @@ static struct sip_pvt {
        char cid_name[256];                     /* Caller*ID */
        char via[256];                          /* Via: header */
        char fullcontact[128];                  /* The Contact: that the UA registers with us */
-       char accountcode[20];                   /* Account code */
+       char accountcode[AST_MAX_ACCOUNT_CODE]; /* Account code */
        char our_contact[256];                  /* Our contact header */
        char realm[MAXHOSTNAMELEN];             /* Authorization realm */
        char nonce[256];                        /* Authorization nonce */
@@ -512,7 +512,7 @@ struct sip_user {
        char context[AST_MAX_EXTENSION];        /* Default context for incoming calls */
        char cid_num[80];               /* Caller ID num */
        char cid_name[80];              /* Caller ID name */
-       char accountcode[20];           /* Account code */
+       char accountcode[AST_MAX_ACCOUNT_CODE]; /* Account code */
        char language[MAX_LANGUAGE];    /* Default language for this user */
        char musicclass[MAX_LANGUAGE];  /* Music on Hold class */
        char useragent[256];            /* User agent in SIP request */
@@ -541,7 +541,7 @@ struct sip_peer {
        struct sip_auth *auth;          /* Realm authentication list */
        char context[AST_MAX_EXTENSION];        /* Default context for incoming calls */
        char username[80];              /* Temporary username until registration */ 
-       char accountcode[20];           /* Account code */
+       char accountcode[AST_MAX_ACCOUNT_CODE]; /* Account code */
        int amaflags;                   /* AMA Flags (for billing) */
        char tohost[MAXHOSTNAMELEN];    /* If not dynamic, IP address */
        char regexten[AST_MAX_EXTENSION]; /* Extension to register (if regcontext is used) */
index 500efe9..9d29e2d 100755 (executable)
@@ -585,7 +585,7 @@ static int threewaycalling = 0;
 static int transfer = 0;
 static int cancallforward = 0;
 /* static int busycount = 3;*/
-static char accountcode[20] = "";
+static char accountcode[AST_MAX_ACCOUNT_CODE] = "";
 static char mailbox[AST_MAX_EXTENSION];
 static int amaflags = 0;
 static int callnums = 1;
@@ -704,7 +704,7 @@ struct skinny_line {
        char name[80];
        char label[42];                                 /* Label that shows next to the line buttons */
        struct skinny_subchannel *sub;                  /* pointer to our current connection, channel and stuff */
-       char accountcode[80];
+       char accountcode[AST_MAX_ACCOUNT_CODE];
        char exten[AST_MAX_EXTENSION];                  /* Extention where to start */
        char context[AST_MAX_EXTENSION];
        char language[MAX_LANGUAGE];
index bb3e37a..31964dd 100755 (executable)
@@ -229,7 +229,7 @@ static int busycount = 3;
 
 static int callprogress = 0;
 
-static char accountcode[20] = "";
+static char accountcode[AST_MAX_ACCOUNT_CODE] = "";
 
 static char mailbox[AST_MAX_EXTENSION];
 
@@ -580,7 +580,7 @@ static struct zt_pvt {
        int destroy;
        int ignoredtmf;                         
        int inalarm;
-       char accountcode[20];           /* Account code */
+       char accountcode[AST_MAX_ACCOUNT_CODE];         /* Account code */
        int amaflags;                           /* AMA Flags */
        char didtdd;                            /* flag to say its done it once */
        struct tdd_state *tdd;          /* TDD flag */
index c82edab..1ca681c 100755 (executable)
@@ -52,7 +52,7 @@ struct oh323_user {
        char context[80];
        char secret[80];
        char callerid[80];
-       char accountcode[20];
+       char accountcode[AST_MAX_ACCOUNT_CODE];
        int amaflags;
        int host;
        struct sockaddr_in addr;
index 67a5fb5..1e0c9a7 100755 (executable)
@@ -35,6 +35,7 @@
 #define AST_CDR_DOCUMENTATION                  (3)
 
 #define AST_MAX_USER_FIELD                     256
+#define AST_MAX_ACCOUNT_CODE                   20
 
 struct ast_channel;
 AST_LIST_HEAD(varshead,ast_var_t);
@@ -72,7 +73,7 @@ struct ast_cdr {
        /*! What flags to use */
        int amaflags;                           
        /*! What account number to use */
-       char accountcode[20];                   
+       char accountcode[AST_MAX_ACCOUNT_CODE];                 
        /*! flags */
        unsigned int flags;                             
        /* Unique Channel Identifier */
@@ -258,7 +259,7 @@ extern int ast_cdr_update(struct ast_channel *chan);
 
 extern int ast_default_amaflags;
 
-extern char ast_default_accountcode[20];
+extern char ast_default_accountcode[AST_MAX_ACCOUNT_CODE];
 
 extern struct ast_cdr *ast_cdr_append(struct ast_cdr *cdr, struct ast_cdr *newcdr);
 
index e3dd749..5335d28 100755 (executable)
@@ -278,7 +278,7 @@ struct ast_channel {
        /*! Set BEFORE PBX is started to determine AMA flags */
        int     amaflags;                       
        /*! Account code for billing */
-       char    accountcode[20];                
+       char    accountcode[AST_MAX_ACCOUNT_CODE];              
        /*! Call Detail Record */
        struct ast_cdr *cdr;                    
        /*! Whether or not ADSI is detected on CPE */