Constify the result of a config retrieval function, to avoid mutilation (issue 7983).
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43364 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
9a47f67020
commit
e8ef9fd3ba
|
@ -183,7 +183,7 @@ static void retrieve_file(char *dir)
|
|||
}
|
||||
#endif
|
||||
|
||||
static char *convert(char *lastname)
|
||||
static char *convert(const char *lastname)
|
||||
{
|
||||
char *tmp;
|
||||
int lcount = 0;
|
||||
|
@ -342,8 +342,8 @@ static struct ast_config *realtime_directory(char *context)
|
|||
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 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, struct
|
|||
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 @@ static int directory_exec(struct ast_channel *chan, void *data)
|
|||
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);
|
||||
|
|
|
@ -280,10 +280,10 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
|
|||
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];
|
||||
|
|
|
@ -2948,7 +2948,7 @@ static int slastate(const char *data)
|
|||
static void load_config_meetme(void)
|
||||
{
|
||||
struct ast_config *cfg;
|
||||
char *val;
|
||||
const char *val;
|
||||
|
||||
audio_buffers = DEFAULT_AUDIO_BUFFERS;
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ static int privacy_exec (struct ast_channel *chan, void *data)
|
|||
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;
|
||||
|
|
|
@ -596,7 +596,7 @@ static int statechange_queue(const char *dev, int state, void *ign)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct member *create_queue_member(char *interface, char *membername, int penalty, int paused)
|
||||
static struct member *create_queue_member(char *interface, const char *membername, int penalty, int paused)
|
||||
{
|
||||
struct member *cur;
|
||||
|
||||
|
@ -912,7 +912,7 @@ static void queue_set_param(struct call_queue *q, const char *param, const char
|
|||
}
|
||||
}
|
||||
|
||||
static void rt_handle_member_record(struct call_queue *q, char *interface, char *membername, const char *penalty_str)
|
||||
static void rt_handle_member_record(struct call_queue *q, char *interface, const char *membername, const char *penalty_str)
|
||||
{
|
||||
struct member *m, *prev_m;
|
||||
int penalty = 0;
|
||||
|
@ -3691,7 +3691,7 @@ static int reload_queues(void)
|
|||
struct ast_variable *var;
|
||||
struct member *prev, *cur, *newm;
|
||||
int new;
|
||||
char *general_val = NULL;
|
||||
const char *general_val = NULL;
|
||||
char parse[80];
|
||||
char *interface;
|
||||
char *membername;
|
||||
|
|
|
@ -394,17 +394,17 @@ static struct rpt
|
|||
|
||||
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 @@ static struct rpt
|
|||
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 @@ int i;
|
|||
|
||||
|
||||
|
||||
static int myatoi(char *str)
|
||||
static int myatoi(const char *str)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
@ -941,7 +941,7 @@ struct rptfilter *f;
|
|||
|
||||
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 int retrieve_astcfgint(struct rpt *myrpt,char *category, char *name, int
|
|||
|
||||
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 @@ char *strs[100];
|
|||
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 @@ char *strs[100];
|
|||
#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 play_silence(struct ast_channel *chan, int duration)
|
|||
}
|
||||
|
||||
|
||||
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 @@ static struct morse_bits mbits[] = {
|
|||
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 send_tone_telemetry(struct ast_channel *chan, char *tonestring)
|
|||
}
|
||||
|
||||
|
||||
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 saynum(struct ast_channel *mychannel, int num)
|
|||
}
|
||||
|
||||
|
||||
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 @@ static int telem_lookup(struct rpt *myrpt,struct ast_channel *chan, char *node,
|
|||
|
||||
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 telem_lookup(struct rpt *myrpt,struct ast_channel *chan, char *node,
|
|||
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_tele *tlist;
|
|||
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 @@ struct rpt_link *l;
|
|||
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_status(struct rpt *myrpt, char *param, char *digitbuf, int c
|
|||
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 rmt_saycharstr(struct rpt *myrpt, struct ast_channel *chan, int delay
|
|||
|
||||
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 @@ static int function_remote(struct rpt *myrpt, char *param, char *digitbuf, int c
|
|||
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 @@ int res;
|
|||
|
||||
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 do_scheduler(struct rpt *myrpt)
|
|||
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 @@ static void *rpt_master(void *config)
|
|||
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 @@ static int rpt_exec(struct ast_channel *chan, void *data)
|
|||
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 */
|
||||
|
|
|
@ -3800,7 +3800,8 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
|
|||
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 @@ static int wait_file(struct ast_channel *chan, struct vm_state *vms, char *file)
|
|||
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 @@ static int play_message_category(struct ast_channel *chan, char *category)
|
|||
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_datetime(struct ast_channel *chan, struct ast_vm_user *v
|
|||
|
||||
|
||||
|
||||
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 @@ static int play_message_callerid(struct ast_channel *chan, struct vm_state *vms,
|
|||
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, struc
|
|||
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;
|
||||
|
@ -6851,44 +6852,45 @@ static int load_config(void)
|
|||
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];
|
||||
|
||||
|
@ -7474,7 +7476,8 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
|
|||
#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;
|
||||
|
|
|
@ -98,7 +98,7 @@ static int load_config(void)
|
|||
{
|
||||
struct ast_config *cfg;
|
||||
struct ast_variable *var;
|
||||
char *tmp;
|
||||
const char *tmp;
|
||||
|
||||
usegmtime = 0;
|
||||
loguniqueid = 0;
|
||||
|
|
|
@ -246,7 +246,7 @@ static int odbc_load_module(void)
|
|||
int res = 0;
|
||||
struct ast_config *cfg;
|
||||
struct ast_variable *var;
|
||||
char *tmp;
|
||||
const char *tmp;
|
||||
|
||||
ast_mutex_lock(&odbc_lock);
|
||||
|
||||
|
|
|
@ -8796,8 +8796,8 @@ static int set_config(char *config_file, int reload)
|
|||
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 @@ static int set_config(char *config_file, int reload)
|
|||
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 @@ static int set_config(char *config_file, int reload)
|
|||
}
|
||||
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)
|
||||
|
|
|
@ -15975,7 +15975,7 @@ static int reload_config(enum channelreloadreason reason)
|
|||
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 @@ static int reload_config(enum channelreloadreason reason)
|
|||
}
|
||||
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)
|
||||
|
|
|
@ -10322,7 +10322,7 @@ static int unload_module(void)
|
|||
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;
|
||||
|
@ -10337,7 +10337,7 @@ static int build_channels(int iscrv, char *value, int reload, int lineno, int *f
|
|||
return -1;
|
||||
}
|
||||
|
||||
c = value;
|
||||
c = ast_strdupa(value);
|
||||
|
||||
#ifdef HAVE_PRI
|
||||
pri = NULL;
|
||||
|
@ -11162,7 +11162,7 @@ static int setup_zap(int reload)
|
|||
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"))
|
||||
|
|
|
@ -259,7 +259,7 @@ int iax_provision_version(unsigned int *version, const char *template, int force
|
|||
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 @@ static int iax_template_parse(struct iax_template *cur, struct ast_config *cfg,
|
|||
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;
|
||||
|
|
|
@ -350,7 +350,7 @@ static struct ast_custom_function escape_function = {
|
|||
|
||||
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;
|
||||
|
|
|
@ -100,7 +100,7 @@ struct ast_variable *ast_variable_browse(const struct ast_config *config, const
|
|||
*
|
||||
* 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 @@ int read_config_maps(void);
|
|||
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);
|
||||
|
|
|
@ -147,9 +147,9 @@ struct ast_variable *ast_variable_browse(const struct ast_config *config, const
|
|||
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_config_option(struct ast_config *cfg, const char *cat, const char *var
|
|||
}
|
||||
|
||||
|
||||
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;
|
||||
|
||||
|
|
|
@ -286,7 +286,7 @@ static void init_logger_chain(void)
|
|||
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);
|
||||
|
|
|
@ -776,9 +776,9 @@ void astman_send_ack(struct mansession *s, struct message *m, char *msg)
|
|||
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))) {
|
||||
|
@ -794,7 +794,7 @@ static int ast_instring(char *bigstr, char *smallstr, char delim)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int get_perm(char *instr)
|
||||
static int get_perm(const char *instr)
|
||||
{
|
||||
int x = 0, ret = 0;
|
||||
|
||||
|
@ -2586,7 +2586,8 @@ static int webregged = 0;
|
|||
int init_manager(void)
|
||||
{
|
||||
struct ast_config *cfg = NULL;
|
||||
char *val, *cat = NULL;
|
||||
const char *val;
|
||||
char *cat = NULL;
|
||||
int oldportno = portno;
|
||||
static struct sockaddr_in ba;
|
||||
int x = 1;
|
||||
|
|
|
@ -3452,7 +3452,7 @@ static struct ast_cli_entry cli_rtp[] = {
|
|||
int ast_rtp_reload(void)
|
||||
{
|
||||
struct ast_config *cfg;
|
||||
char *s;
|
||||
const char *s;
|
||||
|
||||
rtpstart = 5000;
|
||||
rtpend = 31000;
|
||||
|
|
|
@ -1183,7 +1183,7 @@ static struct ast_cli_entry cli_udptl[] = {
|
|||
void ast_udptl_reload(void)
|
||||
{
|
||||
struct ast_config *cfg;
|
||||
char *s;
|
||||
const char *s;
|
||||
|
||||
udptlstart = 4500;
|
||||
udptlend = 4999;
|
||||
|
|
|
@ -2171,7 +2171,7 @@ static int pbx_load_config(const char *config_file)
|
|||
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 @@ static void pbx_load_users(void)
|
|||
{
|
||||
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];
|
||||
|
|
Reference in New Issue