Index: pbx/pbx_config.c =================================================================== --- pbx/pbx_config.c (revision 43263) +++ pbx/pbx_config.c (working copy) @@ -2171,7 +2171,7 @@ int lastpri = -2; struct ast_context *con; struct ast_variable *v; - char *cxt; + const char *cxt; cfg = ast_config_load(config_file); if (!cfg) @@ -2340,8 +2340,8 @@ { struct ast_config *cfg; char *cat, *chan; - char *zapchan; - char *hasexten; + const char *zapchan; + const char *hasexten; char tmp[256]; char iface[256]; char zapcopy[256]; Index: channels/chan_zap.c =================================================================== --- channels/chan_zap.c (revision 43263) +++ channels/chan_zap.c (working copy) @@ -10307,7 +10307,7 @@ return __unload_module(); } -static int build_channels(int iscrv, char *value, int reload, int lineno, int *found_pseudo) +static int build_channels(int iscrv, const char *value, int reload, int lineno, int *found_pseudo) { char *c, *chan; int x, y, start, finish; @@ -10322,7 +10322,7 @@ return -1; } - c = value; + c = ast_strdupa(value); #ifdef HAVE_PRI pri = NULL; @@ -11147,7 +11147,7 @@ cfg = ast_config_load("users.conf"); if (cfg) { char *cat; - char *chans; + const char *chans; process_zap(ast_variable_browse(cfg, "general"), 1, 1); for (cat = ast_category_browse(cfg, NULL); cat ; cat = ast_category_browse(cfg, cat)) { if (!strcasecmp(cat, "general")) Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 43263) +++ channels/chan_sip.c (working copy) @@ -15975,7 +15975,7 @@ if (ucfg) { struct ast_variable *gen; int genhassip, genregistersip; - char *hassip, *registersip; + const char *hassip, *registersip; genhassip = ast_true(ast_variable_retrieve(ucfg, "general", "hassip")); genregistersip = ast_true(ast_variable_retrieve(ucfg, "general", "registersip")); @@ -15995,10 +15995,10 @@ } if (ast_true(registersip) || (!registersip && genregistersip)) { char tmp[256]; - char *host = ast_variable_retrieve(ucfg, cat, "host"); - char *username = ast_variable_retrieve(ucfg, cat, "username"); - char *secret = ast_variable_retrieve(ucfg, cat, "secret"); - char *contact = ast_variable_retrieve(ucfg, cat, "contact"); + const char *host = ast_variable_retrieve(ucfg, cat, "host"); + const char *username = ast_variable_retrieve(ucfg, cat, "username"); + const char *secret = ast_variable_retrieve(ucfg, cat, "secret"); + const char *contact = ast_variable_retrieve(ucfg, cat, "contact"); if (!host) host = ast_variable_retrieve(ucfg, "general", "host"); if (!username) Index: channels/iax2-provision.c =================================================================== --- channels/iax2-provision.c (revision 43263) +++ channels/iax2-provision.c (working copy) @@ -259,7 +259,7 @@ return ret; } -static int iax_template_parse(struct iax_template *cur, struct ast_config *cfg, char *s, char *def) +static int iax_template_parse(struct iax_template *cur, struct ast_config *cfg, const char *s, const char *def) { struct ast_variable *v; int foundportno = 0; @@ -269,7 +269,7 @@ struct hostent *hp; struct ast_hostent h; struct iax_template *src, tmp; - char *t; + const char *t; if (def) { t = ast_variable_retrieve(cfg, s ,"template"); src = NULL; Index: channels/chan_iax2.c =================================================================== --- channels/chan_iax2.c (revision 43263) +++ channels/chan_iax2.c (working copy) @@ -8796,8 +8796,8 @@ int capability=iax2_capability; struct ast_variable *v; char *cat; - char *utype; - char *tosval; + const char *utype; + const char *tosval; int format; int portno = IAX_DEFAULT_PORTNO; int x; @@ -9051,7 +9051,7 @@ struct ast_variable *gen; int genhasiax; int genregisteriax; - char *hasiax, *registeriax; + const char *hasiax, *registeriax; genhasiax = ast_true(ast_variable_retrieve(ucfg, "general", "hasiax")); genregisteriax = ast_true(ast_variable_retrieve(ucfg, "general", "registeriax")); @@ -9080,9 +9080,9 @@ } if (ast_true(registeriax) || (!registeriax && genregisteriax)) { char tmp[256]; - char *host = ast_variable_retrieve(ucfg, cat, "host"); - char *username = ast_variable_retrieve(ucfg, cat, "username"); - char *secret = ast_variable_retrieve(ucfg, cat, "secret"); + const char *host = ast_variable_retrieve(ucfg, cat, "host"); + const char *username = ast_variable_retrieve(ucfg, cat, "username"); + const char *secret = ast_variable_retrieve(ucfg, cat, "secret"); if (!host) host = ast_variable_retrieve(ucfg, "general", "host"); if (!username) Index: apps/app_festival.c =================================================================== --- apps/app_festival.c (revision 43263) +++ apps/app_festival.c (working copy) @@ -280,10 +280,10 @@ struct ast_hostent ahp; int fd; FILE *fs; - char *host; - char *cachedir; - char *temp; - char *festivalcommand; + const char *host; + const char *cachedir; + const char *temp; + const char *festivalcommand; int port=1314; int n; char ack[4]; Index: apps/app_rpt.c =================================================================== --- apps/app_rpt.c (revision 43263) +++ apps/app_rpt.c (working copy) @@ -394,17 +394,17 @@ struct { - char *ourcontext; - char *ourcallerid; - char *acctcode; - char *ident; + const char *ourcontext; + const char *ourcallerid; + const char *acctcode; + const char *ident; char *tonezone; char simple; - char *functions; - char *link_functions; - char *phone_functions; - char *dphone_functions; - char *nodes; + const char *functions; + const char *link_functions; + const char *phone_functions; + const char *dphone_functions; + const char *nodes; int hangtime; int totime; int idtime; @@ -414,9 +414,9 @@ int politeid; char *tailmessages[500]; int tailmessagemax; - char *memory; - char *macro; - char *startupmacro; + const char *memory; + const char *macro; + const char *startupmacro; int iobase; char funcchar; char endchar; @@ -900,7 +900,7 @@ -static int myatoi(char *str) +static int myatoi(const char *str) { int ret; @@ -941,7 +941,7 @@ static int retrieve_astcfgint(struct rpt *myrpt,char *category, char *name, int min, int max, int defl) { - char *var; + const char *var; int ret; var = ast_variable_retrieve(myrpt->cfg, category, name); @@ -960,7 +960,8 @@ static void load_rpt_vars(int n,int init) { -char *this,*val; +char *this; + const char *val; int j,longestnode; struct ast_variable *vp; struct ast_config *cfg; @@ -1021,11 +1022,11 @@ rpt_vars[n].p.idtime = retrieve_astcfgint(&rpt_vars[n],this, "idtime", 60000, 2400000, IDTIME); /* Enforce a min max */ rpt_vars[n].p.politeid = retrieve_astcfgint(&rpt_vars[n],this, "politeid", 30000, 300000, POLITEID); /* Enforce a min max */ val = ast_variable_retrieve(cfg,this,"tonezone"); - if (val) rpt_vars[n].p.tonezone = val; + if (val) rpt_vars[n].p.tonezone = ast_strdupa(val); rpt_vars[n].p.tailmessages[0] = 0; rpt_vars[n].p.tailmessagemax = 0; val = ast_variable_retrieve(cfg,this,"tailmessagelist"); - if (val) rpt_vars[n].p.tailmessagemax = finddelim(val, rpt_vars[n].p.tailmessages, 500); + if (val) rpt_vars[n].p.tailmessagemax = finddelim(ast_strdupa(val), rpt_vars[n].p.tailmessages, 500); val = ast_variable_retrieve(cfg,this,"memory"); if (!val) val = MEMORY; rpt_vars[n].p.memory = val; @@ -1069,7 +1070,7 @@ #ifdef __RPT_NOTCH val = ast_variable_retrieve(cfg,this,"rxnotch"); if (val) { - i = finddelim(val,strs,MAXFILTERS * 2); + i = finddelim(ast_strdupa(val),strs,MAXFILTERS * 2); i &= ~1; /* force an even number, rounded down */ if (i >= 2) for(j = 0; j < i; j += 2) { @@ -1523,7 +1524,7 @@ } -static int send_morse(struct ast_channel *chan, char *string, int speed, int freq, int amplitude) +static int send_morse(struct ast_channel *chan, const char *string, int speed, int freq, int amplitude) { static struct morse_bits mbits[] = { @@ -1685,7 +1686,7 @@ return res; } -static int send_tone_telemetry(struct ast_channel *chan, char *tonestring) +static int send_tone_telemetry(struct ast_channel *chan, const char *tonestring) { char *stringp; char *tonesubset; @@ -1737,7 +1738,7 @@ } -static int sayfile(struct ast_channel *mychannel,char *fname) +static int sayfile(struct ast_channel *mychannel, const char *fname) { int res; @@ -1776,7 +1777,7 @@ } -static int telem_any(struct rpt *myrpt,struct ast_channel *chan, char *entry) +static int telem_any(struct rpt *myrpt,struct ast_channel *chan, const char *entry) { int res; char c; @@ -1837,8 +1838,8 @@ int res; int i; - char *entry; - char *telemetry; + const char *entry; + const char *telemetry; char *telemetry_save; res = 0; @@ -1882,7 +1883,7 @@ static int get_wait_interval(struct rpt *myrpt, int type) { int interval; - char *wait_times; + const char *wait_times; char *wait_times_save; wait_times_save = NULL; @@ -1960,7 +1961,8 @@ struct rpt *myrpt; struct rpt_link *l,*m,linkbase; struct ast_channel *mychannel; -char *p,*ct,*ct_copy,*ident, *nodename; + const char *p, *ct; + char *ct_copy, *ident, *nodename; time_t t; struct tm localtm; @@ -2922,7 +2924,8 @@ static int function_ilink(struct rpt *myrpt, char *param, char *digits, int command_source, struct rpt_link *mylink) { - char *val, *s, *s1, *s2, *tele; + const char *val; + char *s, *s1, *s2, *tele; char tmp[300], deststr[300] = "",modechange = 0; char digitbuf[MAXNODESTR]; struct rpt_link *l; @@ -3445,7 +3448,7 @@ static int function_macro(struct rpt *myrpt, char *param, char *digitbuf, int command_source, struct rpt_link *mylink) { -char *val; + const char *val; int i; struct ast_channel *mychannel; @@ -4920,7 +4923,8 @@ static int function_remote(struct rpt *myrpt, char *param, char *digitbuf, int command_source, struct rpt_link *mylink) { - char *s,*s1,*s2,*val; + char *s,*s1,*s2; + const char *val; int i,j,ht,k,l,ls2,m,d,res,offset,offsave, modesave, defmode; char multimode = 0; char oc; @@ -4954,7 +4958,7 @@ sayfile(mychannel,"rpt/memory_notfound"); return DC_COMPLETE; } - strncpy(tmp,val,sizeof(tmp) - 1); + ast_copy_string(tmp, val, sizeof(tmp)); s = strchr(tmp,','); if (!s) return DC_ERROR; @@ -5773,7 +5777,8 @@ static int attempt_reconnect(struct rpt *myrpt, struct rpt_link *l) { - char *val, *s, *s1, *s2, *tele; + const char *val; + char *s, *s1, *s2, *tele; char tmp[300], deststr[300] = ""; val = ast_variable_retrieve(myrpt->cfg, myrpt->p.nodes, l->name); @@ -6018,7 +6023,8 @@ static void *rpt(void *this) { struct rpt *myrpt = (struct rpt *)this; -char *tele,*idtalkover,c; + char *tele, c; + const char *idtalkover; int ms = MSWAIT,i,lasttx=0,val,remrx=0,identqueued,othertelemqueued,tailmessagequeued,ctqueued; struct ast_channel *who; ZT_CONFINFO ci; /* conference info */ @@ -7156,7 +7162,8 @@ int i,n; pthread_attr_t attr; struct ast_config *cfg; -char *this,*val; + char *this; + const char *val; /* go thru all the specified repeaters */ this = NULL; @@ -7442,7 +7449,9 @@ struct ast_hostent ahp; struct hostent *hp; struct in_addr ia; - char hisip[100],nodeip[100],*val, *s, *s1, *s2, *b,*b1; + char hisip[100],nodeip[100]; + const char *val; + char *s, *s1, *s2, *b,*b1; /* look at callerid to see what node this comes from */ if (!chan->cid.cid_num) /* if doesn't have caller id */ Index: apps/app_meetme.c =================================================================== --- apps/app_meetme.c (revision 43263) +++ apps/app_meetme.c (working copy) @@ -2948,7 +2948,7 @@ static void load_config_meetme(void) { struct ast_config *cfg; - char *val; + const char *val; audio_buffers = DEFAULT_AUDIO_BUFFERS; Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 43263) +++ apps/app_voicemail.c (working copy) @@ -3800,7 +3800,8 @@ int res = 0, cmd = 0; struct ast_vm_user *receiver = NULL, *vmtmp; AST_LIST_HEAD_NOLOCK_STATIC(extensions, ast_vm_user); - char *stringp, *s; + char *stringp; + const char *s; int saved_messages = 0, found = 0; int valid_extensions = 0; char *dir; @@ -4097,7 +4098,7 @@ return ast_control_streamfile(chan, file, "#", "*", "1456789", "0", "2", skipms); } -static int play_message_category(struct ast_channel *chan, char *category) +static int play_message_category(struct ast_channel *chan, const char *category) { int res = 0; @@ -4112,7 +4113,7 @@ return res; } -static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *vmu, char *origtime, char *filename) +static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *vmu, const char *origtime, const char *filename) { int res = 0; struct vm_zone *the_zone = NULL; @@ -4180,7 +4181,7 @@ -static int play_message_callerid(struct ast_channel *chan, struct vm_state *vms, char *cid, char *context, int callback) +static int play_message_callerid(struct ast_channel *chan, struct vm_state *vms, char *cid, const char *context, int callback) { int res = 0; int i; @@ -4243,7 +4244,7 @@ return res; } -static int play_message_duration(struct ast_channel *chan, struct vm_state *vms, char *duration, int minduration) +static int play_message_duration(struct ast_channel *chan, struct vm_state *vms, const char *duration, int minduration) { int res = 0; int durationm; @@ -4412,8 +4413,8 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms) { int res = 0; - char filename[256],*origtime, *cid, *context, *duration; - char *category; + char filename[256], *cid; + const char *origtime, *context, *category, *duration; struct ast_config *msg_cfg; vms->starting = 0; @@ -6848,44 +6849,45 @@ struct ast_config *cfg, *ucfg; char *cat; struct ast_variable *var; - char *notifystr = NULL; - char *smdistr = NULL; - char *astattach; - char *astsearch; - char *astsaycid; - char *send_voicemail; + const char *notifystr = NULL; + const char *smdistr = NULL; + const char *astattach; + const char *astsearch; + const char *astsaycid; + const char *send_voicemail; #ifdef IMAP_STORAGE - char *imap_server; - char *imap_port; - char *imap_flags; - char *auth_user; - char *auth_password; - char *expunge_on_hangup; + const char *imap_server; + const char *imap_port; + const char *imap_flags; + const char *auth_user; + const char *auth_password; + const char *expunge_on_hangup; #endif - char *astcallop; - char *astreview; - char *asttempgreetwarn; - char *astskipcmd; - char *asthearenv; - char *astsaydurationinfo; - char *astsaydurationminfo; - char *silencestr; - char *maxmsgstr; - char *astdirfwd; - char *thresholdstr; - char *fmt; - char *astemail; - char *ucontext; - char *astmailcmd = SENDMAIL; - char *astforcename; - char *astforcegreet; - char *s,*q,*stringp; - char *dialoutcxt = NULL; - char *callbackcxt = NULL; - char *exitcxt = NULL; - char *extpc; - char *emaildateformatstr; - char *volgainstr; + const char *astcallop; + const char *astreview; + const char *asttempgreetwarn; + const char *astskipcmd; + const char *asthearenv; + const char *astsaydurationinfo; + const char *astsaydurationminfo; + const char *silencestr; + const char *maxmsgstr; + const char *astdirfwd; + const char *thresholdstr; + const char *fmt; + const char *astemail; + const char *ucontext; + const char *astmailcmd = SENDMAIL; + const char *astforcename; + const char *astforcegreet; + const char *s; + char *q,*stringp; + const char *dialoutcxt = NULL; + const char *callbackcxt = NULL; + const char *exitcxt = NULL; + const char *extpc; + const char *emaildateformatstr; + const char *volgainstr; int x; int tmpadsi[4]; @@ -7471,7 +7473,8 @@ #endif char filename[256]; struct ast_config *msg_cfg; - char *origtime, *cid, *context, *name, *num; + const char *origtime, *context; + char *cid, *name, *num; int retries = 0; vms->starting = 0; Index: apps/app_directory.c =================================================================== --- apps/app_directory.c (revision 43263) +++ apps/app_directory.c (working copy) @@ -183,7 +183,7 @@ } #endif -static char *convert(char *lastname) +static char *convert(const char *lastname) { char *tmp; int lcount = 0; @@ -342,8 +342,8 @@ struct ast_category *cat; struct ast_variable *var; char *mailbox; - char *fullname; - char *hidefromdir; + const char *fullname; + const char *hidefromdir; char tmp[100]; /* Load flat file config. */ @@ -402,7 +402,8 @@ int res; int found=0; int lastuserchoice = 0; - char *start, *pos, *conv,*stringp=NULL; + char *start, *conv, *stringp = NULL; + const char *pos; if (ast_strlen_zero(context)) { ast_log(LOG_WARNING, @@ -570,7 +571,8 @@ int last = 1; int readext = 0; int fromappvm = 0; - char *dirintro, *parse; + const char *dirintro; + char *parse; AST_DECLARE_APP_ARGS(args, AST_APP_ARG(vmcontext); AST_APP_ARG(dialcontext); Index: apps/app_privacy.c =================================================================== --- apps/app_privacy.c (revision 43263) +++ apps/app_privacy.c (working copy) @@ -82,7 +82,7 @@ int maxretries = 3; int minlength = 10; int x = 0; - char *s; + const char *s; char phone[30]; struct ast_module_user *u; struct ast_config *cfg = NULL; Index: apps/app_queue.c =================================================================== --- apps/app_queue.c (revision 43263) +++ apps/app_queue.c (working copy) @@ -3666,7 +3666,7 @@ struct ast_variable *var; struct member *prev, *cur, *newm; int new; - char *general_val = NULL; + const char *general_val = NULL; char interface[80]; int penalty; Index: funcs/func_odbc.c =================================================================== --- funcs/func_odbc.c (revision 43263) +++ funcs/func_odbc.c (working copy) @@ -350,7 +350,7 @@ static int init_acf_query(struct ast_config *cfg, char *catg, struct acf_odbc_query **query) { - char *tmp; + const char *tmp; if (!cfg || !catg) { return -1; Index: include/asterisk/config.h =================================================================== --- include/asterisk/config.h (revision 43263) +++ include/asterisk/config.h (working copy) @@ -100,7 +100,7 @@ * * Returns the variable value on success, or NULL if unable to find it. */ -char *ast_variable_retrieve(const struct ast_config *config, const char *category, const char *variable); +const char *ast_variable_retrieve(const struct ast_config *config, const char *category, const char *variable); /*! \brief Retrieve a category if it exists * \param config which config to use @@ -172,7 +172,7 @@ struct ast_config *ast_config_new(void); struct ast_category *ast_config_get_current_category(const struct ast_config *cfg); void ast_config_set_current_category(struct ast_config *cfg, const struct ast_category *cat); -char *ast_config_option(struct ast_config *cfg, const char *cat, const char *var); +const char *ast_config_option(struct ast_config *cfg, const char *cat, const char *var); struct ast_category *ast_category_new(const char *name); void ast_category_append(struct ast_config *config, struct ast_category *cat); Index: main/config.c =================================================================== --- main/config.c (revision 43263) +++ main/config.c (working copy) @@ -147,9 +147,9 @@ return (cat) ? cat->root : NULL; } -char *ast_config_option(struct ast_config *cfg, const char *cat, const char *var) +const char *ast_config_option(struct ast_config *cfg, const char *cat, const char *var) { - char *tmp; + const char *tmp; tmp = ast_variable_retrieve(cfg, cat, var); if (!tmp) tmp = ast_variable_retrieve(cfg, "general", var); @@ -157,7 +157,7 @@ } -char *ast_variable_retrieve(const struct ast_config *config, const char *category, const char *variable) +const char *ast_variable_retrieve(const struct ast_config *config, const char *category, const char *variable) { struct ast_variable *v; Index: main/manager.c =================================================================== --- main/manager.c (revision 43263) +++ main/manager.c (working copy) @@ -662,9 +662,9 @@ ast_instring("this|that|more","this",',') == 1; feel free to move this to app.c -anthm */ -static int ast_instring(char *bigstr, char *smallstr, char delim) +static int ast_instring(const char *bigstr, const char *smallstr, char delim) { - char *val = bigstr, *next; + const char *val = bigstr, *next; do { if ((next = strchr(val, delim))) { @@ -680,7 +680,7 @@ return 0; } -static int get_perm(char *instr) +static int get_perm(const char *instr) { int x = 0, ret = 0; @@ -2472,7 +2472,7 @@ int init_manager(void) { struct ast_config *cfg; - char *val; + const char *val; int oldportno = portno; static struct sockaddr_in ba; int x = 1; Index: main/rtp.c =================================================================== --- main/rtp.c (revision 43263) +++ main/rtp.c (working copy) @@ -3430,7 +3430,7 @@ int ast_rtp_reload(void) { struct ast_config *cfg; - char *s; + const char *s; rtpstart = 5000; rtpend = 31000; Index: main/udptl.c =================================================================== --- main/udptl.c (revision 43263) +++ main/udptl.c (working copy) @@ -1183,7 +1183,7 @@ void ast_udptl_reload(void) { struct ast_config *cfg; - char *s; + const char *s; udptlstart = 4500; udptlend = 4999; Index: main/logger.c =================================================================== --- main/logger.c (revision 43263) +++ main/logger.c (working copy) @@ -286,7 +286,7 @@ struct logchannel *chan; struct ast_config *cfg; struct ast_variable *var; - char *s; + const char *s; /* delete our list of log channels */ AST_LIST_LOCK(&logchannels); Index: cdr/cdr_odbc.c =================================================================== --- cdr/cdr_odbc.c (revision 43263) +++ cdr/cdr_odbc.c (working copy) @@ -246,7 +246,7 @@ int res = 0; struct ast_config *cfg; struct ast_variable *var; - char *tmp; + const char *tmp; ast_mutex_lock(&odbc_lock); Index: cdr/cdr_csv.c =================================================================== --- cdr/cdr_csv.c (revision 43263) +++ cdr/cdr_csv.c (working copy) @@ -98,7 +98,7 @@ { struct ast_config *cfg; struct ast_variable *var; - char *tmp; + const char *tmp; usegmtime = 0; loguniqueid = 0;