Index: apps/app_adsiprog.c =================================================================== --- apps/app_adsiprog.c (revision 48151) +++ apps/app_adsiprog.c (working copy) @@ -49,22 +49,22 @@ #include "asterisk/utils.h" #include "asterisk/lock.h" -static char *app = "ADSIProg"; +static const char app[] = "ADSIProg"; -static char *synopsis = "Load Asterisk ADSI Scripts into phone"; +static const char synopsis[] = "Load Asterisk ADSI Scripts into phone"; /* #define DUMP_MESSAGES */ -static char *descrip = +static const char descrip[] = " ADSIProg(script): This application programs an ADSI Phone with the given\n" "script. If nothing is specified, the default script (asterisk.adsi) is used.\n"; struct adsi_event { - int id; - char *name; + const int id; + const char *name; }; -static struct adsi_event events[] = { +static const struct adsi_event events[] = { { 1, "CALLERID" }, { 2, "VMWI" }, { 3, "NEARANSWER" }, @@ -91,7 +91,7 @@ { 24, "CPEID" }, }; -static struct adsi_event justify[] = { +static const struct adsi_event justify[] = { { 0, "CENTER" }, { 1, "RIGHT" }, { 2, "LEFT" }, @@ -175,7 +175,7 @@ }; -static int process_token(void *out, char *src, int maxlen, int argtype) +static int process_token(void *out, const char *src, int maxlen, int argtype) { if ((strlen(src) > 1) && src[0] == '\"') { /* This is a quoted string */ @@ -252,7 +252,7 @@ return keyword; } -static char *validdtmf = "123456789*0#ABCD"; +static const 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) { Index: apps/app_alarmreceiver.c =================================================================== --- apps/app_alarmreceiver.c (revision 48151) +++ apps/app_alarmreceiver.c (working copy) @@ -68,10 +68,10 @@ typedef struct event_node event_node_t; -static char *app = "AlarmReceiver"; +static const char app[] = "AlarmReceiver"; -static char *synopsis = "Provide support for receiving alarm reports from a burglar or fire alarm panel"; -static char *descrip = +static const char synopsis[] = "Provide support for receiving alarm reports from a burglar or fire alarm panel"; +static const char descrip[] = " AlarmReceiver(): Only 1 signalling format is supported at this time: Ademco\n" "Contact ID. This application should be called whenever there is an alarm\n" "panel calling in to dump its events. The application will handshake with the\n" @@ -456,8 +456,8 @@ int events_received = 0; int ack_retries = 0; - static char digit_map[15] = "0123456789*#ABC"; - static unsigned char digit_weights[15] = {10,1,2,3,4,5,6,7,8,9,11,12,13,14,15}; + static const char digit_map[15] = "0123456789*#ABC"; + static const unsigned char digit_weights[15] = {10,1,2,3,4,5,6,7,8,9,11,12,13,14,15}; database_increment("calls-received"); Index: apps/app_amd.c =================================================================== --- apps/app_amd.c (revision 48151) +++ apps/app_amd.c (working copy) @@ -36,9 +36,9 @@ #include "asterisk/app.h" -static char *app = "AMD"; -static char *synopsis = "Attempts to detect answering machines"; -static char *descrip = +static const char app[] = "AMD"; +static const char synopsis[] = "Attempts to detect answering machines"; +static const char descrip[] = " AMD([initialSilence][|greeting][|afterGreetingSilence][|totalAnalysisTime]\n" " [|minimumWordLength][|betweenWordsSilence][|maximumNumberOfWords]\n" " [|silenceThreshold])\n" Index: apps/app_authenticate.c =================================================================== --- apps/app_authenticate.c (revision 48151) +++ apps/app_authenticate.c (working copy) @@ -63,11 +63,11 @@ }); -static char *app = "Authenticate"; +static const char app =[] "Authenticate"; -static char *synopsis = "Authenticate a user"; +static const char synopsis[] = "Authenticate a user"; -static char *descrip = +static const char descrip[] = " Authenticate(password[|options[|maxdigits]]): This application asks the caller\n" "to enter a given password in order to continue dialplan execution. If the password\n" "begins with the '/' character, it is interpreted as a file which contains a list of\n" Index: apps/app_cdr.c =================================================================== --- apps/app_cdr.c (revision 48151) +++ apps/app_cdr.c (working copy) @@ -36,12 +36,12 @@ #include "asterisk/module.h" #include "asterisk/pbx.h" -static char *nocdr_descrip = +static const char nocdr_descrip[] = " NoCDR(): This application will tell Asterisk not to maintain a CDR for the\n" "current call.\n"; -static char *nocdr_app = "NoCDR"; -static char *nocdr_synopsis = "Tell Asterisk to not maintain a CDR for the current call"; +static const char nocdr_app[] = "NoCDR"; +static const char nocdr_synopsis[] = "Tell Asterisk to not maintain a CDR for the current call"; static int nocdr_exec(struct ast_channel *chan, void *data) Index: apps/app_chanisavail.c =================================================================== --- apps/app_chanisavail.c (revision 48151) +++ apps/app_chanisavail.c (working copy) @@ -48,11 +48,11 @@ #include "asterisk/devicestate.h" #include "asterisk/options.h" -static char *app = "ChanIsAvail"; +static const char app[] = "ChanIsAvail"; -static char *synopsis = "Check channel availability"; +static const char synopsis[] = "Check channel availability"; -static char *descrip = +static const char descrip[] = " ChanIsAvail(Technology/resource[&Technology2/resource2...][|options]): \n" "This application will check to see if any of the specified channels are\n" "available. The following variables will be set by this application:\n" Index: apps/app_channelredirect.c =================================================================== --- apps/app_channelredirect.c (revision 48151) +++ apps/app_channelredirect.c (working copy) @@ -42,9 +42,9 @@ #include "asterisk/features.h" #include "asterisk/options.h" -static char *app = "ChannelRedirect"; -static char *synopsis = "Redirects given channel to a dialplan target."; -static char *descrip = +static const char app[] = "ChannelRedirect"; +static const char synopsis[] = "Redirects given channel to a dialplan target."; +static const char descrip[] = "ChannelRedirect(channel|[[context|]extension|]priority):\n" " Sends the specified channel to the specified extension priority\n"; Index: apps/app_chanspy.c =================================================================== --- apps/app_chanspy.c (revision 48151) +++ apps/app_chanspy.c (working copy) @@ -214,7 +214,7 @@ /* Map 'volume' levels from -4 through +4 into decibel (dB) settings for channel drivers */ -static signed char volfactor_map[] = { +static const signed char volfactor_map[] = { -24, -18, -12, @@ -232,9 +232,11 @@ */ static void set_volume(struct ast_channel *chan, struct chanspy_translation_helper *csth) { - signed char volume_adjust = volfactor_map[csth->volfactor + 4]; - - if (!ast_channel_setoption(chan, AST_OPTION_TXGAIN, &volume_adjust, sizeof(volume_adjust), 0)) + if (!ast_channel_setoption(chan, + AST_OPTION_TXGAIN, + &(volfactor_map[csth->volfactor + 4]), + sizeof(volfactor_map[0]), + 0)) csth->volfactor = 0; csth->spy.read_vol_adjustment = csth->volfactor; csth->spy.write_vol_adjustment = csth->volfactor; Index: apps/app_controlplayback.c =================================================================== --- apps/app_controlplayback.c (revision 48151) +++ apps/app_controlplayback.c (working copy) @@ -44,11 +44,11 @@ #include "asterisk/utils.h" #include "asterisk/options.h" -static const char *app = "ControlPlayback"; +static const char app[] = "ControlPlayback"; -static const char *synopsis = "Play a file with fast forward and rewind"; +static const char synopsis[] = "Play a file with fast forward and rewind"; -static const char *descrip = +static const char descrip[] = " ControlPlayback(file[|skipms[|ff[|rew[|stop[|pause[|restart|options]]]]]]]):\n" "This application will play back the given filename. By default, the '*' key\n" "can be used to rewind, and the '#' key can be used to fast-forward.\n" Index: apps/app_db.c =================================================================== --- apps/app_db.c (revision 48151) +++ apps/app_db.c (working copy) @@ -49,20 +49,20 @@ #include "asterisk/options.h" /*! \todo XXX Remove this application after 1.4 is relased */ -static char *d_descrip = +static const char d_descrip[] = " DBdel(family/key): This applicaiton will delete a key from the Asterisk\n" "database.\n" " This application has been DEPRECATED in favor of the DB_DELETE function.\n"; -static char *dt_descrip = +static const char dt_descrip[] = " DBdeltree(family[/keytree]): This application will delete a family or keytree\n" "from the Asterisk database\n"; -static char *d_app = "DBdel"; -static char *dt_app = "DBdeltree"; +static const char d_app[] = "DBdel"; +static const char dt_app[] = "DBdeltree"; -static char *d_synopsis = "Delete a key from the database"; -static char *dt_synopsis = "Delete a family or keytree from the database"; +static const char d_synopsis[] = "Delete a key from the database"; +static const char dt_synopsis[] = "Delete a family or keytree from the database"; static int deltree_exec(struct ast_channel *chan, void *data) Index: apps/app_dial.c =================================================================== --- apps/app_dial.c (revision 48151) +++ apps/app_dial.c (working copy) @@ -61,11 +61,11 @@ #include "asterisk/privacy.h" #include "asterisk/stringfields.h" -static char *app = "Dial"; +static const char app[] = "Dial"; -static char *synopsis = "Place a call and connect to the current channel"; +static const char synopsis[] = "Place a call and connect to the current channel"; -static char *descrip = +static const char descrip[] = " Dial(Technology/resource[&Tech2/resource2...][|timeout][|options][|URL]):\n" "This applicaiton will place calls to one or more specified channels. As soon\n" "as one of the requested channels answers, the originating channel will be\n" @@ -194,9 +194,9 @@ " the DTMF sequence defined for call parking in features.conf.\n"; /* RetryDial App by Anthony Minessale II Jan/2005 */ -static char *rapp = "RetryDial"; -static char *rsynopsis = "Place a call, retrying on failure allowing optional exit extension."; -static char *rdescrip = +static const char rapp[] = "RetryDial"; +static const char rsynopsis[] = "Place a call, retrying on failure allowing optional exit extension."; +static const char rdescrip[] = " RetryDial(announce|sleep|retries|dialargs): This application will attempt to\n" "place a call using the normal Dial application. If no channel can be reached,\n" "the 'announce' file will be played. Then, it will wait 'sleep' number of\n" Index: apps/app_dictate.c =================================================================== --- apps/app_dictate.c (revision 48151) +++ apps/app_dictate.c (working copy) @@ -46,9 +46,9 @@ #include "asterisk/lock.h" #include "asterisk/app.h" -static char *app = "Dictate"; -static char *synopsis = "Virtual Dictation Machine"; -static char *desc = " Dictate([[|]])\n" +static const char app[] = "Dictate"; +static const char synopsis[] = "Virtual Dictation Machine"; +static const char desc[] = " Dictate([[|]])\n" "Start dictation machine using optional base dir for files.\n"; Index: apps/app_directed_pickup.c =================================================================== --- apps/app_directed_pickup.c (revision 48151) +++ apps/app_directed_pickup.c (working copy) @@ -45,9 +45,9 @@ #define PICKUPMARK "PICKUPMARK" -static const char *app = "Pickup"; -static const char *synopsis = "Directed Call Pickup"; -static const char *descrip = +static const char app[] = "Pickup"; +static const char synopsis[] = "Directed Call Pickup"; +static const char descrip[] = " Pickup(extension[@context][&extension2@context...]): This application can pickup any ringing channel\n" "that is calling the specified extension. If no context is specified, the current\n" "context will be used. If you use the special string \"PICKUPMARK\" for the context parameter, for example\n" Index: apps/app_directory.c =================================================================== --- apps/app_directory.c (revision 48151) +++ apps/app_directory.c (working copy) @@ -55,10 +55,10 @@ static char vmfmts[80] = "wav"; #endif -static char *app = "Directory"; +static const char app[] = "Directory"; -static char *synopsis = "Provide directory of voicemail extensions"; -static char *descrip = +static const char synopsis[] = "Provide directory of voicemail extensions"; +static const char descrip[] = " Directory(vm-context[|dial-context[|options]]): This application will present\n" "the calling channel with a directory of extensions from which they can search\n" "by name. The list of names and corresponding extensions is retrieved from the\n" Index: apps/app_disa.c =================================================================== --- apps/app_disa.c (revision 48151) +++ apps/app_disa.c (working copy) @@ -50,11 +50,11 @@ #include "asterisk/stringfields.h" #include "asterisk/options.h" -static char *app = "DISA"; +static const char app[] = "DISA"; -static char *synopsis = "DISA (Direct Inward System Access)"; +static const char synopsis[] = "DISA (Direct Inward System Access)"; -static char *descrip = +static const char descrip[] = "DISA([|]) or DISA()\n" "The DISA, Direct Inward System Access, application allows someone from \n" "outside the telephone switch (PBX) to obtain an \"internal\" system \n" Index: apps/app_dumpchan.c =================================================================== --- apps/app_dumpchan.c (revision 48151) +++ apps/app_dumpchan.c (working copy) @@ -47,9 +47,9 @@ #include "asterisk/lock.h" #include "asterisk/utils.h" -static char *app = "DumpChan"; -static char *synopsis = "Dump Info About The Calling Channel"; -static char *desc = +static const char app[] = "DumpChan"; +static const char synopsis[] = "Dump Info About The Calling Channel"; +static const char desc[] = " DumpChan([])\n" "Displays information on channel and listing of all channel\n" "variables. If min_verbose_level is specified, output is only\n" Index: apps/app_echo.c =================================================================== --- apps/app_echo.c (revision 48151) +++ apps/app_echo.c (working copy) @@ -41,11 +41,11 @@ #include "asterisk/pbx.h" #include "asterisk/module.h" -static char *app = "Echo"; +static const char app[] = "Echo"; -static char *synopsis = "Echo audio, video, or DTMF back to the calling party"; +static const char synopsis[] = "Echo audio, video, or DTMF back to the calling party"; -static char *descrip = +static const char descrip[] = " Echo(): This application will echo any audio, video, or DTMF frames read from\n" "the calling channel back to itself. If the DTMF digit '#' is received, the\n" "application will exit.\n"; Index: apps/app_exec.c =================================================================== --- apps/app_exec.c (revision 48151) +++ apps/app_exec.c (working copy) @@ -57,9 +57,9 @@ * affecting the dialplan. */ -static char *app_exec = "Exec"; -static char *exec_synopsis = "Executes dialplan application"; -static char *exec_descrip = +static const char app_exec[] = "Exec"; +static const char exec_synopsis[] = "Executes dialplan application"; +static const char exec_descrip[] = "Usage: Exec(appname(arguments))\n" " Allows an arbitrary application to be invoked even when not\n" "hardcoded into the dialplan. If the underlying application\n" @@ -68,9 +68,9 @@ " To invoke external applications, see the application System.\n" " If you would like to catch any error instead, see TryExec.\n"; -static char *app_tryexec = "TryExec"; -static char *tryexec_synopsis = "Executes dialplan application, always returning"; -static char *tryexec_descrip = +static const char app_tryexec[] = "TryExec"; +static const char tryexec_synopsis[] = "Executes dialplan application, always returning"; +static const char tryexec_descrip[] = "Usage: TryExec(appname(arguments))\n" " Allows an arbitrary application to be invoked even when not\n" "hardcoded into the dialplan. To invoke external applications\n" @@ -80,9 +80,9 @@ " FAILED if the application returned non-zero\n" " NOAPP if the application was not found or was not specified\n"; -static char *app_execif = "ExecIf"; -static char *execif_synopsis = "Executes dialplan application, conditionally"; -static char *execif_descrip = +static const char app_execif[] = "ExecIf"; +static const char execif_synopsis[] = "Executes dialplan application, conditionally"; +static const char execif_descrip[] = "Usage: ExecIF (||)\n" "If is true, execute and return the result of ().\n" "If is true, but is not found, then the application\n" Index: apps/app_externalivr.c =================================================================== --- apps/app_externalivr.c (revision 48151) +++ apps/app_externalivr.c (working copy) @@ -52,11 +52,11 @@ #include "asterisk/utils.h" #include "asterisk/options.h" -static const char *app = "ExternalIVR"; +static const char app[] = "ExternalIVR"; -static const char *synopsis = "Interfaces with an external IVR application"; +static const char synopsis[] = "Interfaces with an external IVR application"; -static const char *descrip = +static const char descrip[] = " ExternalIVR(command[|arg[|arg...]]): Forks an process to run the supplied command,\n" "and starts a generator on the channel. The generator's play list is\n" "controlled by the external application, which can add and clear entries\n" Index: apps/app_festival.c =================================================================== --- apps/app_festival.c (revision 48151) +++ apps/app_festival.c (working copy) @@ -59,11 +59,11 @@ #define FESTIVAL_CONFIG "festival.conf" -static char *app = "Festival"; +static const char app[] = "Festival"; -static char *synopsis = "Say text to the user"; +static const char synopsis[] = "Say text to the user"; -static char *descrip = +static const char descrip[] = " Festival(text[|intkeys]): Connect to Festival, send the argument, get back the waveform," "play it to the user, allowing any given interrupt keys to immediately terminate and return\n" "the value, or 'any' to allow any number back (useful in dialplan)\n"; Index: apps/app_flash.c =================================================================== --- apps/app_flash.c (revision 48151) +++ apps/app_flash.c (working copy) @@ -50,11 +50,11 @@ #include "asterisk/image.h" #include "asterisk/options.h" -static char *app = "Flash"; +static const char app[] = "Flash"; -static char *synopsis = "Flashes a Zap Trunk"; +static const char synopsis[] = "Flashes a Zap Trunk"; -static char *descrip = +static const char descrip[] = " Flash(): Sends a flash on a zap trunk. This is only a hack for\n" "people who want to perform transfers and such via AGI and is generally\n" "quite useless oths application will only work on Zap trunks.\n"; Index: apps/app_followme.c =================================================================== --- apps/app_followme.c (revision 49004) +++ apps/app_followme.c (working copy) @@ -58,9 +58,9 @@ #include "asterisk/astdb.h" #include "asterisk/app.h" -static char *app = "FollowMe"; -static char *synopsis = "Find-Me/Follow-Me application"; -static char *descrip = +static const char app[] = "FollowMe"; +static const char synopsis[] = "Find-Me/Follow-Me application"; +static const char descrip[] = " FollowMe(followmeid|options):\n" "This application performs Find-Me/Follow-Me functionality for the caller\n" "as defined in the profile matching the parameter in\n" Index: apps/app_forkcdr.c =================================================================== --- apps/app_forkcdr.c (revision 48151) +++ apps/app_forkcdr.c (working copy) @@ -42,10 +42,10 @@ #include "asterisk/cdr.h" #include "asterisk/module.h" -static char *app = "ForkCDR"; -static char *synopsis = +static const char app[] = "ForkCDR"; +static const char synopsis[] = "Forks the Call Data Record"; -static char *descrip = +static const char descrip[] = " ForkCDR([options]): Causes the Call Data Record to fork an additional\n" "cdr record starting from the time of the fork call\n" "If the option 'v' is passed all cdr variables will be passed along also.\n"; Index: apps/app_getcpeid.c =================================================================== --- apps/app_getcpeid.c (revision 48151) +++ apps/app_getcpeid.c (working copy) @@ -43,11 +43,11 @@ #include "asterisk/adsi.h" #include "asterisk/options.h" -static char *app = "GetCPEID"; +static const char app[] = "GetCPEID"; -static char *synopsis = "Get ADSI CPE ID"; +static const char synopsis[] = "Get ADSI CPE ID"; -static char *descrip = +static const char descrip[] = " GetCPEID: Obtains and displays ADSI CPE ID and other information in order\n" "to properly setup zapata.conf for on-hook operations.\n"; Index: apps/app_ices.c =================================================================== --- apps/app_ices.c (revision 48151) +++ apps/app_ices.c (working copy) @@ -51,17 +51,17 @@ #define ICES "/usr/bin/ices" #define LOCAL_ICES "/usr/local/bin/ices" -static char *app = "ICES"; +static const char app[] = "ICES"; -static char *synopsis = "Encode and stream using 'ices'"; +static const char synopsis[] = "Encode and stream using 'ices'"; -static char *descrip = +static const char descrip[] = " ICES(config.xml) Streams to an icecast server using ices\n" "(available separately). A configuration file must be supplied\n" "for ices (see examples/asterisk-ices.conf). \n"; -static int icesencode(char *filename, int fd) +static int icesencode(const char *filename, int fd) { int res; int x; Index: apps/app_image.c =================================================================== --- apps/app_image.c (revision 48151) +++ apps/app_image.c (working copy) @@ -44,11 +44,11 @@ #include "asterisk/app.h" #include "asterisk/options.h" -static char *app = "SendImage"; +static const char app[] = "SendImage"; -static char *synopsis = "Send an image file"; +static const char synopsis[] = "Send an image file"; -static char *descrip = +static const char descrip[] = " SendImage(filename): Sends an image on a channel. \n" "If the channel supports image transport but the image send\n" "fails, the channel will be hung up. Otherwise, the dialplan\n" Index: apps/app_ivrdemo.c =================================================================== --- apps/app_ivrdemo.c (revision 48151) +++ apps/app_ivrdemo.c (working copy) @@ -46,9 +46,9 @@ #include "asterisk/lock.h" #include "asterisk/app.h" -static char *tdesc = "IVR Demo Application"; -static char *app = "IVRDemo"; -static char *synopsis = +static const char tdesc[] = "IVR Demo Application"; +static const char app[] = "IVRDemo"; +static const char synopsis[] = " This is a skeleton application that shows you the basic structure to create your\n" "own asterisk applications and demonstrates the IVR demo.\n"; Index: apps/app_macro.c =================================================================== --- apps/app_macro.c (revision 48151) +++ apps/app_macro.c (working copy) @@ -50,7 +50,7 @@ /* special result value used to force macro exit */ #define MACRO_EXIT_RESULT 1024 -static char *descrip = +static const char descrip[] = " Macro(macroname|arg1|arg2...): Executes a macro using the context\n" "'macro-', jumping to the 's' extension of that context and\n" "executing each step, then returning when the steps end. \n" @@ -70,35 +70,35 @@ " if you need to deeply nest macro calls, that you use the Gosub application\n" " (now allows arguments like a Macro) with explict Return() calls instead.\n"; -static char *if_descrip = +static const char if_descrip[] = " MacroIf(?macroname_a[|arg1][:macroname_b[|arg1]])\n" "Executes macro defined in if is true\n" "(otherwise if provided)\n" "Arguments and return values as in application macro()\n"; -static char *exclusive_descrip = +static const char exclusive_descrip[] = " MacroExclusive(macroname|arg1|arg2...):\n" "Executes macro defined in the context 'macro-macroname'\n" "Only one call at a time may run the macro.\n" "(we'll wait if another call is busy executing in the Macro)\n" "Arguments and return values as in application Macro()\n"; -static char *exit_descrip = +static const char exit_descrip[] = " MacroExit():\n" "Causes the currently running macro to exit as if it had\n" "ended normally by running out of priorities to execute.\n" "If used outside a macro, will likely cause unexpected\n" "behavior.\n"; -static char *app = "Macro"; -static char *if_app = "MacroIf"; -static char *exclusive_app = "MacroExclusive"; -static char *exit_app = "MacroExit"; +static const char app[] = "Macro"; +static const char if_app[] = "MacroIf"; +static const char exclusive_app[] = "MacroExclusive"; +static const char exit_app[] = "MacroExit"; -static char *synopsis = "Macro Implementation"; -static char *if_synopsis = "Conditional Macro Implementation"; -static char *exclusive_synopsis = "Exclusive Macro Implementation"; -static char *exit_synopsis = "Exit From Macro"; +static const char synopsis[] = "Macro Implementation"; +static const char if_synopsis[] = "Conditional Macro Implementation"; +static const char exclusive_synopsis[] = "Exclusive Macro Implementation"; +static const char exit_synopsis[] = "Exit From Macro"; static int _macro_exec(struct ast_channel *chan, void *data, int exclusive) Index: apps/app_meetme.c =================================================================== --- apps/app_meetme.c (revision 48151) +++ apps/app_meetme.c (working copy) @@ -388,7 +388,7 @@ * conversion... the numbers have been modified * to give the user a better level of adjustability */ -static signed char gain_map[] = { +static const signed char gain_map[] = { -15, -13, -10, @@ -836,7 +836,7 @@ static char *complete_meetmecmd(const char *line, const char *word, int pos, int state) { - static char *cmds[] = {"lock", "unlock", "mute", "unmute", "kick", "list", NULL}; + static const char *cmds[] = {"lock", "unlock", "mute", "unmute", "kick", "list", NULL}; int len = strlen(word); int which = 0; @@ -896,15 +896,15 @@ return NULL; } -static char meetme_usage[] = +static const char meetme_usage[] = "Usage: meetme (un)lock|(un)mute|kick|list [concise] \n" " Executes a command for the conference or on a conferee\n"; -static char sla_show_usage[] = +static const char sla_show_usage[] = "Usage: sla show\n" " Lists status of all shared line appearances\n"; -static struct ast_cli_entry cli_meetme[] = { +static const struct ast_cli_entry cli_meetme[] = { { { "sla", "show", NULL }, sla_show, "Show status of Shared Line Appearances", sla_show_usage, NULL }, Index: apps/app_milliwatt.c =================================================================== --- apps/app_milliwatt.c (revision 48151) +++ apps/app_milliwatt.c (working copy) @@ -43,15 +43,15 @@ #include "asterisk/module.h" #include "asterisk/utils.h" -static char *app = "Milliwatt"; +static const char app[] = "Milliwatt"; -static char *synopsis = "Generate a Constant 1000Hz tone at 0dbm (mu-law)"; +static const char synopsis[] = "Generate a Constant 1000Hz tone at 0dbm (mu-law)"; -static char *descrip = +static const char descrip[] = "Milliwatt(): Generate a Constant 1000Hz tone at 0dbm (mu-law)\n"; -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) { Index: apps/app_mixmonitor.c =================================================================== --- apps/app_mixmonitor.c (revision 48151) +++ apps/app_mixmonitor.c (working copy) @@ -421,7 +421,7 @@ return ast_complete_channels(line, word, pos, state, 2); } -static struct ast_cli_entry cli_mixmonitor[] = { +static const struct ast_cli_entry cli_mixmonitor[] = { { { "mixmonitor", NULL, NULL }, mixmonitor_cli, "Execute a MixMonitor command.", "mixmonitor [args]\n\n" Index: apps/app_morsecode.c =================================================================== --- apps/app_morsecode.c (revision 48151) +++ apps/app_morsecode.c (working copy) @@ -41,11 +41,11 @@ #include "asterisk/module.h" #include "asterisk/indications.h" -static char *app_morsecode = "Morsecode"; +static const char app_morsecode[] = "Morsecode"; -static char *morsecode_synopsis = "Plays morse code"; +static const char morsecode_synopsis[] = "Plays morse code"; -static char *morsecode_descrip = +static const char morsecode_descrip[] = "Usage: Morsecode()\n" "Plays the Morse code equivalent of the passed string. If the variable\n" "MORSEDITLEN is set, it will use that value for the length (in ms) of the dit\n" @@ -53,7 +53,7 @@ "(in Hz). The tone default is 800.\n"; -static char *morsecode[] = { +static const char *morsecode[] = { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /* 0-15 */ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /* 16-31 */ " ", /* 32 - */ Index: apps/app_mp3.c =================================================================== --- apps/app_mp3.c (revision 48151) +++ apps/app_mp3.c (working copy) @@ -50,17 +50,17 @@ #define LOCAL_MPG_123 "/usr/local/bin/mpg123" #define MPG_123 "/usr/bin/mpg123" -static char *app = "MP3Player"; +static const char app[] = "MP3Player"; -static char *synopsis = "Play an MP3 file or stream"; +static const char synopsis[] = "Play an MP3 file or stream"; -static char *descrip = +static const char descrip[] = " MP3Player(location) Executes mpg123 to play the given location,\n" "which typically would be a filename or a URL. User can exit by pressing\n" "any key on the dialpad, or by hanging up."; -static int mp3play(char *filename, int fd) +static int mp3play(const char *filename, int fd) { int res; int x; Index: apps/app_nbscat.c =================================================================== --- apps/app_nbscat.c (revision 48151) +++ apps/app_nbscat.c (working copy) @@ -55,11 +55,11 @@ #define AF_LOCAL AF_UNIX #endif -static char *app = "NBScat"; +static const char app[] = "NBScat"; -static char *synopsis = "Play an NBS local stream"; +static const char synopsis[] = "Play an NBS local stream"; -static char *descrip = +static const char descrip[] = " NBScat: Executes nbscat to listen to the local NBS stream.\n" "User can exit by pressing any key\n."; Index: apps/app_osplookup.c =================================================================== --- apps/app_osplookup.c (revision 48151) +++ apps/app_osplookup.c (working copy) @@ -1626,9 +1626,9 @@ return RESULT_SUCCESS; } -static const char* app1= "OSPAuth"; -static const char* synopsis1 = "OSP authentication"; -static const char* descrip1 = +static const char[] app1= "OSPAuth"; +static const char[] synopsis1 = "OSP authentication"; +static const char[] descrip1 = " OSPAuth([provider[|options]]): Authenticate a SIP INVITE by OSP and sets\n" "the variables:\n" " ${OSPINHANDLE}: The inbound call transaction handle\n" @@ -1640,9 +1640,9 @@ " OSPAUTHSTATUS The status of the OSP Auth attempt as a text string, one of\n" " SUCCESS | FAILED | ERROR\n"; -static const char* app2= "OSPLookup"; -static const char* synopsis2 = "Lookup destination by OSP"; -static const char* descrip2 = +static const char[] app2= "OSPLookup"; +static const char[] synopsis2 = "Lookup destination by OSP"; +static const char[] descrip2 = " OSPLookup(exten[|provider[|options]]): Looks up an extension via OSP and sets\n" "the variables, where 'n' is the number of the result beginning with 1:\n" " ${OSPOUTHANDLE}: The OSP Handle for anything remaining\n" @@ -1659,9 +1659,9 @@ " OSPLOOKUPSTATUS The status of the OSP Lookup attempt as a text string, one of\n" " SUCCESS | FAILED | ERROR\n"; -static const char* app3 = "OSPNext"; -static const char* synopsis3 = "Lookup next destination by OSP"; -static const char* descrip3 = +static const char[] app3 = "OSPNext"; +static const char[] synopsis3 = "Lookup next destination by OSP"; +static const char[] descrip3 = " OSPNext(cause[|options]): Looks up the next OSP Destination for ${OSPOUTHANDLE}\n" "See OSPLookup for more information\n" "\n" @@ -1671,9 +1671,9 @@ " OSPNEXTSTATUS The status of the OSP Next attempt as a text string, one of\n" " SUCCESS | FAILED |ERROR\n"; -static const char* app4 = "OSPFinish"; -static const char* synopsis4 = "Record OSP entry"; -static const char* descrip4 = +static const char[] app4 = "OSPFinish"; +static const char[] synopsis4 = "Record OSP entry"; +static const char[] descrip4 = " OSPFinish([status[|options]]): Records call state for ${OSPINHANDLE}, according to\n" "status, which should be one of BUSY, CONGESTION, ANSWER, NOANSWER, or CHANUNAVAIL\n" "or coincidentally, just what the Dial application stores in its ${DIALSTATUS}.\n" @@ -1688,7 +1688,7 @@ "Usage: osp show\n" " Displays information on Open Settlement Protocol support\n"; -static struct ast_cli_entry cli_osp[] = { +static const struct ast_cli_entry cli_osp[] = { { { "osp", "show", NULL}, osp_show, "Displays OSP information", osp_usage }, Index: apps/app_page.c =================================================================== --- apps/app_page.c (revision 48151) +++ apps/app_page.c (working copy) @@ -49,11 +49,11 @@ #include "asterisk/chanvars.h" #include "asterisk/utils.h" -static const char *app_page= "Page"; +static const char app_page[] = "Page"; -static const char *page_synopsis = "Pages phones"; +static const char page_synopsis[] = "Pages phones"; -static const char *page_descrip = +static const char page_descrip[] = "Page(Technology/Resource&Technology2/Resource2[|options])\n" " Places outbound calls to the given technology / resource and dumps\n" "them into a conference bridge as muted participants. The original\n" Index: apps/app_parkandannounce.c =================================================================== --- apps/app_parkandannounce.c (revision 48151) +++ apps/app_parkandannounce.c (working copy) @@ -51,11 +51,11 @@ #include "asterisk/lock.h" #include "asterisk/utils.h" -static char *app = "ParkAndAnnounce"; +static const char app[] = "ParkAndAnnounce"; -static char *synopsis = "Park and Announce"; +static const char synopsis[] = "Park and Announce"; -static char *descrip = +static const char descrip[] = " ParkAndAnnounce(announce:template|timeout|dial|[return_context]):\n" "Park a call into the parkinglot and announce the call to another channel.\n" "\n" Index: apps/app_playback.c =================================================================== --- apps/app_playback.c (revision 48151) +++ apps/app_playback.c (working copy) @@ -47,11 +47,11 @@ #include "asterisk/localtime.h" #include "asterisk/say.h" -static char *app = "Playback"; +static const char app = "Playback"; -static char *synopsis = "Play a file"; +static const char synopsis = "Play a file"; -static char *descrip = +static const char descrip[] = " Playback(filename[&filename2...][|option]): Plays back given filenames (do not put\n" "extension). Options may also be included following a pipe symbol. The 'skip'\n" "option causes the playback of the message to be skipped if the channel\n" @@ -369,7 +369,7 @@ return RESULT_SUCCESS; } -static struct ast_cli_entry cli_playback[] = { +static const struct ast_cli_entry cli_playback[] = { { { "say", "load", NULL }, __say_init, "set/show the say mode", "say load new|old" }, Index: apps/app_privacy.c =================================================================== --- apps/app_privacy.c (revision 48151) +++ apps/app_privacy.c (working copy) @@ -49,11 +49,11 @@ #define PRIV_CONFIG "privacy.conf" -static char *app = "PrivacyManager"; +static const char app[] = "PrivacyManager"; -static char *synopsis = "Require phone number to be entered, if no CallerID sent"; +static const char synopsis[] = "Require phone number to be entered, if no CallerID sent"; -static char *descrip = +static const char descrip[] = " PrivacyManager([maxretries[|minlength[|options]]]): If no Caller*ID \n" "is sent, PrivacyManager answers the channel and asks the caller to\n" "enter their phone number. The caller is given 3 attempts to do so.\n" Index: apps/app_queue.c =================================================================== --- apps/app_queue.c (revision 48151) +++ apps/app_queue.c (working copy) @@ -101,9 +101,9 @@ QUEUE_STRATEGY_RRMEMORY }; -static struct strategy { - int strategy; - char *name; +static const struct strategy { + const int strategy; + const char *name; } strategies[] = { { QUEUE_STRATEGY_RINGALL, "ringall" }, { QUEUE_STRATEGY_LEASTRECENT, "leastrecent" }, @@ -122,11 +122,11 @@ #define RES_OUTOFMEMORY (-2) /* Out of memory */ #define RES_NOSUCHQUEUE (-3) /* No such queue */ -static char *app = "Queue"; +static const char app[] = "Queue"; -static char *synopsis = "Queue a call for a call queue"; +static const char synopsis[] = "Queue a call for a call queue"; -static char *descrip = +static const char descrip[] = " Queue(queuename[|options[|URL][|announceoverride][|timeout][|AGI]):\n" "Queues an incoming call in a particular call queue as defined in queues.conf.\n" "This application will return to the dialplan if the queue does not exist, or\n" @@ -156,9 +156,9 @@ " QUEUESTATUS The status of the call as a text string, one of\n" " TIMEOUT | FULL | JOINEMPTY | LEAVEEMPTY | JOINUNAVAIL | LEAVEUNAVAIL\n"; -static char *app_aqm = "AddQueueMember" ; -static char *app_aqm_synopsis = "Dynamically adds queue members" ; -static char *app_aqm_descrip = +static const char app_aqm[] = "AddQueueMember" ; +static const char app_aqm_synopsis[] = "Dynamically adds queue members" ; +static const char app_aqm_descrip[] = " AddQueueMember(queuename[|interface[|penalty[|options]]]):\n" "Dynamically adds interface to an existing queue.\n" "If the interface is already in the queue and there exists an n+101 priority\n" @@ -172,9 +172,9 @@ "Example: AddQueueMember(techsupport|SIP/3000)\n" ""; -static char *app_rqm = "RemoveQueueMember" ; -static char *app_rqm_synopsis = "Dynamically removes queue members" ; -static char *app_rqm_descrip = +static const char app_rqm[] = "RemoveQueueMember" ; +static const char app_rqm_synopsis[] = "Dynamically removes queue members" ; +static const char app_rqm_descrip[] = " RemoveQueueMember(queuename[|interface[|options]]):\n" "Dynamically removes interface to an existing queue\n" "If the interface is NOT in the queue and there exists an n+101 priority\n" @@ -188,9 +188,9 @@ "Example: RemoveQueueMember(techsupport|SIP/3000)\n" ""; -static char *app_pqm = "PauseQueueMember" ; -static char *app_pqm_synopsis = "Pauses a queue member" ; -static char *app_pqm_descrip = +static const char app_pqm[] = "PauseQueueMember" ; +static const char app_pqm_synopsis[] = "Pauses a queue member" ; +static const char app_pqm_descrip[] = " PauseQueueMember([queuename]|interface[|options]):\n" "Pauses (blocks calls for) a queue member.\n" "The given interface will be paused in the given queue. This prevents\n" @@ -210,9 +210,9 @@ " PAUSED | NOTFOUND\n" "Example: PauseQueueMember(|SIP/3000)\n"; -static char *app_upqm = "UnpauseQueueMember" ; -static char *app_upqm_synopsis = "Unpauses a queue member" ; -static char *app_upqm_descrip = +static const char app_upqm[] = "UnpauseQueueMember" ; +static const char app_upqm_synopsis[] = "Unpauses a queue member" ; +static const char app_upqm_descrip[] = " UnpauseQueueMember([queuename]|interface[|options]):\n" "Unpauses (resumes calls to) a queue member.\n" "This is the counterpart to PauseQueueMember and operates exactly the\n" @@ -225,15 +225,15 @@ " UNPAUSED | NOTFOUND\n" "Example: UnpauseQueueMember(|SIP/3000)\n"; -static char *app_ql = "QueueLog" ; -static char *app_ql_synopsis = "Writes to the queue_log" ; -static char *app_ql_descrip = +static const char app_ql[] = "QueueLog" ; +static const char app_ql_synopsis[] = "Writes to the queue_log" ; +static const char app_ql_descrip[] = " QueueLog(queuename|uniqueid|agent|event[|additionalinfo]):\n" "Allows you to write your own events into the queue log\n" "Example: QueueLog(101|${UNIQUEID}|${AGENT}|WENTONBREAK|600)\n"; /*! \brief Persistent Members astdb family */ -static const char *pm_family = "/Queue/PersistentMembers"; +static const char pm_family[] = "/Queue/PersistentMembers"; /* The maximum length of each persistent member queue database entry */ #define PM_MAX_LEN 8192 @@ -3653,7 +3653,7 @@ return 0; } -static struct ast_custom_function queuemembercount_function = { +static const struct ast_custom_function queuemembercount_function = { .name = "QUEUE_MEMBER_COUNT", .synopsis = "Count number of members answering a queue", .syntax = "QUEUE_MEMBER_COUNT()", @@ -3662,7 +3662,7 @@ .read = queue_function_qac, }; -static struct ast_custom_function queuewaitingcount_function = { +static const struct ast_custom_function queuewaitingcount_function = { .name = "QUEUE_WAITING_COUNT", .synopsis = "Count number of calls currently waiting in a queue", .syntax = "QUEUE_WAITING_COUNT()", @@ -3671,7 +3671,7 @@ .read = queue_function_queuewaitingcount, }; -static struct ast_custom_function queuememberlist_function = { +static const struct ast_custom_function queuememberlist_function = { .name = "QUEUE_MEMBER_LIST", .synopsis = "Returns a list of interfaces on a queue", .syntax = "QUEUE_MEMBER_LIST()", @@ -4427,21 +4427,21 @@ return NULL; } -static char queue_list_usage[] = +static const char queue_list_usage[] = "Usage: queue list\n" " Provides summary information on call queues.\n"; -static char queue_show_usage[] = +static const char queue_show_usage[] = "Usage: queue show\n" " Provides summary information on a specified queue.\n"; -static char qam_cmd_usage[] = +static const char qam_cmd_usage[] = "Usage: queue add member to [penalty ]\n"; -static char qrm_cmd_usage[] = +static const char qrm_cmd_usage[] = "Usage: queue remove member from \n"; -static struct ast_cli_entry cli_queue[] = { +static const struct ast_cli_entry cli_queue[] = { { { "queue", "list", NULL }, queue_list, "Show status of queues", queue_list_usage, NULL, NULL }, Index: apps/app_read.c =================================================================== --- apps/app_read.c (revision 48151) +++ apps/app_read.c (working copy) @@ -57,11 +57,11 @@ AST_APP_OPTION('n', OPT_NOANSWER), }); -static char *app = "Read"; +static const char app[] = "Read"; -static char *synopsis = "Read a variable"; +static const char synopsis[] = "Read a variable"; -static char *descrip = +static const char descrip[] = " Read(variable[|filename][|maxdigits][|option][|attempts][|timeout])\n\n" "Reads a #-terminated string of digits a certain number of times from the\n" "user in to the given variable.\n" Index: apps/app_readfile.c =================================================================== --- apps/app_readfile.c (revision 48151) +++ apps/app_readfile.c (working copy) @@ -42,11 +42,11 @@ #include "asterisk/app.h" #include "asterisk/module.h" -static char *app_readfile = "ReadFile"; +static const char app_readfile[] = "ReadFile"; -static char *readfile_synopsis = "ReadFile(varname=file,length)"; +static const char readfile_synopsis[] = "ReadFile(varname=file,length)"; -static char *readfile_descrip = +static const char readfile_descrip[] = "ReadFile(varname=file,length)\n" " Varname - Result stored here.\n" " File - The name of the file to read.\n" Index: apps/app_record.c =================================================================== --- apps/app_record.c (revision 48151) +++ apps/app_record.c (working copy) @@ -46,11 +46,11 @@ #include "asterisk/app.h" -static char *app = "Record"; +static const char app[] = "Record"; -static char *synopsis = "Record to a file"; +static const char synopsis[] = "Record to a file"; -static char *descrip = +static const char descrip[] = " Record(filename.format|silence[|maxduration][|options])\n\n" "Records from the channel into a given filename. If the file exists it will\n" "be overwritten.\n" Index: apps/app_rpt.c =================================================================== --- apps/app_rpt.c (revision 48151) +++ apps/app_rpt.c (working copy) @@ -243,11 +243,11 @@ #include "asterisk/localtime.h" #include "asterisk/app.h" -static char *app = "Rpt"; +static const char app[] = "Rpt"; -static char *synopsis = "Radio Repeater/Remote Base Control System"; +static const char synopsis[] = "Radio Repeater/Remote Base Control System"; -static char *descrip = +static const char descrip[] = " Rpt(nodename[|options]): Radio Remote Link or Remote Base Link Endpoint Process.\n" "\n" " Not specifying an option puts it in normal endpoint mode (where source\n" @@ -288,9 +288,9 @@ static int debug = 0; /* FIXME Set this >0 for extra debug output */ static int nrpts = 0; -char *discstr = "!!DISCONNECT!!"; -static char *remote_rig_ft897 = "ft897"; -static char *remote_rig_rbi = "rbi"; +const char discstr[] = "!!DISCONNECT!!"; +static const char remote_rig_ft897[] = "ft897"; +static const char remote_rig_rbi[] = "rbi"; #ifdef OLD_ASTERISK STANDARD_LOCAL_USER; @@ -696,31 +696,31 @@ static int rpt_do_reload(int fd, int argc, char *argv[]); static int rpt_do_restart(int fd, int argc, char *argv[]); -static char debug_usage[] = +static const char debug_usage[] = "Usage: rpt debug level {0-7}\n" " Enables debug messages in app_rpt\n"; -static char dump_usage[] = +static const char dump_usage[] = "Usage: rpt dump \n" " Dumps struct debug info to log\n"; -static char dump_stats[] = +static const char dump_stats[] = "Usage: rpt stats \n" " Dumps node statistics to console\n"; -static char dump_lstats[] = +static const char dump_lstats[] = "Usage: rpt lstats \n" " Dumps link statistics to console\n"; -static char reload_usage[] = +static const char reload_usage[] = "Usage: rpt reload\n" " Reloads app_rpt running config parameters\n"; -static char restart_usage[] = +static const char restart_usage[] = "Usage: rpt restart\n" " Restarts app_rpt\n"; -static struct ast_cli_entry cli_rpt[] = { +static const struct ast_cli_entry cli_rpt[] = { { { "rpt", "debug", "level" }, rpt_do_debug, "Enable app_rpt debugging", debug_usage }, @@ -750,7 +750,7 @@ */ -static struct telem_defaults tele_defs[] = { +static const struct telem_defaults tele_defs[] = { {"ct1", "|t(350,0,100,3072)(500,0,100,3072)(660,0,100,3072)"}, {"ct2", "|t(660,880,150,3072)"}, {"ct3", "|t(440,0,150,3072)"}, @@ -788,7 +788,7 @@ * Function table */ -static struct function_table_tag function_table[] = { +static const struct function_table_tag function_table[] = { {"cop", function_cop}, {"autopatchup", function_autopatchup}, {"autopatchdn", function_autopatchdn}, @@ -1162,7 +1162,7 @@ char *reverse_patch_state, *enable_state, *input_signal, *called_number; struct rpt *myrpt; - static char *not_applicable = "N/A"; + static const char not_applicable[] = "N/A"; if (argc != 3) return RESULT_SHOWUSAGE; @@ -1461,7 +1461,7 @@ static int send_morse(struct ast_channel *chan, const char *string, int speed, int freq, int amplitude) { - static struct morse_bits mbits[] = { + static const struct morse_bits mbits[] = { {0, 0}, /* SPACE */ {0, 0}, {6, 18},/* " */ @@ -3115,7 +3115,7 @@ AST_APP_ARG(list)[20]; ); - static char *keywords[] = { + static const char *keywords[] = { "context", "dialtime", "farenddisconnect", Index: apps/app_sayunixtime.c =================================================================== --- apps/app_sayunixtime.c (revision 48151) +++ apps/app_sayunixtime.c (working copy) @@ -43,12 +43,12 @@ #include "asterisk/say.h" #include "asterisk/app.h" -static char *app_sayunixtime = "SayUnixTime"; -static char *app_datetime = "DateTime"; +static const char app_sayunixtime[] = "SayUnixTime"; +static const char app_datetime[] = "DateTime"; -static char *sayunixtime_synopsis = "Says a specified time in a custom format"; +static const char sayunixtime_synopsis[] = "Says a specified time in a custom format"; -static char *sayunixtime_descrip = +static const char sayunixtime_descrip[] = "SayUnixTime([unixtime][|[timezone][|format]])\n" " unixtime: time, in seconds since Jan 1, 1970. May be negative.\n" " defaults to now.\n" @@ -56,7 +56,7 @@ " defaults to machine default.\n" " format: a format the time is to be said in. See voicemail.conf.\n" " defaults to \"ABdY 'digits/at' IMp\"\n"; -static char *datetime_descrip = +static const char datetime_descrip[] = "DateTime([unixtime][|[timezone][|format]])\n" " unixtime: time, in seconds since Jan 1, 1970. May be negative.\n" " defaults to now.\n" Index: apps/app_senddtmf.c =================================================================== --- apps/app_senddtmf.c (revision 48151) +++ apps/app_senddtmf.c (working copy) @@ -45,11 +45,11 @@ #include "asterisk/app.h" #include "asterisk/manager.h" -static char *app = "SendDTMF"; +static const char app[] = "SendDTMF"; -static char *synopsis = "Sends arbitrary DTMF digits"; +static const char synopsis[] = "Sends arbitrary DTMF digits"; -static char *descrip = +static const char descrip[] = " SendDTMF(digits[|timeout_ms]): Sends DTMF digits on a channel. \n" " Accepted digits: 0-9, *#abcd, w (.5s pause)\n" " The application will either pass the assigned digits or terminate if it\n" Index: apps/app_sendtext.c =================================================================== --- apps/app_sendtext.c (revision 48151) +++ apps/app_sendtext.c (working copy) @@ -46,11 +46,11 @@ #include "asterisk/options.h" #include "asterisk/app.h" -static const char *app = "SendText"; +static const char app[] = "SendText"; -static const char *synopsis = "Send a Text Message"; +static const char synopsis[] = "Send a Text Message"; -static const char *descrip = +static const char descrip[] = " SendText(text[|options]): Sends text to current channel (callee).\n" "Result of transmission will be stored in the SENDTEXTSTATUS\n" "channel variable:\n" Index: apps/app_setcallerid.c =================================================================== --- apps/app_setcallerid.c (revision 48151) +++ apps/app_setcallerid.c (working copy) @@ -43,12 +43,12 @@ #include "asterisk/image.h" #include "asterisk/callerid.h" -static char *app2 = "SetCallerPres"; +static const char app2[] = "SetCallerPres"; -static char *synopsis2 = "Set CallerID Presentation"; +static const char synopsis2[] = "Set CallerID Presentation"; -static char *descrip2 = +static const char descrip2[] = " SetCallerPres(presentation): Set Caller*ID presentation on a call.\n" " Valid presentations are:\n" "\n" Index: apps/app_skel.c =================================================================== --- apps/app_skel.c (revision 48151) +++ apps/app_skel.c (working copy) @@ -47,10 +47,10 @@ #include "asterisk/lock.h" #include "asterisk/app.h" -static char *app = "Skel"; -static char *synopsis = +static char const app[] = "Skel"; +static char const synopsis[] = "Skeleton application."; -static char *descrip = "This application is a template to build other applications from.\n" +static char const descrip[] = "This application is a template to build other applications from.\n" " It shows you the basic structure to create your own Asterisk applications.\n"; enum { Index: apps/app_sms.c =================================================================== --- apps/app_sms.c (revision 48151) +++ apps/app_sms.c (working copy) @@ -61,11 +61,11 @@ static char log_file[255]; static char spool_dir[255]; -static char *app = "SMS"; +static const char app[] = "SMS"; -static char *synopsis = "Communicates with SMS service centres and SMS capable analogue phones"; +static const char synopsis[] = "Communicates with SMS service centres and SMS capable analogue phones"; -static char *descrip = +static const char descrip[] = " SMS(name|[a][s]): SMS handles exchange of SMS data with a call to/from SMS capabale\n" "phone or SMS PSTN service center. Can send and/or receive SMS messages.\n" "Works to ETSI ES 201 912 compatible with BT SMS PSTN service in UK\n" @@ -80,7 +80,7 @@ "smsq (a separate software) is a command to generate message\n" "queues and send messages.\n"; -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, Index: apps/app_softhangup.c =================================================================== --- apps/app_softhangup.c (revision 48151) +++ apps/app_softhangup.c (working copy) @@ -42,15 +42,15 @@ #include "asterisk/module.h" #include "asterisk/lock.h" -static char *synopsis = "Soft Hangup Application"; +static const char synopsis[] = "Soft Hangup Application"; -static char *desc = " SoftHangup(Technology/resource|options)\n" +static const char desc[] = " SoftHangup(Technology/resource|options)\n" "Hangs up the requested channel. If there are no channels to hangup,\n" "the application will report it.\n" "- 'options' may contain the following letter:\n" " 'a' : hang up all channels on a specified device instead of a single resource\n"; -static char *app = "SoftHangup"; +static const char app[] = "SoftHangup"; static int softhangup_exec(struct ast_channel *chan, void *data) Index: apps/app_speech_utils.c =================================================================== --- apps/app_speech_utils.c (revision 48151) +++ apps/app_speech_utils.c (working copy) @@ -44,21 +44,21 @@ #include "asterisk/speech.h" /* Descriptions for each application */ -static char *speechcreate_descrip = +static const char speechcreate_descrip[] = "SpeechCreate(engine name)\n" "This application creates information to be used by all the other applications. It must be called before doing any speech recognition activities such as activating a grammar.\n" "It takes the engine name to use as the argument, if not specified the default engine will be used.\n"; -static char *speechactivategrammar_descrip = +static const char speechactivategrammar_descrip[] = "SpeechActivateGrammar(Grammar Name)\n" "This activates the specified grammar to be recognized by the engine. A grammar tells the speech recognition engine what to recognize, \n" "and how to portray it back to you in the dialplan. The grammar name is the only argument to this application.\n"; -static char *speechstart_descrip = +static const char speechstart_descrip[] = "SpeechStart()\n" "Tell the speech recognition engine that it should start trying to get results from audio being fed to it. This has no arguments.\n"; -static char *speechbackground_descrip = +static const char speechbackground_descrip[] = "SpeechBackground(Sound File|Timeout)\n" "This application plays a sound file and waits for the person to speak. Once they start speaking playback of the file stops, and silence is heard.\n" "Once they stop talking the processing sound is played to indicate the speech recognition engine is working.\n" @@ -66,27 +66,27 @@ "The first text and score are ${SPEECH_TEXT(0)} AND ${SPEECH_SCORE(0)} while the second are ${SPEECH_TEXT(1)} and ${SPEECH_SCORE(1)}.\n" "The first argument is the sound file and the second is the timeout integer in seconds. Note the timeout will only start once the sound file has stopped playing.\n"; -static char *speechdeactivategrammar_descrip = +static const char speechdeactivategrammar_descrip[] = "SpeechDeactivateGrammar(Grammar Name)\n" "This deactivates the specified grammar so that it is no longer recognized. The only argument is the grammar name to deactivate.\n"; -static char *speechprocessingsound_descrip = +static const char speechprocessingsound_descrip[] = "SpeechProcessingSound(Sound File)\n" "This changes the processing sound that SpeechBackground plays back when the speech recognition engine is processing and working to get results.\n" "It takes the sound file as the only argument.\n"; -static char *speechdestroy_descrip = +static const char speechdestroy_descrip[] = "SpeechDestroy()\n" "This destroys the information used by all the other speech recognition applications.\n" "If you call this application but end up wanting to recognize more speech, you must call SpeechCreate\n" "again before calling any other application. It takes no arguments.\n"; -static char *speechload_descrip = +static const char speechload_descrip[] = "SpeechLoadGrammar(Grammar Name|Path)\n" "Load a grammar only on the channel, not globally.\n" "It takes the grammar name as first argument and path as second.\n"; -static char *speechunload_descrip = +static const char speechunload_descrip[] = "SpeechUnloadGrammar(Grammar Name)\n" "Unload a grammar. It takes the grammar name as the only argument.\n"; @@ -161,7 +161,7 @@ return 0; } -static struct ast_custom_function speech_score_function = { +static const struct ast_custom_function speech_score_function = { .name = "SPEECH_SCORE", .synopsis = "Gets the confidence score of a result.", .syntax = "SPEECH_SCORE(result number)", @@ -187,7 +187,7 @@ return 0; } -static struct ast_custom_function speech_text_function = { +static const struct ast_custom_function speech_text_function = { .name = "SPEECH_TEXT", .synopsis = "Gets the recognized text of a result.", .syntax = "SPEECH_TEXT(result number)", @@ -213,7 +213,7 @@ return 0; } -static struct ast_custom_function speech_grammar_function = { +static const struct ast_custom_function speech_grammar_function = { .name = "SPEECH_GRAMMAR", .synopsis = "Gets the matched grammar of a result if available.", .syntax = "SPEECH_GRAMMAR(result number)", @@ -236,7 +236,7 @@ return 0; } -static struct ast_custom_function speech_engine_function = { +static const struct ast_custom_function speech_engine_function = { .name = "SPEECH_ENGINE", .synopsis = "Change a speech engine specific attribute.", .syntax = "SPEECH_ENGINE(name)=value", @@ -289,7 +289,7 @@ return 0; } -static struct ast_custom_function speech_function = { +static const struct ast_custom_function speech_function = { .name = "SPEECH", .synopsis = "Gets information about speech recognition results.", .syntax = "SPEECH(argument)", Index: apps/app_stack.c =================================================================== --- apps/app_stack.c (revision 48151) +++ apps/app_stack.c (working copy) @@ -46,29 +46,29 @@ #define STACKVAR "~GOSUB~STACK~" -static const char *app_gosub = "Gosub"; -static const char *app_gosubif = "GosubIf"; -static const char *app_return = "Return"; -static const char *app_pop = "StackPop"; +static const char app_gosub[] = "Gosub"; +static const char app_gosubif[] = "GosubIf"; +static const char app_return[] = "Return"; +static const char app_pop[] = "StackPop"; -static const char *gosub_synopsis = "Jump to label, saving return address"; -static const char *gosubif_synopsis = "Conditionally jump to label, saving return address"; -static const char *return_synopsis = "Return from gosub routine"; -static const char *pop_synopsis = "Remove one address from gosub stack"; +static const char gosub_synopsis[] = "Jump to label, saving return address"; +static const char gosubif_synopsis[] = "Conditionally jump to label, saving return address"; +static const char return_synopsis[] = "Return from gosub routine"; +static const char pop_synopsis[] = "Remove one address from gosub stack"; -static const char *gosub_descrip = +static const char gosub_descrip[] = "Gosub([[context|]exten|]priority[(arg1[|...][|argN])])\n" " Jumps to the label specified, saving the return address.\n"; -static const char *gosubif_descrip = +static const char gosubif_descrip[] = "GosubIf(condition?labeliftrue[(arg1[|...])][:labeliffalse[(arg1[|...])]])\n" " If the condition is true, then jump to labeliftrue. If false, jumps to\n" "labeliffalse, if specified. In either case, a jump saves the return point\n" "in the dialplan, to be returned to with a Return.\n"; -static const char *return_descrip = +static const char return_descrip[] = "Return([return-value])\n" " Jumps to the last label on the stack, removing it. The return value, if\n" "any, is saved in the channel variable GOSUB_RETVAL.\n"; -static const char *pop_descrip = +static const char pop_descrip[] = "StackPop()\n" " Removes last label on the stack, discarding it.\n"; Index: apps/app_system.c =================================================================== --- apps/app_system.c (revision 48151) +++ apps/app_system.c (working copy) @@ -44,17 +44,17 @@ #include "asterisk/app.h" #include "asterisk/options.h" -static char *app = "System"; +static const char app[] = "System"; -static char *app2 = "TrySystem"; +static const char app2[] = "TrySystem"; -static char *synopsis = "Execute a system command"; +static const char synopsis[] = "Execute a system command"; -static char *synopsis2 = "Try executing a system command"; +static const char synopsis2[] = "Try executing a system command"; -static char *chanvar = "SYSTEMSTATUS"; +static const char chanvar[] = "SYSTEMSTATUS"; -static char *descrip = +static const char descrip[] = " System(command): Executes a command by using system(). If the command\n" "fails, the console should report a fallthrough. \n" "Result of execution is returned in the SYSTEMSTATUS channel variable:\n" @@ -68,7 +68,7 @@ "Note that this jump functionality has been deprecated and will only occur\n" "if the global priority jumping option is enabled in extensions.conf.\n"; -static char *descrip2 = +static const char descrip2[] = " TrySystem(command): Executes a command by using system().\n" "on any situation.\n" "Result of execution is returned in the SYSTEMSTATUS channel variable:\n" Index: apps/app_talkdetect.c =================================================================== --- apps/app_talkdetect.c (revision 48151) +++ apps/app_talkdetect.c (working copy) @@ -44,11 +44,11 @@ #include "asterisk/dsp.h" #include "asterisk/options.h" -static char *app = "BackgroundDetect"; +static const char app[] = "BackgroundDetect"; -static char *synopsis = "Background a file with talk detect"; +static const char synopsis[] = "Background a file with talk detect"; -static char *descrip = +static const char descrip[] = " BackgroundDetect(filename[|sil[|min|[max]]]): Plays back a given\n" "filename, waiting for interruption from a given digit (the digit must\n" "start the beginning of a valid extension, or it will be ignored).\n" Index: apps/app_test.c =================================================================== --- apps/app_test.c (revision 48151) +++ apps/app_test.c (working copy) @@ -48,20 +48,20 @@ #include "asterisk/pbx.h" #include "asterisk/utils.h" -static char *tests_descrip = +static const char tests_descrip[] = "TestServer(): Perform test server function and write call report.\n" "Results stored in /var/log/asterisk/testreports/-server.txt"; -static char *tests_app = "TestServer"; -static char *tests_synopsis = "Execute Interface Test Server"; +static const char tests_app[] = "TestServer"; +static const char tests_synopsis[] = "Execute Interface Test Server"; -static char *testc_descrip = +static const char testc_descrip[] = "TestClient(testid): Executes test client with given testid.\n" "Results stored in /var/log/asterisk/testreports/-client.txt"; -static char *testc_app = "TestClient"; -static char *testc_synopsis = "Execute Interface Test Client"; +static const char testc_app[] = "TestClient"; +static const char testc_synopsis[] = "Execute Interface Test Client"; -static int measurenoise(struct ast_channel *chan, int ms, char *who) +static int measurenoise(struct ast_channel *chan, int ms, const char *who) { int res=0; int mssofar; Index: apps/app_transfer.c =================================================================== --- apps/app_transfer.c (revision 48151) +++ apps/app_transfer.c (working copy) @@ -46,11 +46,11 @@ #include "asterisk/app.h" -static const char *app = "Transfer"; +static const char app[] = "Transfer"; -static const char *synopsis = "Transfer caller to remote extension"; +static const char synopsis[] = "Transfer caller to remote extension"; -static const char *descrip = +static const char descrip[] = " Transfer([Tech/]dest[|options]): Requests the remote caller be transferred\n" "to a given destination. If TECH (SIP, IAX2, LOCAL etc) is used, only\n" "an incoming call with the same channel technology will be transfered.\n" Index: apps/app_url.c =================================================================== --- apps/app_url.c (revision 48151) +++ apps/app_url.c (working copy) @@ -43,11 +43,11 @@ #include "asterisk/image.h" #include "asterisk/options.h" -static char *app = "SendURL"; +static const char app[] = "SendURL"; -static char *synopsis = "Send a URL"; +static const char synopsis[] = "Send a URL"; -static char *descrip = +static const char descrip[] = " SendURL(URL[|option]): Requests client go to URL (IAX2) or sends the \n" "URL to the client (other channels).\n" "Result is returned in the SENDURLSTATUS channel variable:\n" Index: apps/app_userevent.c =================================================================== --- apps/app_userevent.c (revision 48151) +++ apps/app_userevent.c (working copy) @@ -39,11 +39,11 @@ #include "asterisk/manager.h" #include "asterisk/app.h" -static char *app = "UserEvent"; +static const char app[] = "UserEvent"; -static char *synopsis = "Send an arbitrary event to the manager interface"; +static const char synopsis[] = "Send an arbitrary event to the manager interface"; -static char *descrip = +static const char descrip[] = " UserEvent(eventname[|body]): Sends an arbitrary event to the manager\n" "interface, with an optional body representing additional arguments. The\n" "body may be specified as a | delimeted list of headers. Each additional\n" Index: apps/app_verbose.c =================================================================== --- apps/app_verbose.c (revision 48151) +++ apps/app_verbose.c (working copy) @@ -39,15 +39,15 @@ #include "asterisk/pbx.h" #include "asterisk/module.h" -static char *app_verbose = "Verbose"; -static char *verbose_synopsis = "Send arbitrary text to verbose output"; -static char *verbose_descrip = +static const char app_verbose[] = "Verbose"; +static const char verbose_synopsis[] = "Send arbitrary text to verbose output"; +static const char verbose_descrip[] = "Verbose([|])\n" " level must be an integer value. If not specified, defaults to 0.\n"; -static char *app_log = "Log"; -static char *log_synopsis = "Send arbitrary text to a selected log level"; -static char *log_descrip = +static const char app_log[] = "Log"; +static const char log_synopsis[] = "Send arbitrary text to a selected log level"; +static const char log_descrip[] = "Log(|)\n" " level must be one of ERROR, WARNING, NOTICE, DEBUG, VERBOSE, DTMF\n"; Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 48151) +++ apps/app_voicemail.c (working copy) @@ -481,13 +481,13 @@ " s - Skip playing the initial prompts.\n"; /* Leave a message */ -static char *app = "VoiceMail"; +static const char app[] = "VoiceMail"; /* Check mail, control, etc */ -static char *app2 = "VoiceMailMain"; +static const char app2[] = "VoiceMailMain"; -static char *app3 = "MailboxExists"; -static char *app4 = "VMAuthenticate"; +static const char app3[] = "MailboxExists"; +static const char app4[] = "VMAuthenticate"; static AST_LIST_HEAD_STATIC(users, ast_vm_user); static AST_LIST_HEAD_STATIC(zones, vm_zone); @@ -6627,7 +6627,7 @@ return 0; } -static struct ast_custom_function mailbox_exists_acf = { +static const struct ast_custom_function mailbox_exists_acf = { .name = "MAILBOX_EXISTS", .synopsis = "Tell if a mailbox is configured", .desc = @@ -6788,7 +6788,7 @@ return NULL; } -static struct ast_cli_entry cli_voicemail[] = { +static const struct ast_cli_entry cli_voicemail[] = { { { "voicemail", "list", "users", NULL }, handle_voicemail_show_users, "List defined voicemail boxes", voicemail_show_users_help, complete_voicemail_show_users, NULL }, Index: apps/app_waitforring.c =================================================================== --- apps/app_waitforring.c (revision 48151) +++ apps/app_waitforring.c (working copy) @@ -43,14 +43,14 @@ #include "asterisk/options.h" #include "asterisk/lock.h" -static char *synopsis = "Wait for Ring Application"; +static const char synopsis[] = "Wait for Ring Application"; -static char *desc = " WaitForRing(timeout)\n" +static const char desc[] = " WaitForRing(timeout)\n" "Returns 0 after waiting at least timeout seconds. and\n" "only after the next ring has completed. Returns 0 on\n" "success or -1 on hangup\n"; -static char *app = "WaitForRing"; +static const char app[] = "WaitForRing"; static int waitforring_exec(struct ast_channel *chan, void *data) Index: apps/app_waitforsilence.c =================================================================== --- apps/app_waitforsilence.c (revision 48151) +++ apps/app_waitforsilence.c (working copy) @@ -49,9 +49,9 @@ #include "asterisk/module.h" #include "asterisk/options.h" -static char *app = "WaitForSilence"; -static char *synopsis = "Waits for a specified amount of silence"; -static char *descrip = +static const char app[] = "WaitForSilence"; +static const char synopsis[] = "Waits for a specified amount of silence"; +static const char descrip[] = " WaitForSilence(silencerequired[|iterations][|timeout]) \n" "Wait for Silence: Waits for up to 'silencerequired' \n" "milliseconds of silence, 'iterations' times or once if omitted.\n" Index: apps/app_while.c =================================================================== --- apps/app_while.c (revision 48151) +++ apps/app_while.c (working copy) @@ -47,33 +47,33 @@ #define ALL_DONE(u,ret) {ast_module_user_remove(u); return ret;} -static char *start_app = "While"; -static char *start_desc = +static const char start_app[] = "While"; +static const char start_desc[] = "Usage: While()\n" "Start a While Loop. Execution will return to this point when\n" "EndWhile is called until expr is no longer true.\n"; -static char *start_synopsis = "Start a while loop"; +static const char start_synopsis[] = "Start a while loop"; -static char *stop_app = "EndWhile"; -static char *stop_desc = +static const char stop_app[] = "EndWhile"; +static const char stop_desc[] = "Usage: EndWhile()\n" "Return to the previous called While\n"; -static char *stop_synopsis = "End a while loop"; +static const char stop_synopsis[] = "End a while loop"; -static char *exit_app = "ExitWhile"; -static char *exit_desc = +static const char exit_app[] = "ExitWhile"; +static const char exit_desc[] = "Usage: ExitWhile()\n" "Exits a While loop, whether or not the conditional has been satisfied.\n"; -static char *exit_synopsis = "End a While loop"; +static const char exit_synopsis[] = "End a While loop"; -static char *continue_app = "ContinueWhile"; -static char *continue_desc = +static const char continue_app[] = "ContinueWhile"; +static const char continue_desc[] = "Usage: ContinueWhile()\n" "Returns to the top of the while loop and re-evaluates the conditional.\n"; -static char *continue_synopsis = "Restart a While loop"; +static const char continue_synopsis[] = "Restart a While loop"; #define VAR_SIZE 64 Index: apps/app_zapateller.c =================================================================== --- apps/app_zapateller.c (revision 48151) +++ apps/app_zapateller.c (working copy) @@ -42,11 +42,11 @@ #include "asterisk/translate.h" #include "asterisk/app.h" -static char *app = "Zapateller"; +static const char app[] = "Zapateller"; -static char *synopsis = "Block telemarketers with SIT"; +static const char synopsis[] = "Block telemarketers with SIT"; -static char *descrip = +static const char descrip[] = " Zapateller(options): Generates special information tone to block\n" "telemarketers from calling you. Options is a pipe-delimited list of\n" "options. The following options are available:\n" Index: apps/app_zapbarge.c =================================================================== --- apps/app_zapbarge.c (revision 48151) +++ apps/app_zapbarge.c (working copy) @@ -60,11 +60,11 @@ #include "asterisk/say.h" #include "asterisk/utils.h" -static char *app = "ZapBarge"; +static const char app[] = "ZapBarge"; -static char *synopsis = "Barge in (monitor) Zap channel"; +static const char synopsis[] = "Barge in (monitor) Zap channel"; -static char *descrip = +static const char descrip[] = " ZapBarge([channel]): Barges in on a specified zap\n" "channel or prompts if one is not specified. Returns\n" "-1 when caller user hangs up and is independent of the\n" Index: apps/app_zapras.c =================================================================== --- apps/app_zapras.c (revision 48151) +++ apps/app_zapras.c (working copy) @@ -58,11 +58,11 @@ #include "asterisk/module.h" #include "asterisk/options.h" -static char *app = "ZapRAS"; +static const char app[] = "ZapRAS"; -static char *synopsis = "Executes Zaptel ISDN RAS application"; +static const char synopsis[] = "Executes Zaptel ISDN RAS application"; -static char *descrip = +static const char descrip[] = " ZapRAS(args): Executes a RAS server using pppd on the given channel.\n" "The channel must be a clear channel (i.e. PRI source) and a Zaptel\n" "channel to be able to use this function (No modem emulation is included).\n" Index: apps/app_zapscan.c =================================================================== --- apps/app_zapscan.c (revision 48151) +++ apps/app_zapscan.c (working copy) @@ -59,11 +59,11 @@ #include "asterisk/cli.h" #include "asterisk/say.h" -static char *app = "ZapScan"; +static const char app[] = "ZapScan"; -static char *synopsis = "Scan Zap channels to monitor calls"; +static const char synopsis[] = "Scan Zap channels to monitor calls"; -static char *descrip = +static const char descrip[] = " ZapScan([group]) allows a call center manager to monitor Zap channels in\n" "a convenient way. Use '#' to select the next channel and use '*' to exit\n" "Limit scanning to a channel GROUP by setting the option group argument.\n"; Index: channels/chan_iax2.c =================================================================== --- channels/chan_iax2.c (revision 48151) +++ channels/chan_iax2.c (working copy) @@ -7750,9 +7750,9 @@ return 1; } -static char *papp = "IAX2Provision"; -static char *psyn = "Provision a calling IAXy with a given template"; -static char *pdescrip = +static const char papp[] = "IAX2Provision"; +static const char psyn[] = "Provision a calling IAXy with a given template"; +static const char pdescrip[] = " IAX2Provision([template]): Provisions the calling IAXy (assuming\n" "the calling entity is in fact an IAXy) with the given template or\n" "default if one is not specified. Returns -1 on error or 0 on success.\n"; Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 48151) +++ channels/chan_sip.c (working copy) @@ -16436,14 +16436,14 @@ return 0; } -static char *synopsis_dtmfmode = "Change the dtmfmode for a SIP call"; -static char *descrip_dtmfmode = "SIPDtmfMode(inband|info|rfc2833): Changes the dtmfmode for a SIP call\n"; -static char *app_dtmfmode = "SIPDtmfMode"; +static const char synopsis_dtmfmode[] = "Change the dtmfmode for a SIP call"; +static const char descrip_dtmfmode[] = "SIPDtmfMode(inband|info|rfc2833): Changes the dtmfmode for a SIP call\n"; +static const char app_dtmfmode[] = "SIPDtmfMode"; -static char *app_sipaddheader = "SIPAddHeader"; -static char *synopsis_sipaddheader = "Add a SIP header to the outbound call"; +static const char app_sipaddheader[] = "SIPAddHeader"; +static const char synopsis_sipaddheader[] = "Add a SIP header to the outbound call"; -static char *descrip_sipaddheader = "" +static const char descrip_sipaddheader[] = "" " SIPAddHeader(Header: Content)\n" "Adds a header to a SIP call placed with DIAL.\n" "Remember to user the X-header if you are adding non-standard SIP\n" Index: channels/chan_zap.c =================================================================== --- channels/chan_zap.c (revision 48151) +++ channels/chan_zap.c (working copy) @@ -537,7 +537,7 @@ struct ringContextData ringContext[3]; }; -static char *subnames[] = { +static const char *subnames[] = { "Real", "Callwait", "Threeway" @@ -1226,7 +1226,7 @@ return res; } -static char *events[] = { +static const char *events[] = { "No event", "On hook", "Ring/Answered", @@ -1248,9 +1248,9 @@ "Ring Begin", }; -static struct { - int alarm; - char *name; +static const struct { + const int alarm; + const char *name; } alarms[] = { { ZT_ALARM_RED, "Red Alarm" }, { ZT_ALARM_YELLOW, "Yellow Alarm" }, @@ -1261,7 +1261,7 @@ { ZT_ALARM_NONE, "None" }, }; -static char *alarm2str(int alarm) +static const char *alarm2str(const int alarm) { int x; for (x = 0; x < sizeof(alarms) / sizeof(alarms[0]); x++) { @@ -2455,11 +2455,11 @@ } #ifdef HAVE_PRI -static char *zap_send_keypad_facility_app = "ZapSendKeypadFacility"; +static const char zap_send_keypad_facility_app[] = "ZapSendKeypadFacility"; -static char *zap_send_keypad_facility_synopsis = "Send digits out of band over a PRI"; +static const char zap_send_keypad_facility_synopsis[] = "Send digits out of band over a PRI"; -static char *zap_send_keypad_facility_descrip = +static const char zap_send_keypad_facility_descrip[] = " ZapSendKeypadFacility(): This application will send the given string of digits in a Keypad Facility\n" " IE over the current channel.\n"; @@ -10479,7 +10479,7 @@ "Usage: pri show spans\n" " Displays PRI Information\n"; -static struct ast_cli_entry zap_pri_cli[] = { +static const struct ast_cli_entry zap_pri_cli[] = { { { "pri", "debug", "span", NULL }, handle_pri_debug, "Enables PRI debugging on a span", pri_debug_help, complete_span_4 }, @@ -10865,30 +10865,30 @@ #undef FORMAT2 } -static char show_channels_usage[] = +static const char show_channels_usage[] = "Usage: zap show channels\n" " Shows a list of available channels\n"; -static char show_channel_usage[] = +static const char show_channel_usage[] = "Usage: zap show channel \n" " Detailed information about a given channel\n"; -static char zap_show_status_usage[] = +static const char zap_show_status_usage[] = "Usage: zap show status\n" " Shows a list of Zaptel cards with status\n"; -static char destroy_channel_usage[] = +static const char destroy_channel_usage[] = "Usage: zap destroy channel \n" " DON'T USE THIS UNLESS YOU KNOW WHAT YOU ARE DOING. Immediately removes a given channel, whether it is in use or not\n"; -static char zap_restart_usage[] = +static const char zap_restart_usage[] = "Usage: zap restart\n" " Restarts the zaptel channels: destroys them all and then\n" " re-reads them from zapata.conf.\n" " Note that this will STOP any running CALL on zaptel channels.\n" ""; -static struct ast_cli_entry zap_cli[] = { +static const struct ast_cli_entry zap_cli[] = { { { "zap", "show", "cadences", NULL }, handle_zap_show_cadences, "List cadences", zap_show_cadences_help }, @@ -11444,7 +11444,7 @@ " Disables debugging on a given SS7 linkset\n"; #endif -static struct ast_cli_entry zap_ss7_cli[] = { +static const struct ast_cli_entry zap_ss7_cli[] = { { { "ss7", "debug", "linkset", NULL }, handle_ss7_debug, "Enables SS7 debugging on a linkset", ss7_debug_help, NULL }, { { "ss7", "no", "debug", "linkset", NULL }, handle_ss7_no_debug, Index: include/asterisk/channel.h =================================================================== --- include/asterisk/channel.h (revision 48151) +++ include/asterisk/channel.h (working copy) @@ -248,7 +248,7 @@ int (* const fixup)(struct ast_channel *oldchan, struct ast_channel *newchan); /*! \brief Set a given option */ - int (* const setoption)(struct ast_channel *chan, int option, void *data, int datalen); + int (* const setoption)(struct ast_channel *chan, int option, const void *data, size_t datalen); /*! \brief Query a given option */ int (* const queryoption)(struct ast_channel *chan, int option, void *data, int *datalen); @@ -1044,7 +1044,7 @@ * Set an option on a channel (see frame.h), optionally blocking awaiting the reply * Returns 0 on success and -1 on failure */ -int ast_channel_setoption(struct ast_channel *channel, int option, void *data, int datalen, int block); +int ast_channel_setoption(struct ast_channel *channel, int option, const void *data, size_t datalen, int block); /*! Pick the best codec */ /* Choose the best codec... Uhhh... Yah. */ Index: main/channel.c =================================================================== --- main/channel.c (revision 48151) +++ main/channel.c (working copy) @@ -288,15 +288,15 @@ return ret; } -static char show_channeltypes_usage[] = +static const char show_channeltypes_usage[] = "Usage: channeltype list\n" " Lists available channel types registered in your Asterisk server.\n"; -static char show_channeltype_usage[] = +static const char show_channeltype_usage[] = "Usage: channeltype show \n" " Show details about the specified channel type, .\n"; -static struct ast_cli_entry cli_channel[] = { +static const struct ast_cli_entry cli_channel[] = { { { "channeltype", "list", NULL }, show_channeltypes, "List available channel types", show_channeltypes_usage }, @@ -3969,7 +3969,7 @@ } /*! \brief Sets an option on a channel */ -int ast_channel_setoption(struct ast_channel *chan, int option, void *data, int datalen, int block) +int ast_channel_setoption(struct ast_channel *chan, int option, const void *data, size_t datalen, int block) { int res; Index: res/res_agi.c =================================================================== --- res/res_agi.c (revision 48151) +++ res/res_agi.c (working copy) @@ -71,17 +71,17 @@ /* Recycle some stuff from the CLI interface */ #define fdprintf agi_debug_cli -static char *app = "AGI"; +static const char app[] = "AGI"; -static char *eapp = "EAGI"; +static const char eapp[] = "EAGI"; -static char *deadapp = "DeadAGI"; +static const char deadapp[] = "DeadAGI"; -static char *synopsis = "Executes an AGI compliant application"; -static char *esynopsis = "Executes an EAGI compliant application"; -static char *deadsynopsis = "Executes AGI on a hungup channel"; +static const char synopsis[] = "Executes an AGI compliant application"; +static const char esynopsis[] = "Executes an EAGI compliant application"; +static const char deadsynopsis[] = "Executes AGI on a hungup channel"; -static char *descrip = +static const char descrip[] = " [E|Dead]AGI(command|args): Executes an Asterisk Gateway Interface compliant\n" "program on a channel. AGI allows Asterisk to launch external programs\n" "written in any language to control a telephony channel, play audio,\n" @@ -1339,19 +1339,19 @@ return RESULT_SUCCESS; } -static char usage_setmusic[] = +static const char usage_setmusic[] = " Usage: SET MUSIC ON \n" " Enables/Disables the music on hold generator. If is\n" " not specified, then the default music on hold class will be used.\n" " Always returns 0.\n"; -static char usage_dbput[] = +static const char usage_dbput[] = " Usage: DATABASE PUT \n" " Adds or updates an entry in the Asterisk database for a\n" " given family, key, and value.\n" " Returns 1 if successful, 0 otherwise.\n"; -static char usage_dbget[] = +static const char usage_dbget[] = " Usage: DATABASE GET \n" " Retrieves an entry in the Asterisk database for a\n" " given family and key.\n" @@ -1359,41 +1359,41 @@ " is set and returns the variable in parentheses.\n" " Example return code: 200 result=1 (testvariable)\n"; -static char usage_dbdel[] = +static const char usage_dbdel[] = " Usage: DATABASE DEL \n" " Deletes an entry in the Asterisk database for a\n" " given family and key.\n" " Returns 1 if successful, 0 otherwise.\n"; -static char usage_dbdeltree[] = +static const char usage_dbdeltree[] = " Usage: DATABASE DELTREE [keytree]\n" " Deletes a family or specific keytree within a family\n" " in the Asterisk database.\n" " Returns 1 if successful, 0 otherwise.\n"; -static char usage_verbose[] = +static const char usage_verbose[] = " Usage: VERBOSE \n" " Sends to the console via verbose message system.\n" " is the the verbose level (1-4)\n" " Always returns 1.\n"; -static char usage_getvariable[] = +static const char usage_getvariable[] = " Usage: GET VARIABLE \n" " Returns 0 if is not set. Returns 1 if \n" " is set and returns the variable in parentheses.\n" " example return code: 200 result=1 (testvariable)\n"; -static char usage_getvariablefull[] = +static const char usage_getvariablefull[] = " Usage: GET FULL VARIABLE []\n" " Returns 0 if is not set or channel does not exist. Returns 1\n" "if is set and returns the variable in parenthesis. Understands\n" "complex variable names and builtin variables, unlike GET VARIABLE.\n" " example return code: 200 result=1 (testvariable)\n"; -static char usage_setvariable[] = +static const char usage_setvariable[] = " Usage: SET VARIABLE \n"; -static char usage_channelstatus[] = +static const char usage_channelstatus[] = " Usage: CHANNEL STATUS []\n" " Returns the status of the specified channel.\n" " If no channel name is given the returns the status of the\n" @@ -1407,33 +1407,33 @@ " 6 Line is up\n" " 7 Line is busy\n"; -static char usage_setcallerid[] = +static const char usage_setcallerid[] = " Usage: SET CALLERID \n" " Changes the callerid of the current channel.\n"; -static char usage_exec[] = +static const char usage_exec[] = " Usage: EXEC \n" " Executes with given .\n" " Returns whatever the application returns, or -2 on failure to find application\n"; -static char usage_hangup[] = +static const char usage_hangup[] = " Usage: HANGUP []\n" " Hangs up the specified channel.\n" " If no channel name is given, hangs up the current channel\n"; -static char usage_answer[] = +static const char usage_answer[] = " Usage: ANSWER\n" " Answers channel if not already in answer state. Returns -1 on\n" " channel failure, or 0 if successful.\n"; -static char usage_waitfordigit[] = +static const char usage_waitfordigit[] = " Usage: WAIT FOR DIGIT \n" " Waits up to 'timeout' milliseconds for channel to receive a DTMF digit.\n" " Returns -1 on channel failure, 0 if no digit is received in the timeout, or\n" " the numerical value of the ascii of the digit if one is received. Use -1\n" " for the timeout value if you desire the call to block indefinitely.\n"; -static char usage_sendtext[] = +static const char usage_sendtext[] = " Usage: SEND TEXT \"\"\n" " Sends the given text on a channel. Most channels do not support the\n" " transmission of text. Returns 0 if text is sent, or if the channel does not\n" @@ -1441,7 +1441,7 @@ " consisting of greater than one word should be placed in quotes since the\n" " command only accepts a single argument.\n"; -static char usage_recvchar[] = +static const char usage_recvchar[] = " Usage: RECEIVE CHAR \n" " Receives a character of text on a channel. Specify timeout to be the\n" " maximum time to wait for input in milliseconds, or 0 for infinite. Most channels\n" @@ -1449,25 +1449,25 @@ " if one is received, or 0 if the channel does not support text reception. Returns\n" " -1 only on error/hangup.\n"; -static char usage_recvtext[] = +static const char usage_recvtext[] = " Usage: RECEIVE TEXT \n" " Receives a string of text on a channel. Specify timeout to be the\n" " maximum time to wait for input in milliseconds, or 0 for infinite. Most channels\n" " do not support the reception of text. Returns -1 for failure or 1 for success, and the string in parentheses.\n"; -static char usage_tddmode[] = +static const char usage_tddmode[] = " Usage: TDD MODE \n" " Enable/Disable TDD transmission/reception on a channel. Returns 1 if\n" " successful, or 0 if channel is not TDD-capable.\n"; -static char usage_sendimage[] = +static const char usage_sendimage[] = " Usage: SEND IMAGE \n" " Sends the given image on a channel. Most channels do not support the\n" " transmission of images. Returns 0 if image is sent, or if the channel does not\n" " support image transmission. Returns -1 only on error/hangup. Image names\n" " should not include extensions.\n"; -static char usage_streamfile[] = +static const char usage_streamfile[] = " Usage: STREAM FILE [sample offset]\n" " Send the given file, allowing playback to be interrupted by the given\n" " digits, if any. Use double quotes for the digits if you wish none to be\n" @@ -1477,7 +1477,7 @@ " or -1 on error or if the channel was disconnected. Remember, the file\n" " extension must not be included in the filename.\n"; -static char usage_controlstreamfile[] = +static const char usage_controlstreamfile[] = " Usage: CONTROL STREAM FILE [skipms] [ffchar] [rewchr] [pausechr]\n" " Send the given file, allowing playback to be controled by the given\n" " digits, if any. Use double quotes for the digits if you wish none to be\n" @@ -1487,32 +1487,32 @@ " extension must not be included in the filename.\n\n" " Note: ffchar and rewchar default to * and # respectively.\n"; -static char usage_getoption[] = +static const char usage_getoption[] = " Usage: GET OPTION [timeout]\n" " Behaves similar to STREAM FILE but used with a timeout option.\n"; -static char usage_saynumber[] = +static const char usage_saynumber[] = " Usage: SAY NUMBER \n" " Say a given number, returning early if any of the given DTMF digits\n" " are received on the channel. Returns 0 if playback completes without a digit\n" " being pressed, or the ASCII numerical value of the digit if one was pressed or\n" " -1 on error/hangup.\n"; -static char usage_saydigits[] = +static const char usage_saydigits[] = " Usage: SAY DIGITS \n" " Say a given digit string, returning early if any of the given DTMF digits\n" " are received on the channel. Returns 0 if playback completes without a digit\n" " being pressed, or the ASCII numerical value of the digit if one was pressed or\n" " -1 on error/hangup.\n"; -static char usage_sayalpha[] = +static const char usage_sayalpha[] = " Usage: SAY ALPHA \n" " Say a given character string, returning early if any of the given DTMF digits\n" " are received on the channel. Returns 0 if playback completes without a digit\n" " being pressed, or the ASCII numerical value of the digit if one was pressed or\n" " -1 on error/hangup.\n"; -static char usage_saydate[] = +static const char usage_saydate[] = " Usage: SAY DATE \n" " Say a given date, returning early if any of the given DTMF digits are\n" " received on the channel. is number of seconds elapsed since 00:00:00\n" @@ -1520,7 +1520,7 @@ " completes without a digit being pressed, or the ASCII numerical value of the\n" " digit if one was pressed or -1 on error/hangup.\n"; -static char usage_saytime[] = +static const char usage_saytime[] = " Usage: SAY TIME