aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-21 21:13:09 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-21 21:13:09 +0000
commit230a66da7d98b2b6d328a04b0e7180b94d9c76bf (patch)
treeb40d978190102dbe6f14458ab8a70f358db533e4 /apps
parentd57c20e50d7105f72bb90e709965ad5e04c5e36a (diff)
Const-ify the world (or at least a good part of it)
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes: - CLI command handlers - CLI command handler arguments - AGI command handlers - AGI command handler arguments - Dialplan application handler arguments - Speech engine API function arguments In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing. Review: https://reviewboard.asterisk.org/r/251/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196072 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_adsiprog.c68
-rw-r--r--apps/app_alarmreceiver.c4
-rw-r--r--apps/app_amd.c4
-rw-r--r--apps/app_authenticate.c2
-rw-r--r--apps/app_cdr.c4
-rw-r--r--apps/app_chanisavail.c2
-rw-r--r--apps/app_channelredirect.c2
-rw-r--r--apps/app_chanspy.c15
-rw-r--r--apps/app_confbridge.c2
-rw-r--r--apps/app_controlplayback.c2
-rw-r--r--apps/app_dahdibarge.c2
-rw-r--r--apps/app_dahdiras.c2
-rw-r--r--apps/app_db.c4
-rw-r--r--apps/app_dial.c6
-rw-r--r--apps/app_dictate.c2
-rw-r--r--apps/app_directed_pickup.c4
-rw-r--r--apps/app_directory.c2
-rw-r--r--apps/app_disa.c2
-rw-r--r--apps/app_dumpchan.c2
-rw-r--r--apps/app_echo.c2
-rw-r--r--apps/app_exec.c6
-rw-r--r--apps/app_externalivr.c2
-rw-r--r--apps/app_fax.c4
-rw-r--r--apps/app_festival.c2
-rw-r--r--apps/app_flash.c2
-rw-r--r--apps/app_followme.c9
-rw-r--r--apps/app_forkcdr.c2
-rw-r--r--apps/app_getcpeid.c2
-rw-r--r--apps/app_ices.c2
-rw-r--r--apps/app_image.c2
-rw-r--r--apps/app_ivrdemo.c10
-rw-r--r--apps/app_jack.c9
-rw-r--r--apps/app_macro.c16
-rw-r--r--apps/app_meetme.c23
-rw-r--r--apps/app_milliwatt.c6
-rw-r--r--apps/app_minivm.c12
-rw-r--r--apps/app_mixmonitor.c4
-rw-r--r--apps/app_morsecode.c10
-rw-r--r--apps/app_mp3.c2
-rw-r--r--apps/app_nbscat.c2
-rw-r--r--apps/app_originate.c2
-rw-r--r--apps/app_osplookup.c10
-rw-r--r--apps/app_page.c2
-rw-r--r--apps/app_parkandannounce.c2
-rw-r--r--apps/app_playback.c4
-rw-r--r--apps/app_playtones.c4
-rw-r--r--apps/app_privacy.c2
-rw-r--r--apps/app_queue.c32
-rw-r--r--apps/app_read.c4
-rw-r--r--apps/app_readexten.c2
-rw-r--r--apps/app_readfile.c2
-rw-r--r--apps/app_record.c2
-rw-r--r--apps/app_rpt.c4
-rw-r--r--apps/app_sayunixtime.c2
-rw-r--r--apps/app_senddtmf.c4
-rw-r--r--apps/app_sendtext.c2
-rw-r--r--apps/app_setcallerid.c2
-rw-r--r--apps/app_skel.c2
-rw-r--r--apps/app_sms.c4
-rw-r--r--apps/app_softhangup.c2
-rw-r--r--apps/app_speech_utils.c18
-rw-r--r--apps/app_stack.c14
-rw-r--r--apps/app_system.c6
-rw-r--r--apps/app_talkdetect.c2
-rw-r--r--apps/app_test.c6
-rw-r--r--apps/app_transfer.c2
-rw-r--r--apps/app_url.c2
-rw-r--r--apps/app_userevent.c2
-rw-r--r--apps/app_verbose.c4
-rw-r--r--apps/app_voicemail.c17
-rw-r--r--apps/app_waitforring.c2
-rw-r--r--apps/app_waitforsilence.c6
-rw-r--r--apps/app_waituntil.c2
-rw-r--r--apps/app_while.c10
-rw-r--r--apps/app_zapateller.c2
75 files changed, 220 insertions, 225 deletions
diff --git a/apps/app_adsiprog.c b/apps/app_adsiprog.c
index 8f789c6c4..b889f96f1 100644
--- a/apps/app_adsiprog.c
+++ b/apps/app_adsiprog.c
@@ -74,7 +74,7 @@ struct adsi_event {
char *name;
};
-static struct adsi_event events[] = {
+static const struct adsi_event events[] = {
{ 1, "CALLERID" },
{ 2, "VMWI" },
{ 3, "NEARANSWER" },
@@ -101,7 +101,7 @@ static struct adsi_event events[] = {
{ 24, "CPEID" },
};
-static struct adsi_event justify[] = {
+static const struct adsi_event justify[] = {
{ 0, "CENTER" },
{ 1, "RIGHT" },
{ 2, "LEFT" },
@@ -232,7 +232,7 @@ static int process_token(void *out, char *src, int maxlen, int argtype)
return 0;
}
-static char *get_token(char **buf, char *script, int lineno)
+static char *get_token(char **buf, const char *script, int lineno)
{
char *tmp = *buf, *keyword;
int quoted = 0;
@@ -264,7 +264,7 @@ static char *get_token(char **buf, char *script, int lineno)
static char *validdtmf = "123456789*0#ABCD";
-static int send_dtmf(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno)
+static int send_dtmf(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
{
char dtmfstr[80], *a;
int bytes = 0;
@@ -294,7 +294,7 @@ static int send_dtmf(char *buf, char *name, int id, char *args, struct adsi_scri
return bytes;
}
-static int goto_line(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno)
+static int goto_line(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
{
char *page = get_token(&args, script, lineno);
char *gline = get_token(&args, script, lineno);
@@ -327,7 +327,7 @@ static int goto_line(char *buf, char *name, int id, char *args, struct adsi_scri
return 2;
}
-static int goto_line_rel(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno)
+static int goto_line_rel(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
{
char *dir = get_token(&args, script, lineno);
char *gline = get_token(&args, script, lineno);
@@ -360,7 +360,7 @@ static int goto_line_rel(char *buf, char *name, int id, char *args, struct adsi_
return 2;
}
-static int send_delay(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno)
+static int send_delay(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
{
char *gtime = get_token(&args, script, lineno);
int ms;
@@ -385,7 +385,7 @@ static int send_delay(char *buf, char *name, int id, char *args, struct adsi_scr
return 2;
}
-static int set_state(char *buf, char *name, int id, char *args, struct adsi_script *istate, char *script, int lineno)
+static int set_state(char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno)
{
char *gstate = get_token(&args, script, lineno);
int state;
@@ -406,7 +406,7 @@ static int set_state(char *buf, char *name, int id, char *args, struct adsi_scri
return 2;
}
-static int cleartimer(char *buf, char *name, int id, char *args, struct adsi_script *istate, char *script, int lineno)
+static int cleartimer(char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno)
{
char *tok = get_token(&args, script, lineno);
@@ -424,7 +424,7 @@ static int cleartimer(char *buf, char *name, int id, char *args, struct adsi_scr
return 2;
}
-static struct adsi_flag *getflagbyname(struct adsi_script *state, char *name, char *script, int lineno, int create)
+static struct adsi_flag *getflagbyname(struct adsi_script *state, char *name, const char *script, int lineno, int create)
{
int x;
@@ -449,7 +449,7 @@ static struct adsi_flag *getflagbyname(struct adsi_script *state, char *name, ch
return &state->flags[state->numflags-1];
}
-static int setflag(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno)
+static int setflag(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
{
char *tok = get_token(&args, script, lineno);
char sname[80];
@@ -476,7 +476,7 @@ static int setflag(char *buf, char *name, int id, char *args, struct adsi_script
return 2;
}
-static int clearflag(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno)
+static int clearflag(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
{
char *tok = get_token(&args, script, lineno);
struct adsi_flag *flag;
@@ -503,7 +503,7 @@ static int clearflag(char *buf, char *name, int id, char *args, struct adsi_scri
return 2;
}
-static int starttimer(char *buf, char *name, int id, char *args, struct adsi_script *istate, char *script, int lineno)
+static int starttimer(char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno)
{
char *tok = get_token(&args, script, lineno);
int secs;
@@ -549,7 +549,7 @@ static int getjustifybyname(char *name)
return -1;
}
-static struct adsi_soft_key *getkeybyname(struct adsi_script *state, char *name, char *script, int lineno)
+static struct adsi_soft_key *getkeybyname(struct adsi_script *state, char *name, const char *script, int lineno)
{
int x;
@@ -570,7 +570,7 @@ static struct adsi_soft_key *getkeybyname(struct adsi_script *state, char *name,
return &state->keys[state->numkeys-1];
}
-static struct adsi_subscript *getsubbyname(struct adsi_script *state, char *name, char *script, int lineno)
+static struct adsi_subscript *getsubbyname(struct adsi_script *state, char *name, const char *script, int lineno)
{
int x;
@@ -591,7 +591,7 @@ static struct adsi_subscript *getsubbyname(struct adsi_script *state, char *name
return &state->subs[state->numsubs-1];
}
-static struct adsi_state *getstatebyname(struct adsi_script *state, char *name, char *script, int lineno, int create)
+static struct adsi_state *getstatebyname(struct adsi_script *state, char *name, const char *script, int lineno, int create)
{
int x;
@@ -616,7 +616,7 @@ static struct adsi_state *getstatebyname(struct adsi_script *state, char *name,
return &state->states[state->numstates-1];
}
-static struct adsi_display *getdisplaybyname(struct adsi_script *state, char *name, char *script, int lineno, int create)
+static struct adsi_display *getdisplaybyname(struct adsi_script *state, char *name, const char *script, int lineno, int create)
{
int x;
@@ -641,7 +641,7 @@ static struct adsi_display *getdisplaybyname(struct adsi_script *state, char *na
return &state->displays[state->numdisplays-1];
}
-static int showkeys(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno)
+static int showkeys(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
{
char *tok, newkey[80];
int bytes, x, flagid = 0;
@@ -688,7 +688,7 @@ static int showkeys(char *buf, char *name, int id, char *args, struct adsi_scrip
return 2 + x;
}
-static int showdisplay(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno)
+static int showdisplay(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
{
char *tok, dispname[80];
int line = 0, flag = 0, cmd = 3;
@@ -739,7 +739,7 @@ static int showdisplay(char *buf, char *name, int id, char *args, struct adsi_sc
return 3;
}
-static int cleardisplay(char *buf, char *name, int id, char *args, struct adsi_script *istate, char *script, int lineno)
+static int cleardisplay(char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno)
{
char *tok = get_token(&args, script, lineno);
@@ -751,7 +751,7 @@ static int cleardisplay(char *buf, char *name, int id, char *args, struct adsi_s
return 2;
}
-static int digitdirect(char *buf, char *name, int id, char *args, struct adsi_script *istate, char *script, int lineno)
+static int digitdirect(char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno)
{
char *tok = get_token(&args, script, lineno);
@@ -763,7 +763,7 @@ static int digitdirect(char *buf, char *name, int id, char *args, struct adsi_sc
return 2;
}
-static int clearcbone(char *buf, char *name, int id, char *args, struct adsi_script *istate, char *script, int lineno)
+static int clearcbone(char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno)
{
char *tok = get_token(&args, script, lineno);
@@ -775,7 +775,7 @@ static int clearcbone(char *buf, char *name, int id, char *args, struct adsi_scr
return 2;
}
-static int digitcollect(char *buf, char *name, int id, char *args, struct adsi_script *istate, char *script, int lineno)
+static int digitcollect(char *buf, char *name, int id, char *args, struct adsi_script *istate, const char *script, int lineno)
{
char *tok = get_token(&args, script, lineno);
@@ -787,7 +787,7 @@ static int digitcollect(char *buf, char *name, int id, char *args, struct adsi_s
return 2;
}
-static int subscript(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno)
+static int subscript(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
{
char *tok = get_token(&args, script, lineno);
char subscr[80];
@@ -812,7 +812,7 @@ static int subscript(char *buf, char *name, int id, char *args, struct adsi_scri
return 2;
}
-static int onevent(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno)
+static int onevent(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno)
{
char *tok = get_token(&args, script, lineno);
char subscr[80], sname[80];
@@ -879,10 +879,10 @@ static int onevent(char *buf, char *name, int id, char *args, struct adsi_script
struct adsi_key_cmd {
char *name;
int id;
- int (*add_args)(char *buf, char *name, int id, char *args, struct adsi_script *state, char *script, int lineno);
+ int (*add_args)(char *buf, char *name, int id, char *args, struct adsi_script *state, const char *script, int lineno);
};
-static struct adsi_key_cmd kcmds[] = {
+static const struct adsi_key_cmd kcmds[] = {
{ "SENDDTMF", 0, send_dtmf },
/* Encoded DTMF would go here */
{ "ONHOOK", 0x81 },
@@ -924,7 +924,7 @@ static struct adsi_key_cmd kcmds[] = {
{ "EXIT", 0xa0 },
};
-static struct adsi_key_cmd opcmds[] = {
+static const struct adsi_key_cmd opcmds[] = {
/* 1 - Branch on event -- handled specially */
{ "SHOWKEYS", 2, showkeys },
@@ -944,7 +944,7 @@ static struct adsi_key_cmd opcmds[] = {
};
-static int process_returncode(struct adsi_soft_key *key, char *code, char *args, struct adsi_script *state, char *script, int lineno)
+static int process_returncode(struct adsi_soft_key *key, char *code, char *args, struct adsi_script *state, const char *script, int lineno)
{
int x, res;
char *unused;
@@ -973,7 +973,7 @@ static int process_returncode(struct adsi_soft_key *key, char *code, char *args,
return -1;
}
-static int process_opcode(struct adsi_subscript *sub, char *code, char *args, struct adsi_script *state, char *script, int lineno)
+static int process_opcode(struct adsi_subscript *sub, char *code, char *args, struct adsi_script *state, const char *script, int lineno)
{
int x, res, max = sub->id ? MAX_SUB_LEN : MAX_MAIN_LEN;
char *unused;
@@ -1010,7 +1010,7 @@ static int process_opcode(struct adsi_subscript *sub, char *code, char *args, st
return -1;
}
-static int adsi_process(struct adsi_script *state, char *buf, char *script, int lineno)
+static int adsi_process(struct adsi_script *state, char *buf, const char *script, int lineno)
{
char *keyword = get_token(&buf, script, lineno);
char *args, vname[256], tmp[80], tmp2[80];
@@ -1358,7 +1358,7 @@ static int adsi_process(struct adsi_script *state, char *buf, char *script, int
return 0;
}
-static struct adsi_script *compile_script(char *script)
+static struct adsi_script *compile_script(const char *script)
{
FILE *f;
char fn[256], buf[256], *c;
@@ -1451,7 +1451,7 @@ static void dump_message(char *type, char *vname, unsigned char *buf, int buflen
}
#endif
-static int adsi_prog(struct ast_channel *chan, char *script)
+static int adsi_prog(struct ast_channel *chan, const char *script)
{
struct adsi_script *scr;
int x, bytes;
@@ -1562,7 +1562,7 @@ static int adsi_prog(struct ast_channel *chan, char *script)
return 0;
}
-static int adsi_exec(struct ast_channel *chan, void *data)
+static int adsi_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
diff --git a/apps/app_alarmreceiver.c b/apps/app_alarmreceiver.c
index 6b34dfb54..c6fa8980b 100644
--- a/apps/app_alarmreceiver.c
+++ b/apps/app_alarmreceiver.c
@@ -416,7 +416,7 @@ static int log_events(struct ast_channel *chan, char *signalling_type, event_no
*
* The function will return 0 when the caller hangs up, else a -1 if there was a problem.
*/
-static int receive_ademco_contact_id( struct ast_channel *chan, void *data, int fdto, int sdto, int tldn, event_node_t **ehead)
+static int receive_ademco_contact_id(struct ast_channel *chan, const void *data, int fdto, int sdto, int tldn, event_node_t **ehead)
{
int i, j;
int res = 0;
@@ -564,7 +564,7 @@ static int receive_ademco_contact_id( struct ast_channel *chan, void *data, int
* This is the main function called by Asterisk Core whenever the App is invoked in the extension logic.
* This function will always return 0.
*/
-static int alarmreceiver_exec(struct ast_channel *chan, void *data)
+static int alarmreceiver_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
event_node_t *elp, *efree;
diff --git a/apps/app_amd.c b/apps/app_amd.c
index 56fa10fd2..cedd3b67a 100644
--- a/apps/app_amd.c
+++ b/apps/app_amd.c
@@ -143,7 +143,7 @@ static int dfltMaximumWordLength = 5000; /* Setting this to a large default s
/* Set to the lowest ms value provided in amd.conf or application parameters */
static int dfltMaxWaitTimeForFrame = 50;
-static void isAnsweringMachine(struct ast_channel *chan, void *data)
+static void isAnsweringMachine(struct ast_channel *chan, const char *data)
{
int res = 0;
struct ast_frame *f = NULL;
@@ -404,7 +404,7 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
}
-static int amd_exec(struct ast_channel *chan, void *data)
+static int amd_exec(struct ast_channel *chan, const char *data)
{
isAnsweringMachine(chan, data);
diff --git a/apps/app_authenticate.c b/apps/app_authenticate.c
index 88b2018f0..19570255c 100644
--- a/apps/app_authenticate.c
+++ b/apps/app_authenticate.c
@@ -105,7 +105,7 @@ static char *app = "Authenticate";
</application>
***/
-static int auth_exec(struct ast_channel *chan, void *data)
+static int auth_exec(struct ast_channel *chan, const char *data)
{
int res = 0, retries, maxdigits;
char passwd[256], *prompt = "agent-pass", *argcopy = NULL;
diff --git a/apps/app_cdr.c b/apps/app_cdr.c
index ca228da03..70036ad82 100644
--- a/apps/app_cdr.c
+++ b/apps/app_cdr.c
@@ -44,9 +44,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
</application>
***/
-static char *nocdr_app = "NoCDR";
+static const char nocdr_app[] = "NoCDR";
-static int nocdr_exec(struct ast_channel *chan, void *data)
+static int nocdr_exec(struct ast_channel *chan, const char *data)
{
if (chan->cdr)
ast_set_flag(chan->cdr, AST_CDR_FLAG_POST_DISABLED);
diff --git a/apps/app_chanisavail.c b/apps/app_chanisavail.c
index 556bafd71..c7af4af7d 100644
--- a/apps/app_chanisavail.c
+++ b/apps/app_chanisavail.c
@@ -92,7 +92,7 @@ static char *app = "ChanIsAvail";
</application>
***/
-static int chanavail_exec(struct ast_channel *chan, void *data)
+static int chanavail_exec(struct ast_channel *chan, const char *data)
{
int inuse=-1, option_state=0, string_compare=0, option_all_avail=0;
int status;
diff --git a/apps/app_channelredirect.c b/apps/app_channelredirect.c
index f604151ee..727162194 100644
--- a/apps/app_channelredirect.c
+++ b/apps/app_channelredirect.c
@@ -62,7 +62,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
***/
static char *app = "ChannelRedirect";
-static int asyncgoto_exec(struct ast_channel *chan, void *data)
+static int asyncgoto_exec(struct ast_channel *chan, const char *data)
{
int res = -1;
char *info;
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index 76d82305e..580038326 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -963,7 +963,7 @@ exit:
return res;
}
-static int chanspy_exec(struct ast_channel *chan, void *data)
+static int chanspy_exec(struct ast_channel *chan, const char *data)
{
char *myenforced = NULL;
char *mygroup = NULL;
@@ -985,9 +985,9 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
AST_APP_ARG(options);
);
char *opts[OPT_ARG_ARRAY_SIZE];
+ char *parse = ast_strdupa(data);
- data = ast_strdupa(data);
- AST_STANDARD_APP_ARGS(args, data);
+ AST_STANDARD_APP_ARGS(args, parse);
if (args.spec && !strcmp(args.spec, "all"))
args.spec = NULL;
@@ -1078,7 +1078,7 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
return res;
}
-static int extenspy_exec(struct ast_channel *chan, void *data)
+static int extenspy_exec(struct ast_channel *chan, const char *data)
{
char *ptr, *exten = NULL;
char *mygroup = NULL;
@@ -1099,10 +1099,9 @@ static int extenspy_exec(struct ast_channel *chan, void *data)
AST_APP_ARG(context);
AST_APP_ARG(options);
);
+ char *parse = ast_strdupa(data);
- data = ast_strdupa(data);
-
- AST_STANDARD_APP_ARGS(args, data);
+ AST_STANDARD_APP_ARGS(args, parse);
if (!ast_strlen_zero(args.context) && (ptr = strchr(args.context, '@'))) {
exten = args.context;
*ptr++ = '\0';
@@ -1199,7 +1198,7 @@ static int extenspy_exec(struct ast_channel *chan, void *data)
return res;
}
-static int dahdiscan_exec(struct ast_channel *chan, void *data)
+static int dahdiscan_exec(struct ast_channel *chan, const char *data)
{
const char *spec = "DAHDI";
struct ast_flags flags;
diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c
index 41edb2be3..d7a0bad40 100644
--- a/apps/app_confbridge.c
+++ b/apps/app_confbridge.c
@@ -683,7 +683,7 @@ static int menu_callback(struct ast_bridge *bridge, struct ast_bridge_channel *b
}
/*! \brief The ConfBridge application */
-static int confbridge_exec(struct ast_channel *chan, void *data)
+static int confbridge_exec(struct ast_channel *chan, const char *data)
{
int res = 0, volume_adjustments[2];
char *parse;
diff --git a/apps/app_controlplayback.c b/apps/app_controlplayback.c
index fbcf69157..11a162d58 100644
--- a/apps/app_controlplayback.c
+++ b/apps/app_controlplayback.c
@@ -125,7 +125,7 @@ static int is_argument(const char *haystack, int needle)
return 0;
}
-static int controlplayback_exec(struct ast_channel *chan, void *data)
+static int controlplayback_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
int skipms = 0;
diff --git a/apps/app_dahdibarge.c b/apps/app_dahdibarge.c
index cfa445acc..124318115 100644
--- a/apps/app_dahdibarge.c
+++ b/apps/app_dahdibarge.c
@@ -258,7 +258,7 @@ outrun:
return ret;
}
-static int conf_exec(struct ast_channel *chan, void *data)
+static int conf_exec(struct ast_channel *chan, const char *data)
{
int res = -1;
int retrycnt = 0;
diff --git a/apps/app_dahdiras.c b/apps/app_dahdiras.c
index a69d092f5..67f434e6f 100644
--- a/apps/app_dahdiras.c
+++ b/apps/app_dahdiras.c
@@ -187,7 +187,7 @@ static void run_ras(struct ast_channel *chan, char *args)
ast_safe_fork_cleanup();
}
-static int dahdiras_exec(struct ast_channel *chan, void *data)
+static int dahdiras_exec(struct ast_channel *chan, const char *data)
{
int res=-1;
char *args;
diff --git a/apps/app_db.c b/apps/app_db.c
index 3a89b867b..8171ed202 100644
--- a/apps/app_db.c
+++ b/apps/app_db.c
@@ -83,7 +83,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static char *d_app = "DBdel";
static char *dt_app = "DBdeltree";
-static int deltree_exec(struct ast_channel *chan, void *data)
+static int deltree_exec(struct ast_channel *chan, const char *data)
{
char *argv, *family, *keytree;
@@ -114,7 +114,7 @@ static int deltree_exec(struct ast_channel *chan, void *data)
return 0;
}
-static int del_exec(struct ast_channel *chan, void *data)
+static int del_exec(struct ast_channel *chan, const char *data)
{
char *argv, *family, *key;
static int deprecation_warning = 0;
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 790e49ffa..2548e8e09 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -1634,7 +1634,7 @@ static void end_bridge_callback_data_fixup(struct ast_bridge_config *bconfig, st
bconfig->end_bridge_callback_data = originator;
}
-static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags64 *peerflags, int *continue_exec)
+static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast_flags64 *peerflags, int *continue_exec)
{
int res = -1; /* default: error */
char *rest, *cur; /* scan the list of destinations */
@@ -2423,7 +2423,7 @@ done:
return res;
}
-static int dial_exec(struct ast_channel *chan, void *data)
+static int dial_exec(struct ast_channel *chan, const char *data)
{
struct ast_flags64 peerflags;
@@ -2432,7 +2432,7 @@ static int dial_exec(struct ast_channel *chan, void *data)
return dial_exec_full(chan, data, &peerflags, NULL);
}
-static int retrydial_exec(struct ast_channel *chan, void *data)
+static int retrydial_exec(struct ast_channel *chan, const char *data)
{
char *parse;
const char *context = NULL;
diff --git a/apps/app_dictate.c b/apps/app_dictate.c
index b187998a8..d940b67fc 100644
--- a/apps/app_dictate.c
+++ b/apps/app_dictate.c
@@ -81,7 +81,7 @@ static int play_and_wait(struct ast_channel *chan, char *file, char *digits)
return res;
}
-static int dictate_exec(struct ast_channel *chan, void *data)
+static int dictate_exec(struct ast_channel *chan, const char *data)
{
char *path = NULL, filein[256], *filename = "";
char *parse;
diff --git a/apps/app_directed_pickup.c b/apps/app_directed_pickup.c
index 2f4c18237..f0f74f1fe 100644
--- a/apps/app_directed_pickup.c
+++ b/apps/app_directed_pickup.c
@@ -262,7 +262,7 @@ static int pickup_by_mark(struct ast_channel *chan, const char *mark)
}
/* application entry point for Pickup() */
-static int pickup_exec(struct ast_channel *chan, void *data)
+static int pickup_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
char *tmp = ast_strdupa(data);
@@ -291,7 +291,7 @@ static int pickup_exec(struct ast_channel *chan, void *data)
}
/* application entry point for PickupChan() */
-static int pickupchan_exec(struct ast_channel *chan, void *data)
+static int pickupchan_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
char *tmp = ast_strdupa(data);
diff --git a/apps/app_directory.c b/apps/app_directory.c
index fe8139de5..d0172e79e 100644
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -714,7 +714,7 @@ exit:
return res;
}
-static int directory_exec(struct ast_channel *chan, void *data)
+static int directory_exec(struct ast_channel *chan, const char *data)
{
int res = 0, digit = 3;
struct ast_config *cfg, *ucfg;
diff --git a/apps/app_disa.c b/apps/app_disa.c
index 691fa94ab..b7ca23cfc 100644
--- a/apps/app_disa.c
+++ b/apps/app_disa.c
@@ -140,7 +140,7 @@ static void play_dialtone(struct ast_channel *chan, char *mailbox)
}
}
-static int disa_exec(struct ast_channel *chan, void *data)
+static int disa_exec(struct ast_channel *chan, const char *data)
{
int i = 0, j, k = 0, did_ignore = 0, special_noanswer = 0;
int firstdigittimeout = (chan->pbx ? chan->pbx->rtimeoutms : 20000);
diff --git a/apps/app_dumpchan.c b/apps/app_dumpchan.c
index 739fe241b..476f2f1fd 100644
--- a/apps/app_dumpchan.c
+++ b/apps/app_dumpchan.c
@@ -147,7 +147,7 @@ static int serialize_showchan(struct ast_channel *c, char *buf, size_t size)
return 0;
}
-static int dumpchan_exec(struct ast_channel *chan, void *data)
+static int dumpchan_exec(struct ast_channel *chan, const char *data)
{
struct ast_str *vars = ast_str_thread_get(&ast_str_thread_global_buf, 16);
char info[1024];
diff --git a/apps/app_echo.c b/apps/app_echo.c
index 8b0d21f06..dcdebed46 100644
--- a/apps/app_echo.c
+++ b/apps/app_echo.c
@@ -48,7 +48,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static char *app = "Echo";
-static int echo_exec(struct ast_channel *chan, void *data)
+static int echo_exec(struct ast_channel *chan, const char *data)
{
int res = -1;
int format;
diff --git a/apps/app_exec.c b/apps/app_exec.c
index 3c5be33b6..b840e24b9 100644
--- a/apps/app_exec.c
+++ b/apps/app_exec.c
@@ -129,7 +129,7 @@ static char *app_exec = "Exec";
static char *app_tryexec = "TryExec";
static char *app_execif = "ExecIf";
-static int exec_exec(struct ast_channel *chan, void *data)
+static int exec_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
char *s, *appname, *endargs;
@@ -163,7 +163,7 @@ static int exec_exec(struct ast_channel *chan, void *data)
return res;
}
-static int tryexec_exec(struct ast_channel *chan, void *data)
+static int tryexec_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
char *s, *appname, *endargs;
@@ -198,7 +198,7 @@ static int tryexec_exec(struct ast_channel *chan, void *data)
return 0;
}
-static int execif_exec(struct ast_channel *chan, void *data)
+static int execif_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
char *truedata = NULL, *falsedata = NULL, *end, *firstcomma, *firstquestion;
diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c
index 5c6cc0a8e..db3db3db8 100644
--- a/apps/app_externalivr.c
+++ b/apps/app_externalivr.c
@@ -311,7 +311,7 @@ static struct playlist_entry *make_entry(const char *filename)
return entry;
}
-static int app_exec(struct ast_channel *chan, void *data)
+static int app_exec(struct ast_channel *chan, const char *data)
{
struct ast_flags flags = { 0, };
char *opts[0];
diff --git a/apps/app_fax.c b/apps/app_fax.c
index ed7fe16e6..6cb18848e 100644
--- a/apps/app_fax.c
+++ b/apps/app_fax.c
@@ -705,7 +705,7 @@ static int transmit(fax_session *s)
/* === Application functions === */
-static int sndfax_exec(struct ast_channel *chan, void *data)
+static int sndfax_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
char *parse;
@@ -749,7 +749,7 @@ static int sndfax_exec(struct ast_channel *chan, void *data)
return res;
}
-static int rcvfax_exec(struct ast_channel *chan, void *data)
+static int rcvfax_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
char *parse;
diff --git a/apps/app_festival.c b/apps/app_festival.c
index 2d57a51dc..6b3d5122e 100644
--- a/apps/app_festival.c
+++ b/apps/app_festival.c
@@ -264,7 +264,7 @@ static int send_waveform_to_channel(struct ast_channel *chan, char *waveform, in
return res;
}
-static int festival_exec(struct ast_channel *chan, void *vdata)
+static int festival_exec(struct ast_channel *chan, const char *vdata)
{
int usecache;
int res = 0;
diff --git a/apps/app_flash.c b/apps/app_flash.c
index 90329b6b8..dedadfeab 100644
--- a/apps/app_flash.c
+++ b/apps/app_flash.c
@@ -72,7 +72,7 @@ static inline int dahdi_wait_event(int fd)
return j;
}
-static int flash_exec(struct ast_channel *chan, void *data)
+static int flash_exec(struct ast_channel *chan, const char *data)
{
int res = -1;
int x;
diff --git a/apps/app_followme.c b/apps/app_followme.c
index d27aa36d8..504ff7c76 100644
--- a/apps/app_followme.c
+++ b/apps/app_followme.c
@@ -275,18 +275,19 @@ static void profile_set_param(struct call_followme *f, const char *param, const
}
/*! \brief Add a new number */
-static struct number *create_followme_number(char *number, int timeout, int numorder)
+static struct number *create_followme_number(const char *number, int timeout, int numorder)
{
struct number *cur;
+ char *buf = ast_strdupa(number);
char *tmp;
if (!(cur = ast_calloc(1, sizeof(*cur))))
return NULL;
cur->timeout = timeout;
- if ((tmp = strchr(number, ',')))
+ if ((tmp = strchr(buf, ',')))
*tmp = '\0';
- ast_copy_string(cur->number, number, sizeof(cur->number));
+ ast_copy_string(cur->number, buf, sizeof(cur->number));
cur->order = numorder;
ast_debug(1, "Created a number, %s, order of , %d, with a timeout of %ld.\n", cur->number, cur->order, cur->timeout);
@@ -996,7 +997,7 @@ static void end_bridge_callback_data_fixup(struct ast_bridge_config *bconfig, st
bconfig->end_bridge_callback_data = originator;
}
-static int app_exec(struct ast_channel *chan, void *data)
+static int app_exec(struct ast_channel *chan, const char *data)
{
struct fm_args targs = { 0, };
struct ast_bridge_config config;
diff --git a/apps/app_forkcdr.c b/apps/app_forkcdr.c
index 341e52a8d..66ba9d40f 100644
--- a/apps/app_forkcdr.c
+++ b/apps/app_forkcdr.c
@@ -226,7 +226,7 @@ static void ast_cdr_fork(struct ast_channel *chan, struct ast_flags optflags, ch
ast_set_flag(cdr, AST_CDR_FLAG_CHILD | AST_CDR_FLAG_LOCKED);
}
-static int forkcdr_exec(struct ast_channel *chan, void *data)
+static int forkcdr_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
char *argcopy = NULL;
diff --git a/apps/app_getcpeid.c b/apps/app_getcpeid.c
index 9c1009242..93df1623a 100644
--- a/apps/app_getcpeid.c
+++ b/apps/app_getcpeid.c
@@ -61,7 +61,7 @@ static int cpeid_setstatus(struct ast_channel *chan, char *stuff[], int voice)
return ast_adsi_print(chan, tmp, justify, voice);
}
-static int cpeid_exec(struct ast_channel *chan, void *idata)
+static int cpeid_exec(struct ast_channel *chan, const char *idata)
{
int res=0;
unsigned char cpeid[4];
diff --git a/apps/app_ices.c b/apps/app_ices.c
index c5bc315d4..f2b9498a6 100644
--- a/apps/app_ices.c
+++ b/apps/app_ices.c
@@ -104,7 +104,7 @@ static int icesencode(char *filename, int fd)
_exit(0);
}
-static int ices_exec(struct ast_channel *chan, void *data)
+static int ices_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
int fds[2];
diff --git a/apps/app_image.c b/apps/app_image.c
index a6fbac50c..af4abd7e9 100644
--- a/apps/app_image.c
+++ b/apps/app_image.c
@@ -69,7 +69,7 @@ static char *app = "SendImage";
</application>
***/
-static int sendimage_exec(struct ast_channel *chan, void *data)
+static int sendimage_exec(struct ast_channel *chan, const char *data)
{
if (ast_strlen_zero(data)) {
diff --git a/apps/app_ivrdemo.c b/apps/app_ivrdemo.c
index 13f4bcc9c..a9c61209a 100644
--- a/apps/app_ivrdemo.c
+++ b/apps/app_ivrdemo.c
@@ -59,7 +59,7 @@ static char *app = "IVRDemo";
static int ivr_demo_func(struct ast_channel *chan, void *data)
{
- ast_verbose("IVR Demo, data is %s!\n", (char *)data);
+ ast_verbose("IVR Demo, data is %s!\n", (char *) data);
return 0;
}
@@ -93,22 +93,24 @@ AST_IVR_DECLARE_MENU(ivr_demo, "IVR Demo Main Menu", 0,
{ NULL },
});
-
-static int skel_exec(struct ast_channel *chan, void *data)
+static int skel_exec(struct ast_channel *chan, const char *data)
{
int res=0;
+ char *tmp;
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "skel requires an argument (filename)\n");
return -1;
}
+ tmp = ast_strdupa(data);
+
/* Do our thing here */
if (chan->_state != AST_STATE_UP)
res = ast_answer(chan);
if (!res)
- res = ast_ivr_menu_run(chan, &ivr_demo, data);
+ res = ast_ivr_menu_run(chan, &ivr_demo, tmp);
return res;
}
diff --git a/apps/app_jack.c b/apps/app_jack.c
index 02d7a21dd..95726a4eb 100644
--- a/apps/app_jack.c
+++ b/apps/app_jack.c
@@ -740,19 +740,14 @@ static int handle_options(struct jack_data *jack_data, const char *__options_str
return 0;
}
-static int jack_exec(struct ast_channel *chan, void *data)
+static int jack_exec(struct ast_channel *chan, const char *data)
{
struct jack_data *jack_data;
- AST_DECLARE_APP_ARGS(args,
- AST_APP_ARG(options);
- );
if (!(jack_data = jack_data_alloc()))
return -1;
- args.options = data;
-
- if (!ast_strlen_zero(args.options) && handle_options(jack_data, args.options)) {
+ if (!ast_strlen_zero(data) && handle_options(jack_data, data)) {
destroy_jack_data(jack_data);
return -1;
}
diff --git a/apps/app_macro.c b/apps/app_macro.c
index 19cc04ff6..1db3b27a8 100644
--- a/apps/app_macro.c
+++ b/apps/app_macro.c
@@ -216,7 +216,7 @@ static struct ast_exten *find_matching_priority(struct ast_context *c, const cha
return NULL;
}
-static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
+static int _macro_exec(struct ast_channel *chan, const char *data, int exclusive)
{
const char *s;
char *tmp;
@@ -426,7 +426,8 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
gosub_level++;
ast_debug(1, "Incrementing gosub_level\n");
} else if (!strcasecmp(runningapp, "GOSUBIF")) {
- char *cond, *app_arg, *app2;
+ char *cond, *app_arg;
+ char *app2;
ast_str_substitute_variables(&tmp_subst, 0, chan, runningdata);
app2 = ast_str_buffer(tmp_subst);
cond = strsep(&app2, "?");
@@ -454,8 +455,7 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
ast_str_substitute_variables(&tmp_subst, 0, chan, runningdata);
tmp2 = ast_str_buffer(tmp_subst);
if (!strcasecmp(runningapp, "EXECIF")) {
- tmp3 = strchr(tmp2, '|');
- if (tmp3) {
+ if ((tmp3 = strchr(tmp2, '|'))) {
*tmp3++ = '\0';
}
if (!pbx_checkcondition(tmp2)) {
@@ -569,17 +569,17 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
return res;
}
-static int macro_exec(struct ast_channel *chan, void *data)
+static int macro_exec(struct ast_channel *chan, const char *data)
{
return _macro_exec(chan, data, 0);
}
-static int macroexclusive_exec(struct ast_channel *chan, void *data)
+static int macroexclusive_exec(struct ast_channel *chan, const char *data)
{
return _macro_exec(chan, data, 1);
}
-static int macroif_exec(struct ast_channel *chan, void *data)
+static int macroif_exec(struct ast_channel *chan, const char *data)
{
char *expr = NULL, *label_a = NULL, *label_b = NULL;
int res = 0;
@@ -604,7 +604,7 @@ static int macroif_exec(struct ast_channel *chan, void *data)
return res;
}
-static int macro_exit_exec(struct ast_channel *chan, void *data)
+static int macro_exit_exec(struct ast_channel *chan, const char *data)
{
return MACRO_EXIT_RESULT;
}
diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index 09858c17d..ba278ba76 100644
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -861,7 +861,7 @@ static int audio_buffers;
* conversion... the numbers have been modified
* to give the user a better level of adjustability
*/
-static char const gain_map[] = {
+static const char gain_map[] = {
-15,
-13,
-10,
@@ -876,7 +876,7 @@ static char const gain_map[] = {
};
-static int admin_exec(struct ast_channel *chan, void *data);
+static int admin_exec(struct ast_channel *chan, const char *data);
static void *recordthread(void *args);
static char *istalking(int x)
@@ -1144,7 +1144,7 @@ cnfout:
static char *complete_meetmecmd(const char *line, const char *word, int pos, int state)
{
- static char *cmds[] = {"concise", "lock", "unlock", "mute", "unmute", "kick", "list", NULL};
+ static const char * const cmds[] = {"concise", "lock", "unlock", "mute", "unmute", "kick", "list", NULL};
int len = strlen(word);
int which = 0;
@@ -3600,7 +3600,7 @@ static struct ast_conference *find_conf(struct ast_channel *chan, char *confno,
}
/*! \brief The MeetmeCount application */
-static int count_exec(struct ast_channel *chan, void *data)
+static int count_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
struct ast_conference *conf;
@@ -3646,7 +3646,7 @@ static int count_exec(struct ast_channel *chan, void *data)
}
/*! \brief The meetme() application */
-static int conf_exec(struct ast_channel *chan, void *data)
+static int conf_exec(struct ast_channel *chan, const char *data)
{
int res = -1;
char confno[MAX_CONFNUM] = "";
@@ -3657,7 +3657,8 @@ static int conf_exec(struct ast_channel *chan, void *data)
int dynamic = 0;
int empty = 0, empty_no_pin = 0;
int always_prompt = 0;
- char *notdata, *info, the_pin[MAX_PIN] = "";
+ const char *notdata;
+ char *info, the_pin[MAX_PIN] = "";
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(confno);
AST_APP_ARG(options);
@@ -3920,7 +3921,7 @@ static struct ast_conf_user *find_user(struct ast_conference *conf, char *caller
/*! \brief The MeetMeadmin application */
/* MeetMeAdmin(confno, command, caller) */
-static int admin_exec(struct ast_channel *chan, void *data) {
+static int admin_exec(struct ast_channel *chan, const char *data) {
char *params;
struct ast_conference *cnf;
struct ast_conf_user *user = NULL;
@@ -4102,7 +4103,7 @@ static int admin_exec(struct ast_channel *chan, void *data) {
/*--- channel_admin_exec: The MeetMeChannelAdmin application */
/* MeetMeChannelAdmin(channel, command) */
-static int channel_admin_exec(struct ast_channel *chan, void *data) {
+static int channel_admin_exec(struct ast_channel *chan, const char *data) {
char *params;
struct ast_conference *conf = NULL;
struct ast_conf_user *user = NULL;
@@ -4235,7 +4236,7 @@ static int action_meetmeunmute(struct mansession *s, const struct message *m)
return meetmemute(s, m, 0);
}
-static char mandescr_meetmelist[] =
+static const char mandescr_meetmelist[] =
"Description: Lists all users in a particular MeetMe conference.\n"
"MeetmeList will follow as separate events, followed by a final event called\n"
"MeetmeListComplete.\n"
@@ -5552,7 +5553,7 @@ static struct sla_trunk_ref *sla_choose_idle_trunk(const struct sla_station *sta
return trunk_ref;
}
-static int sla_station_exec(struct ast_channel *chan, void *data)
+static int sla_station_exec(struct ast_channel *chan, const char *data)
{
char *station_name, *trunk_name;
struct sla_station *station;
@@ -5759,7 +5760,7 @@ AST_APP_OPTIONS(sla_trunk_opts, BEGIN_OPTIONS
AST_APP_OPTION_ARG('M', SLA_TRUNK_OPT_MOH, SLA_TRUNK_OPT_ARG_MOH_CLASS),
END_OPTIONS );
-static int sla_trunk_exec(struct ast_channel *chan, void *data)
+static int sla_trunk_exec(struct ast_channel *chan, const char *data)
{
char conf_name[MAX_CONFNUM];
struct ast_conference *conf;
diff --git a/apps/app_milliwatt.c b/apps/app_milliwatt.c
index 4f27fa795..aa7a118a0 100644
--- a/apps/app_milliwatt.c
+++ b/apps/app_milliwatt.c
@@ -55,9 +55,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
</application>
***/
-static char *app = "Milliwatt";
+static const char app[] = "Milliwatt";
-static char digital_milliwatt[] = {0x1e,0x0b,0x0b,0x1e,0x9e,0x8b,0x8b,0x9e} ;
+static const char digital_milliwatt[] = {0x1e,0x0b,0x0b,0x1e,0x9e,0x8b,0x8b,0x9e} ;
static void *milliwatt_alloc(struct ast_channel *chan, void *params)
{
@@ -139,7 +139,7 @@ static int old_milliwatt_exec(struct ast_channel *chan)
return -1;
}
-static int milliwatt_exec(struct ast_channel *chan, void *data)
+static int milliwatt_exec(struct ast_channel *chan, const char *data)
{
const char *options = data;
struct ast_app *playtones_app;
diff --git a/apps/app_minivm.c b/apps/app_minivm.c
index fffa714e0..59323ee4e 100644
--- a/apps/app_minivm.c
+++ b/apps/app_minivm.c
@@ -1922,7 +1922,7 @@ static void queue_mwi_event(const char *mbx, const char *ctx, int urgent, int ne
/*!\internal
* \brief Send MWI using interal Asterisk event subsystem */
-static int minivm_mwi_exec(struct ast_channel *chan, void *data)
+static int minivm_mwi_exec(struct ast_channel *chan, const char *data)
{
int argc;
char *argv[4];
@@ -1964,7 +1964,7 @@ static int minivm_mwi_exec(struct ast_channel *chan, void *data)
/*!\internal
* \brief Notify voicemail account owners - either generic template or user specific */
-static int minivm_notify_exec(struct ast_channel *chan, void *data)
+static int minivm_notify_exec(struct ast_channel *chan, const char *data)
{
int argc;
char *argv[2];
@@ -2044,7 +2044,7 @@ static int minivm_notify_exec(struct ast_channel *chan, void *data)
/*!\internal
* \brief Dialplan function to record voicemail */
-static int minivm_record_exec(struct ast_channel *chan, void *data)
+static int minivm_record_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
char *tmp;
@@ -2101,7 +2101,7 @@ static int minivm_record_exec(struct ast_channel *chan, void *data)
/*!\internal
* \brief Play voicemail prompts - either generic or user specific */
-static int minivm_greet_exec(struct ast_channel *chan, void *data)
+static int minivm_greet_exec(struct ast_channel *chan, const char *data)
{
struct leave_vm_options leave_options = { 0, '\0'};
int argc;
@@ -2288,7 +2288,7 @@ static int minivm_greet_exec(struct ast_channel *chan, void *data)
/*!\internal
* \brief Dialplan application to delete voicemail */
-static int minivm_delete_exec(struct ast_channel *chan, void *data)
+static int minivm_delete_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
char filename[BUFSIZ];
@@ -2326,7 +2326,7 @@ static int minivm_delete_exec(struct ast_channel *chan, void *data)
}
/*! \brief Record specific messages for voicemail account */
-static int minivm_accmess_exec(struct ast_channel *chan, void *data)
+static int minivm_accmess_exec(struct ast_channel *chan, const char *data)
{
int argc = 0;
char *argv[2];
diff --git a/apps/app_mixmonitor.c b/apps/app_mixmonitor.c
index b8a4e5d65..6cd5871bd 100644
--- a/apps/app_mixmonitor.c
+++ b/apps/app_mixmonitor.c
@@ -322,7 +322,7 @@ static void launch_monitor_thread(struct ast_channel *chan, const char *filename
ast_pthread_create_detached_background(&thread, NULL, mixmonitor_thread, mixmonitor);
}
-static int mixmonitor_exec(struct ast_channel *chan, void *data)
+static int mixmonitor_exec(struct ast_channel *chan, const char *data)
{
int x, readvol = 0, writevol = 0;
struct ast_flags flags = {0};
@@ -403,7 +403,7 @@ static int mixmonitor_exec(struct ast_channel *chan, void *data)
return 0;
}
-static int stop_mixmonitor_exec(struct ast_channel *chan, void *data)
+static int stop_mixmonitor_exec(struct ast_channel *chan, const char *data)
{
ast_audiohook_detach_source(chan, mixmonitor_spy_type);
return 0;
diff --git a/apps/app_morsecode.c b/apps/app_morsecode.c
index 25b5c49e3..0947681e9 100644
--- a/apps/app_morsecode.c
+++ b/apps/app_morsecode.c
@@ -63,9 +63,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
</see-also>
</application>
***/
-static char *app_morsecode = "Morsecode";
+static const char app_morsecode[] = "Morsecode";
-static char *morsecode[] = {
+static const char * const morsecode[] = {
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /* 0-15 */
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /* 16-31 */
" ", /* 32 - <space> */
@@ -118,10 +118,10 @@ static void playtone(struct ast_channel *chan, int tone, int len)
ast_playtones_stop(chan);
}
-static int morsecode_exec(struct ast_channel *chan, void *data)
+static int morsecode_exec(struct ast_channel *chan, const char *data)
{
int res=0, ditlen, tone;
- char *digit;
+ const char *digit;
const char *ditlenc, *tonec;
if (ast_strlen_zero(data)) {
@@ -147,7 +147,7 @@ static int morsecode_exec(struct ast_channel *chan, void *data)
for (digit = data; *digit; digit++) {
int digit2 = *digit;
- char *dahdit;
+ const char *dahdit;
if (digit2 < 0) {
continue;
}
diff --git a/apps/app_mp3.c b/apps/app_mp3.c
index 41e27f9b3..dbab73bca 100644
--- a/apps/app_mp3.c
+++ b/apps/app_mp3.c
@@ -117,7 +117,7 @@ static int timed_read(int fd, void *data, int datalen, int timeout)
}
-static int mp3_exec(struct ast_channel *chan, void *data)
+static int mp3_exec(struct ast_channel *chan, const char *data)
{
int res=0;
int fds[2];
diff --git a/apps/app_nbscat.c b/apps/app_nbscat.c
index 112e01297..ec9347803 100644
--- a/apps/app_nbscat.c
+++ b/apps/app_nbscat.c
@@ -105,7 +105,7 @@ static int timed_read(int fd, void *data, int datalen)
}
-static int NBScat_exec(struct ast_channel *chan, void *data)
+static int NBScat_exec(struct ast_channel *chan, const char *data)
{
int res=0;
int fds[2];
diff --git a/apps/app_originate.c b/apps/app_originate.c
index 15d34a5d3..b9bb8821b 100644
--- a/apps/app_originate.c
+++ b/apps/app_originate.c
@@ -89,7 +89,7 @@ static const char app_originate[] = "Originate";
</application>
***/
-static int originate_exec(struct ast_channel *chan, void *data)
+static int originate_exec(struct ast_channel *chan, const char *data)
{
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(tech_data);
diff --git a/apps/app_osplookup.c b/apps/app_osplookup.c
index 7c553b573..a5a57bca7 100644
--- a/apps/app_osplookup.c
+++ b/apps/app_osplookup.c
@@ -1296,8 +1296,8 @@ static int osp_finish(
* \return 0 Success, -1 Failed
*/
static int ospauth_exec(
- struct ast_channel* chan,
- void* data)
+ struct ast_channel *chan,
+ const char *data)
{
int res;
const char* provider = OSP_DEF_PROVIDER;
@@ -1377,7 +1377,7 @@ static int ospauth_exec(
*/
static int osplookup_exec(
struct ast_channel* chan,
- void* data)
+ const void* data)
{
int res, cres;
const char* provider = OSP_DEF_PROVIDER;
@@ -1551,7 +1551,7 @@ static int osplookup_exec(
*/
static int ospnext_exec(
struct ast_channel* chan,
- void* data)
+ const void* data)
{
int res;
const char* provider = OSP_DEF_PROVIDER;
@@ -1707,7 +1707,7 @@ static int ospnext_exec(
*/
static int ospfinished_exec(
struct ast_channel* chan,
- void* data)
+ const void* data)
{
int res = 1;
int cause = 0;
diff --git a/apps/app_page.c b/apps/app_page.c
index 9e0547be6..b277dab56 100644
--- a/apps/app_page.c
+++ b/apps/app_page.c
@@ -118,7 +118,7 @@ AST_APP_OPTIONS(page_opts, {
});
-static int page_exec(struct ast_channel *chan, void *data)
+static int page_exec(struct ast_channel *chan, const char *data)
{
char *tech, *resource, *tmp;
char meetmeopts[88], originator[AST_CHANNEL_NAME], *opts[0];
diff --git a/apps/app_parkandannounce.c b/apps/app_parkandannounce.c
index 42a7c2849..d8858b64e 100644
--- a/apps/app_parkandannounce.c
+++ b/apps/app_parkandannounce.c
@@ -85,7 +85,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static char *app = "ParkAndAnnounce";
-static int parkandannounce_exec(struct ast_channel *chan, void *data)
+static int parkandannounce_exec(struct ast_channel *chan, const char *data)
{
int res = -1;
int lot, timeout = 0, dres;
diff --git a/apps/app_playback.c b/apps/app_playback.c
index a61c49bc9..54e90ffc2 100644
--- a/apps/app_playback.c
+++ b/apps/app_playback.c
@@ -380,7 +380,7 @@ static int say_init_mode(const char *mode) {
static char *__say_cli_init(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
const char *old_mode = say_api_buf[0] ? say_new : say_old;
- char *mode;
+ const char *mode;
switch (cmd) {
case CLI_INIT:
e->command = "say load [new|old]";
@@ -415,7 +415,7 @@ static struct ast_cli_entry cli_playback[] = {
AST_CLI_DEFINE(__say_cli_init, "Set or show the say mode"),
};
-static int playback_exec(struct ast_channel *chan, void *data)
+static int playback_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
int mres = 0;
diff --git a/apps/app_playtones.c b/apps/app_playtones.c
index 6aff16860..c9c0fbb99 100644
--- a/apps/app_playtones.c
+++ b/apps/app_playtones.c
@@ -72,7 +72,7 @@ static const char stopplaytones_app[] = "StopPlayTones";
</application>
***/
-static int handle_playtones(struct ast_channel *chan, void *data)
+static int handle_playtones(struct ast_channel *chan, const char *data)
{
struct ast_tone_zone_sound *ts;
int res;
@@ -99,7 +99,7 @@ static int handle_playtones(struct ast_channel *chan, void *data)
return res;
}
-static int handle_stopplaytones(struct ast_channel *chan, void *data)
+static int handle_stopplaytones(struct ast_channel *chan, const char *data)
{
ast_playtones_stop(chan);
diff --git a/apps/app_privacy.c b/apps/app_privacy.c
index a2e7152b7..37b440b8a 100644
--- a/apps/app_privacy.c
+++ b/apps/app_privacy.c
@@ -80,7 +80,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static char *app = "PrivacyManager";
-static int privacy_exec (struct ast_channel *chan, void *data)
+static int privacy_exec(struct ast_channel *chan, const char *data)
{
int res=0;
int retries;
diff --git a/apps/app_queue.c b/apps/app_queue.c
index c88c77e24..d792cdfd5 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -593,7 +593,7 @@ enum queue_result {
QUEUE_CONTINUE = 7,
};
-const struct {
+static const struct {
enum queue_result id;
char *text;
} queue_results[] = {
@@ -2403,7 +2403,7 @@ static void do_hang(struct callattempt *o)
static char *vars2manager(struct ast_channel *chan, char *vars, size_t len)
{
struct ast_str *buf = ast_str_thread_get(&ast_str_thread_global_buf, len + 1);
- char *tmp;
+ const char *tmp;
if (pbx_builtin_serialize_variables(chan, &buf)) {
int i, j;
@@ -4651,7 +4651,7 @@ static int set_member_paused(const char *queuename, const char *interface, const
}
/* \brief Sets members penalty, if queuename=NULL we set member penalty in all the queues. */
-static int set_member_penalty(char *queuename, char *interface, int penalty)
+static int set_member_penalty(const char *queuename, const char *interface, int penalty)
{
int foundinterface = 0, foundqueue = 0;
struct call_queue *q;
@@ -4828,7 +4828,7 @@ static void reload_queue_members(void)
}
/*! \brief PauseQueueMember application */
-static int pqm_exec(struct ast_channel *chan, void *data)
+static int pqm_exec(struct ast_channel *chan, const char *data)
{
char *parse;
AST_DECLARE_APP_ARGS(args,
@@ -4864,7 +4864,7 @@ static int pqm_exec(struct ast_channel *chan, void *data)
}
/*! \brief UnPauseQueueMember application */
-static int upqm_exec(struct ast_channel *chan, void *data)
+static int upqm_exec(struct ast_channel *chan, const char *data)
{
char *parse;
AST_DECLARE_APP_ARGS(args,
@@ -4900,7 +4900,7 @@ static int upqm_exec(struct ast_channel *chan, void *data)
}
/*! \brief RemoveQueueMember application */
-static int rqm_exec(struct ast_channel *chan, void *data)
+static int rqm_exec(struct ast_channel *chan, const char *data)
{
int res=-1;
char *parse, *temppos = NULL;
@@ -4957,7 +4957,7 @@ static int rqm_exec(struct ast_channel *chan, void *data)
}
/*! \brief AddQueueMember application */
-static int aqm_exec(struct ast_channel *chan, void *data)
+static int aqm_exec(struct ast_channel *chan, const char *data)
{
int res=-1;
char *parse, *temppos = NULL;
@@ -5020,7 +5020,7 @@ static int aqm_exec(struct ast_channel *chan, void *data)
}
/*! \brief QueueLog application */
-static int ql_exec(struct ast_channel *chan, void *data)
+static int ql_exec(struct ast_channel *chan, const char *data)
{
char *parse;
@@ -5095,7 +5095,7 @@ static void copy_rules(struct queue_ent *qe, const char *rulename)
* 6. Try 4 again unless some condition (such as an expiration time) causes us to
* exit the queue.
*/
-static int queue_exec(struct ast_channel *chan, void *data)
+static int queue_exec(struct ast_channel *chan, const char *data)
{
int res=-1;
int ringing=0;
@@ -6145,7 +6145,7 @@ static void do_print(struct mansession *s, int fd, const char *str)
* List the queues strategy, calls processed, members logged in,
* other queue statistics such as avg hold time.
*/
-static char *__queues_show(struct mansession *s, int fd, int argc, char **argv)
+static char *__queues_show(struct mansession *s, int fd, int argc, const char * const *argv)
{
struct call_queue *q;
struct ast_str *out = ast_str_alloca(240);
@@ -6320,7 +6320,7 @@ static char *queue_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a
*/
static int manager_queues_show(struct mansession *s, const struct message *m)
{
- char *a[] = { "queue", "show" };
+ static const char * const a[] = { "queue", "show" };
__queues_show(s, -1, 2, a);
astman_append(s, "\r\n\r\n"); /* Properly terminate Manager output */
@@ -6756,7 +6756,7 @@ static int manager_queue_member_penalty(struct mansession *s, const struct messa
static char *handle_queue_add_member(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
- char *queuename, *interface, *membername = NULL, *state_interface = NULL;
+ const char *queuename, *interface, *membername = NULL, *state_interface = NULL;
int penalty;
switch ( cmd ) {
@@ -6871,7 +6871,7 @@ static char *complete_queue_remove_member(const char *line, const char *word, in
static char *handle_queue_remove_member(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
- char *queuename, *interface;
+ const char *queuename, *interface;
switch (cmd) {
case CLI_INIT:
@@ -6936,7 +6936,7 @@ static char *complete_queue_pause_member(const char *line, const char *word, int
static char *handle_queue_pause_member(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
- char *queuename, *interface, *reason;
+ const char *queuename, *interface, *reason;
int paused;
switch (cmd) {
@@ -7010,7 +7010,7 @@ static char *complete_queue_set_member_penalty(const char *line, const char *wor
static char *handle_queue_set_member_penalty(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
- char *queuename = NULL, *interface;
+ const char *queuename = NULL, *interface;
int penalty = 0;
switch (cmd) {
@@ -7072,7 +7072,7 @@ static char *complete_queue_rule_show(const char *line, const char *word, int po
static char *handle_queue_rule_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
- char *rule;
+ const char *rule;
struct rule_list *rl_iter;
struct penalty_rule *pr_iter;
switch (cmd) {
diff --git a/apps/app_read.c b/apps/app_read.c
index d845c5900..3e22d2ef8 100644
--- a/apps/app_read.c
+++ b/apps/app_read.c
@@ -122,9 +122,7 @@ AST_APP_OPTIONS(read_app_options, {
static char *app = "Read";
-#define ast_next_data(instr,ptr,delim) if((ptr=strchr(instr,delim))) { *(ptr) = '\0' ; ptr++;}
-
-static int read_exec(struct ast_channel *chan, void *data)
+static int read_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
char tmp[256] = "";
diff --git a/apps/app_readexten.c b/apps/app_readexten.c
index d5075ede8..ef59aa538 100644
--- a/apps/app_readexten.c
+++ b/apps/app_readexten.c
@@ -125,7 +125,7 @@ AST_APP_OPTIONS(readexten_app_options, {
static char *app = "ReadExten";
-static int readexten_exec(struct ast_channel *chan, void *data)
+static int readexten_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
char exten[256] = "";
diff --git a/apps/app_readfile.c b/apps/app_readfile.c
index b65dbf656..252c4454d 100644
--- a/apps/app_readfile.c
+++ b/apps/app_readfile.c
@@ -67,7 +67,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static char *app_readfile = "ReadFile";
-static int readfile_exec(struct ast_channel *chan, void *data)
+static int readfile_exec(struct ast_channel *chan, const char *data)
{
int res=0;
char *s, *varname=NULL, *file=NULL, *length=NULL, *returnvar=NULL;
diff --git a/apps/app_record.c b/apps/app_record.c
index 69bbd5387..06d9c2cdd 100644
--- a/apps/app_record.c
+++ b/apps/app_record.c
@@ -129,7 +129,7 @@ AST_APP_OPTIONS(app_opts,{
AST_APP_OPTION('x', OPTION_IGNORE_TERMINATE),
});
-static int record_exec(struct ast_channel *chan, void *data)
+static int record_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
int count = 0;
diff --git a/apps/app_rpt.c b/apps/app_rpt.c
index c62ab9924..a261fc144 100644
--- a/apps/app_rpt.c
+++ b/apps/app_rpt.c
@@ -439,7 +439,7 @@ static char *descrip =
static int debug = 0; /* Set this >0 for extra debug output */
static int nrpts = 0;
-static char remdtmfstr[] = "0123456789*#ABCD";
+static const char remdtmfstr[] = "0123456789*#ABCD";
enum {TOP_TOP,TOP_WON,WON_BEFREAD,BEFREAD_AFTERREAD};
@@ -13114,7 +13114,7 @@ char *this,*val;
pthread_exit(NULL);
}
-static int rpt_exec(struct ast_channel *chan, void *data)
+static int rpt_exec(struct ast_channel *chan, const void *data)
{
int res=-1,i,rem_totx,rem_rx,remkeyed,n,phone_mode = 0;
int iskenwood_pci4,authtold,authreq,setting,notremming,reming;
diff --git a/apps/app_sayunixtime.c b/apps/app_sayunixtime.c
index a4dc0afdc..55afdf463 100644
--- a/apps/app_sayunixtime.c
+++ b/apps/app_sayunixtime.c
@@ -89,7 +89,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static char *app_sayunixtime = "SayUnixTime";
static char *app_datetime = "DateTime";
-static int sayunixtime_exec(struct ast_channel *chan, void *data)
+static int sayunixtime_exec(struct ast_channel *chan, const char *data)
{
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(timeval);
diff --git a/apps/app_senddtmf.c b/apps/app_senddtmf.c
index a1c28a8f9..68f2d784f 100644
--- a/apps/app_senddtmf.c
+++ b/apps/app_senddtmf.c
@@ -62,7 +62,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
***/
static char *app = "SendDTMF";
-static int senddtmf_exec(struct ast_channel *chan, void *vdata)
+static int senddtmf_exec(struct ast_channel *chan, const char *vdata)
{
int res = 0;
char *data;
@@ -90,7 +90,7 @@ static int senddtmf_exec(struct ast_channel *chan, void *vdata)
return res;
}
-static char mandescr_playdtmf[] =
+static const char mandescr_playdtmf[] =
"Description: Plays a dtmf digit on the specified channel.\n"
"Variables: (all are required)\n"
" Channel: Channel name to send digit to\n"
diff --git a/apps/app_sendtext.c b/apps/app_sendtext.c
index 2d8ccf811..100358ecf 100644
--- a/apps/app_sendtext.c
+++ b/apps/app_sendtext.c
@@ -72,7 +72,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static const char * const app = "SendText";
-static int sendtext_exec(struct ast_channel *chan, void *data)
+static int sendtext_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
char *status = "UNSUPPORTED";
diff --git a/apps/app_setcallerid.c b/apps/app_setcallerid.c
index 6592249b4..d2dbb8913 100644
--- a/apps/app_setcallerid.c
+++ b/apps/app_setcallerid.c
@@ -84,7 +84,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static char *app2 = "SetCallerPres";
-static int setcallerid_pres_exec(struct ast_channel *chan, void *data)
+static int setcallerid_pres_exec(struct ast_channel *chan, const char *data)
{
int pres = -1;
static int deprecated = 0;
diff --git a/apps/app_skel.c b/apps/app_skel.c
index 338a32f8a..1796ab4f5 100644
--- a/apps/app_skel.c
+++ b/apps/app_skel.c
@@ -94,7 +94,7 @@ AST_APP_OPTIONS(app_opts,{
});
-static int app_exec(struct ast_channel *chan, void *data)
+static int app_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
struct ast_flags flags;
diff --git a/apps/app_sms.c b/apps/app_sms.c
index 0c53391d3..a0e0c2fc0 100644
--- a/apps/app_sms.c
+++ b/apps/app_sms.c
@@ -123,7 +123,7 @@ static char *app = "SMS";
* To pick the two carriers (1300Hz for '1' and 2100 Hz for '0') used by
* the modulation, we should take one every 13 and 21 samples respectively.
*/
-static signed short wave[] = {
+static const signed short wave[] = {
0, 392, 782, 1167, 1545, 1913, 2270, 2612, 2939, 3247, 3536, 3802, 4045, 4263, 4455, 4619, 4755, 4862, 4938, 4985,
5000, 4985, 4938, 4862, 4755, 4619, 4455, 4263, 4045, 3802, 3536, 3247, 2939, 2612, 2270, 1913, 1545, 1167, 782, 392,
0, -392, -782, -1167,
@@ -1855,7 +1855,7 @@ AST_APP_OPTIONS(sms_options, {
AST_APP_OPTION_ARG('p', OPTION_PAUSE, OPTION_ARG_PAUSE),
} );
-static int sms_exec(struct ast_channel *chan, void *data)
+static int sms_exec(struct ast_channel *chan, const char *data)
{
int res = -1;
sms_t h = { 0 };
diff --git a/apps/app_softhangup.c b/apps/app_softhangup.c
index 6a4889acf..2a7ab113a 100644
--- a/apps/app_softhangup.c
+++ b/apps/app_softhangup.c
@@ -69,7 +69,7 @@ AST_APP_OPTIONS(app_opts,{
AST_APP_OPTION('a', OPTION_ALL),
});
-static int softhangup_exec(struct ast_channel *chan, void *data)
+static int softhangup_exec(struct ast_channel *chan, const char *data)
{
struct ast_channel *c = NULL;
char *cut, *opts[0];
diff --git a/apps/app_speech_utils.c b/apps/app_speech_utils.c
index 8ad5e748b..cd1c4d106 100644
--- a/apps/app_speech_utils.c
+++ b/apps/app_speech_utils.c
@@ -481,7 +481,7 @@ static struct ast_custom_function speech_function = {
/*! \brief SpeechCreate() Dialplan Application */
-static int speech_create(struct ast_channel *chan, void *data)
+static int speech_create(struct ast_channel *chan, const char *data)
{
struct ast_speech *speech = NULL;
struct ast_datastore *datastore = NULL;
@@ -508,7 +508,7 @@ static int speech_create(struct ast_channel *chan, void *data)
}
/*! \brief SpeechLoadGrammar(Grammar Name,Path) Dialplan Application */
-static int speech_load(struct ast_channel *chan, void *vdata)
+static int speech_load(struct ast_channel *chan, const char *vdata)
{
int res = 0;
struct ast_speech *speech = find_speech(chan);
@@ -534,7 +534,7 @@ static int speech_load(struct ast_channel *chan, void *vdata)
}
/*! \brief SpeechUnloadGrammar(Grammar Name) Dialplan Application */
-static int speech_unload(struct ast_channel *chan, void *data)
+static int speech_unload(struct ast_channel *chan, const char *data)
{
int res = 0;
struct ast_speech *speech = find_speech(chan);
@@ -549,7 +549,7 @@ static int speech_unload(struct ast_channel *chan, void *data)
}
/*! \brief SpeechDeactivateGrammar(Grammar Name) Dialplan Application */
-static int speech_deactivate(struct ast_channel *chan, void *data)
+static int speech_deactivate(struct ast_channel *chan, const char *data)
{
int res = 0;
struct ast_speech *speech = find_speech(chan);
@@ -564,7 +564,7 @@ static int speech_deactivate(struct ast_channel *chan, void *data)
}
/*! \brief SpeechActivateGrammar(Grammar Name) Dialplan Application */
-static int speech_activate(struct ast_channel *chan, void *data)
+static int speech_activate(struct ast_channel *chan, const char *data)
{
int res = 0;
struct ast_speech *speech = find_speech(chan);
@@ -579,7 +579,7 @@ static int speech_activate(struct ast_channel *chan, void *data)
}
/*! \brief SpeechStart() Dialplan Application */
-static int speech_start(struct ast_channel *chan, void *data)
+static int speech_start(struct ast_channel *chan, const char *data)
{
int res = 0;
struct ast_speech *speech = find_speech(chan);
@@ -593,7 +593,7 @@ static int speech_start(struct ast_channel *chan, void *data)
}
/*! \brief SpeechProcessingSound(Sound File) Dialplan Application */
-static int speech_processing_sound(struct ast_channel *chan, void *data)
+static int speech_processing_sound(struct ast_channel *chan, const char *data)
{
int res = 0;
struct ast_speech *speech = find_speech(chan);
@@ -636,7 +636,7 @@ AST_APP_OPTIONS(speech_background_options, BEGIN_OPTIONS
END_OPTIONS );
/*! \brief SpeechBackground(Sound File,Timeout) Dialplan Application */
-static int speech_background(struct ast_channel *chan, void *data)
+static int speech_background(struct ast_channel *chan, const char *data)
{
unsigned int timeout = 0;
int res = 0, done = 0, started = 0, quieted = 0, max_dtmf_len = 0;
@@ -888,7 +888,7 @@ static int speech_background(struct ast_channel *chan, void *data)
/*! \brief SpeechDestroy() Dialplan Application */
-static int speech_destroy(struct ast_channel *chan, void *data)
+static int speech_destroy(struct ast_channel *chan, const char *data)
{
int res = 0;
struct ast_speech *speech = find_speech(chan);
diff --git a/apps/app_stack.c b/apps/app_stack.c
index 64522afdd..27652c3bd 100644
--- a/apps/app_stack.c
+++ b/apps/app_stack.c
@@ -266,7 +266,7 @@ static void gosub_free(void *data)
ast_free(oldlist);
}
-static int pop_exec(struct ast_channel *chan, void *data)
+static int pop_exec(struct ast_channel *chan, const char *data)
{
struct ast_datastore *stack_store = ast_channel_datastore_find(chan, &stack_info, NULL);
struct gosub_stack_frame *oldframe;
@@ -290,12 +290,12 @@ static int pop_exec(struct ast_channel *chan, void *data)
return 0;
}
-static int return_exec(struct ast_channel *chan, void *data)
+static int return_exec(struct ast_channel *chan, const char *data)
{
struct ast_datastore *stack_store = ast_channel_datastore_find(chan, &stack_info, NULL);
struct gosub_stack_frame *oldframe;
AST_LIST_HEAD(, gosub_stack_frame) *oldlist;
- char *retval = data;
+ const char *retval = data;
if (!stack_store) {
ast_log(LOG_ERROR, "Return without Gosub: stack is unallocated\n");
@@ -320,7 +320,7 @@ static int return_exec(struct ast_channel *chan, void *data)
return 0;
}
-static int gosub_exec(struct ast_channel *chan, void *data)
+static int gosub_exec(struct ast_channel *chan, const char *data)
{
struct ast_datastore *stack_store = ast_channel_datastore_find(chan, &stack_info, NULL);
AST_LIST_HEAD(, gosub_stack_frame) *oldlist;
@@ -410,7 +410,7 @@ static int gosub_exec(struct ast_channel *chan, void *data)
return 0;
}
-static int gosubif_exec(struct ast_channel *chan, void *data)
+static int gosubif_exec(struct ast_channel *chan, const char *data)
{
char *args;
int res=0;
@@ -537,7 +537,7 @@ static struct ast_custom_function peek_function = {
.read = peek_read,
};
-static int handle_gosub(struct ast_channel *chan, AGI *agi, int argc, char **argv)
+static int handle_gosub(struct ast_channel *chan, AGI *agi, int argc, const char * const *argv)
{
int old_priority, priority;
char old_context[AST_MAX_CONTEXT], old_extension[AST_MAX_EXTENSION];
@@ -627,7 +627,7 @@ static int handle_gosub(struct ast_channel *chan, AGI *agi, int argc, char **arg
return RESULT_SUCCESS;
}
-static char usage_gosub[] =
+static const char usage_gosub[] =
" Usage: GOSUB <context> <extension> <priority> [<optional-argument>]\n"
" Cause the channel to execute the specified dialplan subroutine, returning\n"
" to the dialplan with execution of a Return()\n";
diff --git a/apps/app_system.c b/apps/app_system.c
index e06a9cb5d..6fa2fc962 100644
--- a/apps/app_system.c
+++ b/apps/app_system.c
@@ -100,7 +100,7 @@ static char *app2 = "TrySystem";
static char *chanvar = "SYSTEMSTATUS";
-static int system_exec_helper(struct ast_channel *chan, void *data, int failmode)
+static int system_exec_helper(struct ast_channel *chan, const char *data, int failmode)
{
int res = 0;
struct ast_str *buf = ast_str_thread_get(&buf_buf, 16);
@@ -140,12 +140,12 @@ static int system_exec_helper(struct ast_channel *chan, void *data, int failmode
return res;
}
-static int system_exec(struct ast_channel *chan, void *data)
+static int system_exec(struct ast_channel *chan, const char *data)
{
return system_exec_helper(chan, data, -1);
}
-static int trysystem_exec(struct ast_channel *chan, void *data)
+static int trysystem_exec(struct ast_channel *chan, const char *data)
{
return system_exec_helper(chan, data, 0);
}
diff --git a/apps/app_talkdetect.c b/apps/app_talkdetect.c
index 85f0dff4e..c90b60d36 100644
--- a/apps/app_talkdetect.c
+++ b/apps/app_talkdetect.c
@@ -73,7 +73,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static char *app = "BackgroundDetect";
-static int background_detect_exec(struct ast_channel *chan, void *data)
+static int background_detect_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
char *tmp;
diff --git a/apps/app_test.c b/apps/app_test.c
index 76a953f0c..64ce7b43f 100644
--- a/apps/app_test.c
+++ b/apps/app_test.c
@@ -143,10 +143,10 @@ static int sendnoise(struct ast_channel *chan, int ms)
return res;
}
-static int testclient_exec(struct ast_channel *chan, void *data)
+static int testclient_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
- char *testid=data;
+ const char *testid=data;
char fn[80];
char serverver[80];
FILE *f;
@@ -318,7 +318,7 @@ static int testclient_exec(struct ast_channel *chan, void *data)
return res;
}
-static int testserver_exec(struct ast_channel *chan, void *data)
+static int testserver_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
char testid[80]="";
diff --git a/apps/app_transfer.c b/apps/app_transfer.c
index 11107a1ba..ad6e8011e 100644
--- a/apps/app_transfer.c
+++ b/apps/app_transfer.c
@@ -74,7 +74,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static const char * const app = "Transfer";
-static int transfer_exec(struct ast_channel *chan, void *data)
+static int transfer_exec(struct ast_channel *chan, const char *data)
{
int res;
int len;
diff --git a/apps/app_url.c b/apps/app_url.c
index af72b44ef..234cff619 100644
--- a/apps/app_url.c
+++ b/apps/app_url.c
@@ -90,7 +90,7 @@ AST_APP_OPTIONS(app_opts,{
AST_APP_OPTION('w', OPTION_WAIT),
});
-static int sendurl_exec(struct ast_channel *chan, void *data)
+static int sendurl_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
char *tmp;
diff --git a/apps/app_userevent.c b/apps/app_userevent.c
index f716ccba6..092f22f25 100644
--- a/apps/app_userevent.c
+++ b/apps/app_userevent.c
@@ -56,7 +56,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static char *app = "UserEvent";
-static int userevent_exec(struct ast_channel *chan, void *data)
+static int userevent_exec(struct ast_channel *chan, const char *data)
{
char *parse;
int x;
diff --git a/apps/app_verbose.c b/apps/app_verbose.c
index a900dcacb..ed86e5e6a 100644
--- a/apps/app_verbose.c
+++ b/apps/app_verbose.c
@@ -72,7 +72,7 @@ static char *app_log = "Log";
***/
-static int verbose_exec(struct ast_channel *chan, void *data)
+static int verbose_exec(struct ast_channel *chan, const char *data)
{
int vsize;
char *parse;
@@ -118,7 +118,7 @@ static int verbose_exec(struct ast_channel *chan, void *data)
return 0;
}
-static int log_exec(struct ast_channel *chan, void *data)
+static int log_exec(struct ast_channel *chan, const char *data)
{
char *parse;
int lnum = -1;
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 07bd8aa19..4362dbcd8 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -5090,8 +5090,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
return -1;
}
- ast_str_set(&tmp, 0, "%s", ext);
- ext = ast_str_buffer(tmp);
+ ext = ast_strdupa(ext);
if ((context = strchr(ext, '@'))) {
*context++ = '\0';
tmpptr = strchr(context, '&');
@@ -8947,7 +8946,7 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
return 0;
}
-static int vm_execmain(struct ast_channel *chan, void *data)
+static int vm_execmain(struct ast_channel *chan, const char *data)
{
/* XXX This is, admittedly, some pretty horrendous code. For some
reason it just seemed a lot easier to do with GOTO's. I feel
@@ -9655,7 +9654,7 @@ out:
return res;
}
-static int vm_exec(struct ast_channel *chan, void *data)
+static int vm_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
char *tmp;
@@ -9787,7 +9786,7 @@ static int append_mailbox(const char *context, const char *box, const char *data
return 0;
}
-static int vm_box_exists(struct ast_channel *chan, void *data)
+static int vm_box_exists(struct ast_channel *chan, const char *data)
{
struct ast_vm_user svm;
char *context, *box;
@@ -9851,16 +9850,16 @@ static struct ast_custom_function mailbox_exists_acf = {
.read = acf_mailbox_exists,
};
-static int vmauthenticate(struct ast_channel *chan, void *data)
+static int vmauthenticate(struct ast_channel *chan, const char *data)
{
- char *s = data, *user=NULL, *context=NULL, mailbox[AST_MAX_EXTENSION] = "";
+ char *s, *user=NULL, *context=NULL, mailbox[AST_MAX_EXTENSION] = "";
struct ast_vm_user vmus;
char *options = NULL;
int silent = 0, skipuser = 0;
int res = -1;
- if (s) {
- s = ast_strdupa(s);
+ if (data) {
+ s = ast_strdupa(data);
user = strsep(&s, ",");
options = strsep(&s, ",");
if (user) {
diff --git a/apps/app_waitforring.c b/apps/app_waitforring.c
index fd5913e04..8edd249f5 100644
--- a/apps/app_waitforring.c
+++ b/apps/app_waitforring.c
@@ -53,7 +53,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static char *app = "WaitForRing";
-static int waitforring_exec(struct ast_channel *chan, void *data)
+static int waitforring_exec(struct ast_channel *chan, const char *data)
{
struct ast_frame *f;
int res = 0;
diff --git a/apps/app_waitforsilence.c b/apps/app_waitforsilence.c
index f68b70ad3..6339b0192 100644
--- a/apps/app_waitforsilence.c
+++ b/apps/app_waitforsilence.c
@@ -202,7 +202,7 @@ static int do_waiting(struct ast_channel *chan, int timereqd, time_t waitstart,
return res;
}
-static int waitfor_exec(struct ast_channel *chan, void *data, int wait_for_silence)
+static int waitfor_exec(struct ast_channel *chan, const char *data, int wait_for_silence)
{
int res = 1;
int timereqd = 1000;
@@ -232,12 +232,12 @@ static int waitfor_exec(struct ast_channel *chan, void *data, int wait_for_silen
return res;
}
-static int waitforsilence_exec(struct ast_channel *chan, void *data)
+static int waitforsilence_exec(struct ast_channel *chan, const char *data)
{
return waitfor_exec(chan, data, 1);
}
-static int waitfornoise_exec(struct ast_channel *chan, void *data)
+static int waitfornoise_exec(struct ast_channel *chan, const char *data)
{
return waitfor_exec(chan, data, 0);
}
diff --git a/apps/app_waituntil.c b/apps/app_waituntil.c
index 0b6ccc677..9f13157be 100644
--- a/apps/app_waituntil.c
+++ b/apps/app_waituntil.c
@@ -67,7 +67,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static char *app = "WaitUntil";
-static int waituntil_exec(struct ast_channel *chan, void *data)
+static int waituntil_exec(struct ast_channel *chan, const char *data)
{
int res;
double fraction;
diff --git a/apps/app_while.c b/apps/app_while.c
index 055613628..f8144fc07 100644
--- a/apps/app_while.c
+++ b/apps/app_while.c
@@ -186,7 +186,7 @@ static int find_matching_endwhile(struct ast_channel *chan)
return res;
}
-static int _while_exec(struct ast_channel *chan, void *data, int end)
+static int _while_exec(struct ast_channel *chan, const char *data, int end)
{
int res=0;
const char *while_pri = NULL;
@@ -296,19 +296,19 @@ static int _while_exec(struct ast_channel *chan, void *data, int end)
return res;
}
-static int while_start_exec(struct ast_channel *chan, void *data) {
+static int while_start_exec(struct ast_channel *chan, const char *data) {
return _while_exec(chan, data, 0);
}
-static int while_end_exec(struct ast_channel *chan, void *data) {
+static int while_end_exec(struct ast_channel *chan, const char *data) {
return _while_exec(chan, data, 1);
}
-static int while_exit_exec(struct ast_channel *chan, void *data) {
+static int while_exit_exec(struct ast_channel *chan, const char *data) {
return _while_exec(chan, data, 2);
}
-static int while_continue_exec(struct ast_channel *chan, void *data)
+static int while_continue_exec(struct ast_channel *chan, const char *data)
{
int x;
const char *prefix = "WHILE", *while_pri=NULL;
diff --git a/apps/app_zapateller.c b/apps/app_zapateller.c
index bf9408090..4be09b59c 100644
--- a/apps/app_zapateller.c
+++ b/apps/app_zapateller.c
@@ -74,7 +74,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static char *app = "Zapateller";
-static int zapateller_exec(struct ast_channel *chan, void *data)
+static int zapateller_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
int i, answer = 0, nocallerid = 0;