[asterisk-commits] branch oej/multiparking - r8269 in /team/oej/multiparking: ./ apps/ channels/...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Jan 19 11:39:03 MST 2006


Author: oej
Date: Thu Jan 19 12:38:50 2006
New Revision: 8269

URL: http://svn.digium.com/view/asterisk?rev=8269&view=rev
Log:
Merged revisions 8195,8203,8233,8243 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r8195 | mogorman | 2006-01-18 22:12:14 +0100 (Wed, 18 Jan 2006) | 11 lines

Merged revisions 8194 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r8194 | mogorman | 2006-01-18 15:02:06 -0600 (Wed, 18 Jan 2006) | 3 lines

Solves issue with the login proccess in meetme
patch from 6136

........

................
r8203 | russell | 2006-01-18 23:17:31 +0100 (Wed, 18 Jan 2006) | 2 lines

constify arguments in more places where strings should not be modified (issue #6286)

................
r8233 | russell | 2006-01-19 05:21:12 +0100 (Thu, 19 Jan 2006) | 11 lines

Merged revisions 8232 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r8232 | russell | 2006-01-18 23:17:45 -0500 (Wed, 18 Jan 2006) | 3 lines

fix a seg fault due to assuming that space gets allocatted on the stack in the
same order that we declare the variables (issue #6290)

........

................
r8243 | russell | 2006-01-19 05:58:43 +0100 (Thu, 19 Jan 2006) | 11 lines

Merged revisions 8242 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r8242 | russell | 2006-01-18 23:56:48 -0500 (Wed, 18 Jan 2006) | 3 lines

fix Message-Account header to use the ip address if the fromdomain 
isn't set (issue #6278)

........

................

Modified:
    team/oej/multiparking/   (props changed)
    team/oej/multiparking/apps/app_meetme.c
    team/oej/multiparking/apps/app_milliwatt.c
    team/oej/multiparking/apps/app_queue.c
    team/oej/multiparking/apps/app_voicemail.c
    team/oej/multiparking/asterisk.c
    team/oej/multiparking/channels/chan_agent.c
    team/oej/multiparking/channels/chan_iax2.c
    team/oej/multiparking/channels/chan_oss.c
    team/oej/multiparking/channels/chan_sip.c
    team/oej/multiparking/channels/iax2-provision.c
    team/oej/multiparking/channels/iax2-provision.h
    team/oej/multiparking/cli.c
    team/oej/multiparking/include/asterisk/cli.h
    team/oej/multiparking/include/asterisk/module.h
    team/oej/multiparking/loader.c
    team/oej/multiparking/manager.c
    team/oej/multiparking/pbx.c
    team/oej/multiparking/pbx/pbx_config.c
    team/oej/multiparking/pbx/pbx_dundi.c
    team/oej/multiparking/res/res_clioriginate.c

Propchange: team/oej/multiparking/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jan 19 12:38:50 2006
@@ -1,1 +1,1 @@
-/trunk:1-8191
+/trunk:1-8266

Modified: team/oej/multiparking/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/apps/app_meetme.c?rev=8269&r1=8268&r2=8269&view=diff
==============================================================================
--- team/oej/multiparking/apps/app_meetme.c (original)
+++ team/oej/multiparking/apps/app_meetme.c Thu Jan 19 12:38:50 2006
@@ -688,7 +688,7 @@
 	return 0;
 }
 
-static char *complete_confcmd(char *line, char *word, int pos, int state) {
+static char *complete_confcmd(const char *line, const char *word, int pos, int state) {
 #define CONF_COMMANDS 6
 	int which = 0, x = 0;
 	struct ast_conference *cnf = NULL;
@@ -1759,7 +1759,8 @@
 			if (dynamic_pin) {
 				if (dynamic_pin[0] == 'q') {
 					/* Query the user to enter a PIN */
-					ast_app_getdata(chan, "conf-getpin", dynamic_pin, AST_MAX_EXTENSION - 1, 0);
+					if (ast_app_getdata(chan, "conf-getpin", dynamic_pin, AST_MAX_EXTENSION - 1, 0) < 0)
+						return NULL;
 				}
 				cnf = build_conf(confno, dynamic_pin, "", make, dynamic);
 			} else {

Modified: team/oej/multiparking/apps/app_milliwatt.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/apps/app_milliwatt.c?rev=8269&r1=8268&r2=8269&view=diff
==============================================================================
--- team/oej/multiparking/apps/app_milliwatt.c (original)
+++ team/oej/multiparking/apps/app_milliwatt.c Thu Jan 19 12:38:50 2006
@@ -72,30 +72,29 @@
 static int milliwatt_generate(struct ast_channel *chan, void *data, int len, int samples)
 {
 	struct ast_frame wf;
-	unsigned char waste[AST_FRIENDLY_OFFSET];
-	unsigned char buf[640];
+	unsigned char buf[AST_FRIENDLY_OFFSET + 640];
 	int i,*indexp = (int *) data;
 
-	if (len > sizeof(buf))
+	if (len + AST_FRIENDLY_OFFSET > sizeof(buf))
 	{
-		ast_log(LOG_WARNING,"Only doing %d bytes (%d bytes requested)\n",(int)sizeof(buf),len);
-		len = sizeof(buf);
+		ast_log(LOG_WARNING,"Only doing %d bytes (%d bytes requested)\n",(int)(sizeof(buf) - AST_FRIENDLY_OFFSET),len);
+		len = sizeof(buf) - AST_FRIENDLY_OFFSET;
 	}
-	waste[0] = 0; /* make compiler happy */
 	wf.frametype = AST_FRAME_VOICE;
 	wf.subclass = AST_FORMAT_ULAW;
 	wf.offset = AST_FRIENDLY_OFFSET;
 	wf.mallocd = 0;
-	wf.data = buf;
+	wf.data = buf + AST_FRIENDLY_OFFSET;
 	wf.datalen = len;
 	wf.samples = wf.datalen;
 	wf.src = "app_milliwatt";
 	wf.delivery.tv_sec = 0;
 	wf.delivery.tv_usec = 0;
+	wf.prev = wf.next = NULL;
 	/* create a buffer containing the digital milliwatt pattern */
 	for(i = 0; i < len; i++)
 	{
-		buf[i] = digital_milliwatt[(*indexp)++];
+		buf[AST_FRIENDLY_OFFSET + i] = digital_milliwatt[(*indexp)++];
 		*indexp &= 7;
 	}
 	if (ast_write(chan,&wf) < 0)

Modified: team/oej/multiparking/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/apps/app_queue.c?rev=8269&r1=8268&r2=8269&view=diff
==============================================================================
--- team/oej/multiparking/apps/app_queue.c (original)
+++ team/oej/multiparking/apps/app_queue.c Thu Jan 19 12:38:50 2006
@@ -3503,7 +3503,7 @@
 	return __queues_show(0, fd, argc, argv, 1);
 }
 
-static char *complete_queue(char *line, char *word, int pos, int state)
+static char *complete_queue(const char *line, const char *word, int pos, int state)
 {
 	struct ast_call_queue *q;
 	char *ret = NULL;
@@ -3777,7 +3777,7 @@
 	}
 }
 
-static char *complete_add_queue_member(char *line, char *word, int pos, int state)
+static char *complete_add_queue_member(const char *line, const char *word, int pos, int state)
 {
 	/* 0 - add; 1 - queue; 2 - member; 3 - <member>; 4 - to; 5 - <queue>; 6 - penalty; 7 - <penalty> */
 	switch (pos) {
@@ -3845,7 +3845,7 @@
 	}
 }
 
-static char *complete_remove_queue_member(char *line, char *word, int pos, int state)
+static char *complete_remove_queue_member(const char *line, const char *word, int pos, int state)
 {
 	int which = 0;
 	struct ast_call_queue *q;

Modified: team/oej/multiparking/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/apps/app_voicemail.c?rev=8269&r1=8268&r2=8269&view=diff
==============================================================================
--- team/oej/multiparking/apps/app_voicemail.c (original)
+++ team/oej/multiparking/apps/app_voicemail.c Thu Jan 19 12:38:50 2006
@@ -5803,7 +5803,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *complete_show_voicemail_users(char *line, char *word, int pos, int state)
+static char *complete_show_voicemail_users(const char *line, const char *word, int pos, int state)
 {
 	int which = 0;
 	int wordlen;

Modified: team/oej/multiparking/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/asterisk.c?rev=8269&r1=8268&r2=8269&view=diff
==============================================================================
--- team/oej/multiparking/asterisk.c (original)
+++ team/oej/multiparking/asterisk.c Thu Jan 19 12:38:50 2006
@@ -324,7 +324,7 @@
 #undef FORMAT
 }
 
-static char *complete_show_version_files(char *line, char *word, int pos, int state)
+static char *complete_show_version_files(const char *line, const char *word, int pos, int state)
 {
 	struct file_version *find;
 	int which = 0;

Modified: team/oej/multiparking/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/channels/chan_agent.c?rev=8269&r1=8268&r2=8269&view=diff
==============================================================================
--- team/oej/multiparking/channels/chan_agent.c (original)
+++ team/oej/multiparking/channels/chan_agent.c Thu Jan 19 12:38:50 2006
@@ -1622,7 +1622,7 @@
 	return 0;
 }
 
-static char *complete_agent_logoff_cmd(char *line, char *word, int pos, int state)
+static char *complete_agent_logoff_cmd(const char *line, const char *word, int pos, int state)
 {
 	struct agent_pvt *p;
 	char name[AST_MAX_AGENT];

Modified: team/oej/multiparking/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/channels/chan_iax2.c?rev=8269&r1=8268&r2=8269&view=diff
==============================================================================
--- team/oej/multiparking/channels/chan_iax2.c (original)
+++ team/oej/multiparking/channels/chan_iax2.c Thu Jan 19 12:38:50 2006
@@ -1970,7 +1970,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *complete_iax2_show_peer(char *line, char *word, int pos, int state)
+static char *complete_iax2_show_peer(const char *line, const char *word, int pos, int state)
 {
 	int which = 0;
 	struct iax2_peer *p;
@@ -7631,7 +7631,7 @@
 	return 0;
 }
 
-static char *iax2_prov_complete_template_3rd(char *line, char *word, int pos, int state)
+static char *iax2_prov_complete_template_3rd(const char *line, const char *word, int pos, int state)
 {
 	if (pos != 3)
 		return NULL;

Modified: team/oej/multiparking/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/channels/chan_oss.c?rev=8269&r1=8268&r2=8269&view=diff
==============================================================================
--- team/oej/multiparking/channels/chan_oss.c (original)
+++ team/oej/multiparking/channels/chan_oss.c Thu Jan 19 12:38:50 2006
@@ -975,7 +975,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *autoanswer_complete(char *line, char *word, int pos, int state)
+static char *autoanswer_complete(const char *line, const char *word, int pos, int state)
 {
 	int l = strlen(word);
 

Modified: team/oej/multiparking/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/channels/chan_sip.c?rev=8269&r1=8268&r2=8269&view=diff
==============================================================================
--- team/oej/multiparking/channels/chan_sip.c (original)
+++ team/oej/multiparking/channels/chan_sip.c Thu Jan 19 12:38:50 2006
@@ -5192,13 +5192,14 @@
 	char tmp[500];
 	char *t = tmp;
 	size_t maxbytes = sizeof(tmp);
+	char iabuf[INET_ADDRSTRLEN];
 
 	initreqprep(&req, p, SIP_NOTIFY);
 	add_header(&req, "Event", "message-summary");
 	add_header(&req, "Content-Type", default_notifymime);
 
 	ast_build_string(&t, &maxbytes, "Messages-Waiting: %s\r\n", newmsgs ? "yes" : "no");
-	ast_build_string(&t, &maxbytes, "Message-Account: sip:%s@%s\r\n", !ast_strlen_zero(vmexten) ? vmexten : global_vmexten, p->fromdomain);
+	ast_build_string(&t, &maxbytes, "Message-Account: sip:%s@%s\r\n", !ast_strlen_zero(vmexten) ? vmexten : global_vmexten, ast_strlen_zero(p->fromdomain) ? ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip) : p->fromdomain);
 	ast_build_string(&t, &maxbytes, "Voice-Message: %d/%d (0/0)\r\n", newmsgs, oldmsgs);
 
 	if (t > tmp + sizeof(tmp))
@@ -8401,7 +8402,7 @@
 }
 
 /*! \brief  complete_sipch: Support routine for 'sip show channel' CLI ---*/
-static char *complete_sipch(char *line, char *word, int pos, int state)
+static char *complete_sipch(const char *line, const char *word, int pos, int state)
 {
 	int which=0;
 	struct sip_pvt *cur;
@@ -8422,7 +8423,7 @@
 }
 
 /*! \brief  complete_sip_peer: Do completion on peer name ---*/
-static char *complete_sip_peer(char *word, int state, int flags2)
+static char *complete_sip_peer(const char *word, const int state, int flags2)
 {
 	char *result = NULL;
 	int wordlen = strlen(word);
@@ -8442,7 +8443,7 @@
 }
 
 /*! \brief  complete_sip_show_peer: Support routine for 'sip show peer' CLI ---*/
-static char *complete_sip_show_peer(char *line, char *word, int pos, int state)
+static char *complete_sip_show_peer(const char *line, const char *word, int pos, int state)
 {
 	if (pos == 3)
 		return complete_sip_peer(word, state, 0);
@@ -8451,7 +8452,7 @@
 }
 
 /*! \brief  complete_sip_debug_peer: Support routine for 'sip debug peer' CLI ---*/
-static char *complete_sip_debug_peer(char *line, char *word, int pos, int state)
+static char *complete_sip_debug_peer(const char *line, const char *word, int pos, int state)
 {
 	if (pos == 3)
 		return complete_sip_peer(word, state, 0);
@@ -8460,7 +8461,7 @@
 }
 
 /*! \brief  complete_sip_user: Do completion on user name ---*/
-static char *complete_sip_user(char *word, int state, int flags2)
+static char *complete_sip_user(const char *word, int state, int flags2)
 {
 	char *result = NULL;
 	int wordlen = strlen(word);
@@ -8480,7 +8481,7 @@
 }
 
 /*! \brief  complete_sip_show_user: Support routine for 'sip show user' CLI ---*/
-static char *complete_sip_show_user(char *line, char *word, int pos, int state)
+static char *complete_sip_show_user(const char *line, const char *word, int pos, int state)
 {
 	if (pos == 3)
 		return complete_sip_user(word, state, 0);
@@ -8489,7 +8490,7 @@
 }
 
 /*! \brief  complete_sipnotify: Support routine for 'sip notify' CLI ---*/
-static char *complete_sipnotify(char *line, char *word, int pos, int state)
+static char *complete_sipnotify(const char *line, const char *word, int pos, int state)
 {
 	char *c = NULL;
 
@@ -8521,7 +8522,7 @@
 }
 
 /*! \brief  complete_sip_prune_realtime_peer: Support routine for 'sip prune realtime peer' CLI ---*/
-static char *complete_sip_prune_realtime_peer(char *line, char *word, int pos, int state)
+static char *complete_sip_prune_realtime_peer(const char *line, const char *word, int pos, int state)
 {
 	if (pos == 4)
 		return complete_sip_peer(word, state, SIP_PAGE2_RTCACHEFRIENDS);
@@ -8529,7 +8530,7 @@
 }
 
 /*! \brief  complete_sip_prune_realtime_user: Support routine for 'sip prune realtime user' CLI ---*/
-static char *complete_sip_prune_realtime_user(char *line, char *word, int pos, int state)
+static char *complete_sip_prune_realtime_user(const char *line, const char *word, int pos, int state)
 {
 	if (pos == 4)
 		return complete_sip_user(word, state, SIP_PAGE2_RTCACHEFRIENDS);

Modified: team/oej/multiparking/channels/iax2-provision.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/channels/iax2-provision.c?rev=8269&r1=8268&r2=8269&view=diff
==============================================================================
--- team/oej/multiparking/channels/iax2-provision.c (original)
+++ team/oej/multiparking/channels/iax2-provision.c Thu Jan 19 12:38:50 2006
@@ -154,7 +154,7 @@
 	return cur;
 }
 
-char *iax_prov_complete_template(char *line, char *word, int pos, int state)
+char *iax_prov_complete_template(const char *line, const char *word, int pos, int state)
 {
 	struct iax_template *c;
 	int which=0;

Modified: team/oej/multiparking/channels/iax2-provision.h
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/channels/iax2-provision.h?rev=8269&r1=8268&r2=8269&view=diff
==============================================================================
--- team/oej/multiparking/channels/iax2-provision.h (original)
+++ team/oej/multiparking/channels/iax2-provision.h Thu Jan 19 12:38:50 2006
@@ -50,4 +50,4 @@
 extern int iax_provision_unload(void);
 extern int iax_provision_build(struct iax_ie_data *provdata, unsigned int *signature, const char *template, int force);
 extern int iax_provision_version(unsigned int *signature, const char *template, int force);
-extern char *iax_prov_complete_template(char *line, char *word, int pos, int state);
+extern char *iax_prov_complete_template(const char *line, const char *word, int pos, int state);

Modified: team/oej/multiparking/cli.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/cli.c?rev=8269&r1=8268&r2=8269&view=diff
==============================================================================
--- team/oej/multiparking/cli.c (original)
+++ team/oej/multiparking/cli.c Thu Jan 19 12:38:50 2006
@@ -508,7 +508,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *__ast_cli_generator(char *text, char *word, int state, int lock);
+static char *__ast_cli_generator(const char *text, const char *word, int state, int lock);
 
 static int handle_commandmatchesarray(int fd, int argc, char *argv[])
 {
@@ -762,7 +762,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *complete_show_channels(char *line, char *word, int pos, int state)
+static char *complete_show_channels(const char *line, const char *word, int pos, int state)
 {
 	static char *choices[] = { "concise", "verbose" };
 	int match = 0;
@@ -785,7 +785,7 @@
 	return NULL;
 }
 
-static char *complete_ch_helper(char *line, char *word, int pos, int state, int rpos)
+static char *complete_ch_helper(const char *line, const char *word, int pos, int state, int rpos)
 {
 	struct ast_channel *c = NULL;
 	int which = 0;
@@ -811,27 +811,27 @@
 	return ret;
 }
 
-static char *complete_ch_3(char *line, char *word, int pos, int state)
+static char *complete_ch_3(const char *line, const char *word, int pos, int state)
 {
 	return complete_ch_helper(line, word, pos, state, 2);
 }
 
-static char *complete_ch_4(char *line, char *word, int pos, int state)
+static char *complete_ch_4(const char *line, const char *word, int pos, int state)
 {
 	return complete_ch_helper(line, word, pos, state, 3);
 }
 
-static char *complete_mod_2(char *line, char *word, int pos, int state)
+static char *complete_mod_2(const char *line, const char *word, int pos, int state)
 {
 	return ast_module_helper(line, word, pos, state, 1, 1);
 }
 
-static char *complete_mod_4(char *line, char *word, int pos, int state)
+static char *complete_mod_4(const char *line, const char *word, int pos, int state)
 {
 	return ast_module_helper(line, word, pos, state, 3, 0);
 }
 
-static char *complete_fn(char *line, char *word, int pos, int state)
+static char *complete_fn(const char *line, const char *word, int pos, int state)
 {
 	char *c;
 	char filename[256];
@@ -903,7 +903,7 @@
 
 static int handle_help(int fd, int argc, char *argv[]);
 
-static char * complete_help(char *text, char *word, int pos, int state)
+static char * complete_help(const char *text, const char *word, int pos, int state)
 {
 	/* skip first 4 or 5 chars, "help "*/
 	int l = strlen(text);
@@ -941,7 +941,7 @@
 	{ { NULL }, NULL, NULL, NULL }
 };
 
-static struct ast_cli_entry *find_cli(char *cmds[], int exact)
+static struct ast_cli_entry *find_cli(char *const cmds[], int exact)
 {
 	int x;
 	int y;
@@ -987,7 +987,7 @@
 	return NULL;
 }
 
-static void join(char *dest, size_t destsize, char *w[], int tws)
+static void join(char *dest, size_t destsize, char *const w[], int tws)
 {
 	ast_join(dest, destsize, w);	
 
@@ -995,7 +995,7 @@
 		strncat(dest, " ", destsize - strlen(dest) - 1);
 }
 
-static void join2(char *dest, size_t destsize, char *w[])
+static void join2(char *dest, size_t destsize, char *const w[])
 {
 	int x;
 	/* Join words into a string */
@@ -1186,7 +1186,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *parse_args(char *s, int *argc, char *argv[], int max, int *trailingwhitespace)
+static char *parse_args(const char *s, int *argc, char *argv[], int max, int *trailingwhitespace)
 {
 	char *dup, *cur;
 	int x = 0;
@@ -1247,7 +1247,7 @@
 }
 
 /* This returns the number of unique matches for the generator */
-int ast_cli_generatornummatches(char *text, char *word)
+int ast_cli_generatornummatches(const char *text, const char *word)
 {
 	int matches = 0, i = 0;
 	char *buf = NULL, *oldbuf = NULL;
@@ -1264,7 +1264,7 @@
 	return matches;
 }
 
-char **ast_cli_completion_matches(char *text, char *word)
+char **ast_cli_completion_matches(const char *text, const char *word)
 {
 	char **match_list = NULL, *retstr, *prevstr;
 	size_t match_list_len, max_equal, which, i;
@@ -1303,7 +1303,7 @@
 	return match_list;
 }
 
-static char *__ast_cli_generator(char *text, char *word, int state, int lock)
+static char *__ast_cli_generator(const char *text, const char *word, int state, int lock)
 {
 	char *argv[AST_MAX_ARGS];
 	struct ast_cli_entry *e, *e1, *e2;
@@ -1379,12 +1379,12 @@
 	return NULL;
 }
 
-char *ast_cli_generator(char *text, char *word, int state)
+char *ast_cli_generator(const char *text, const char *word, int state)
 {
 	return __ast_cli_generator(text, word, state, 1);
 }
 
-int ast_cli_command(int fd, char *s)
+int ast_cli_command(int fd, const char *s)
 {
 	char *argv[AST_MAX_ARGS];
 	struct ast_cli_entry *e;

Modified: team/oej/multiparking/include/asterisk/cli.h
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/include/asterisk/cli.h?rev=8269&r1=8268&r2=8269&view=diff
==============================================================================
--- team/oej/multiparking/include/asterisk/cli.h (original)
+++ team/oej/multiparking/include/asterisk/cli.h Thu Jan 19 12:38:50 2006
@@ -44,8 +44,7 @@
 
 /*! \brief A command line entry */ 
 struct ast_cli_entry {
-	/*! Null terminated list of the words of the command */
-	char * cmda[AST_MAX_CMD_LEN];
+	char * const cmda[AST_MAX_CMD_LEN];
 	/*! Handler for the command (fd for output, # of args, argument list).
 	  Returns RESULT_SHOWUSAGE for improper arguments.
 	  argv[] has argc 'useful' entries, and an additional NULL entry
@@ -67,7 +66,7 @@
 	  Typically, the function is called with increasing values for n
 	  until a NULL is returned.
 	 */
-	char *(*generator)(char *line, char *word, int pos, int n);
+	char *(*generator)(const char *line, const char *word, int pos, int n);
 	/*! For linking */
 	struct ast_cli_entry *next;
 	/*! For keeping track of usage */
@@ -79,7 +78,7 @@
  * Interpret a command s, sending output to fd
  * Returns 0 on succes, -1 on failure 
  */
-int ast_cli_command(int fd, char *s);
+int ast_cli_command(int fd, const char *s);
 
 /*! \brief Registers a command or an array of commands 
  * \param e which cli entry to register
@@ -114,9 +113,9 @@
  * Useful for readline, that's about it
  * Returns 0 on success, -1 on failure
  */
-char *ast_cli_generator(char *, char *, int);
+char *ast_cli_generator(const char *, const char *, int);
 
-int ast_cli_generatornummatches(char *, char *);
+int ast_cli_generatornummatches(const char *, const char *);
 
 /*!
  * \brief Generates a NULL-terminated array of strings that
@@ -129,7 +128,7 @@
  * All strings and the array itself are malloc'ed and must be freed
  * by the caller.
  */
-char **ast_cli_completion_matches(char *, char *);
+char **ast_cli_completion_matches(const char *, const char *);
 
 
 #if defined(__cplusplus) || defined(c_plusplus)

Modified: team/oej/multiparking/include/asterisk/module.h
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/include/asterisk/module.h?rev=8269&r1=8268&r2=8269&view=diff
==============================================================================
--- team/oej/multiparking/include/asterisk/module.h (original)
+++ team/oej/multiparking/include/asterisk/module.h Thu Jan 19 12:38:50 2006
@@ -242,7 +242,7 @@
  * \return A possible completion of the partial match, or NULL if no matches
  * were found.
  */
-char *ast_module_helper(char *line, char *word, int pos, int state, int rpos, int needsreload);
+char *ast_module_helper(const char *line, const char *word, int pos, int state, int rpos, int needsreload);
 
 /*! 
  * \brief Register a function to be executed before Asterisk exits.

Modified: team/oej/multiparking/loader.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/loader.c?rev=8269&r1=8268&r2=8269&view=diff
==============================================================================
--- team/oej/multiparking/loader.c (original)
+++ team/oej/multiparking/loader.c Thu Jan 19 12:38:50 2006
@@ -164,7 +164,7 @@
 	return res;
 }
 
-char *ast_module_helper(char *line, char *word, int pos, int state, int rpos, int needsreload)
+char *ast_module_helper(const char *line, const char *word, int pos, int state, int rpos, int needsreload)
 {
 	struct module *m;
 	int which=0;

Modified: team/oej/multiparking/manager.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/manager.c?rev=8269&r1=8268&r2=8269&view=diff
==============================================================================
--- team/oej/multiparking/manager.c (original)
+++ team/oej/multiparking/manager.c Thu Jan 19 12:38:50 2006
@@ -161,7 +161,7 @@
 	return res;
 }
 
-static char *complete_show_mancmd(char *line, char *word, int pos, int state)
+static char *complete_show_mancmd(const char *line, const char *word, int pos, int state)
 {
 	struct manager_action *cur = first_action;
 	int which = 0;

Modified: team/oej/multiparking/pbx.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/pbx.c?rev=8269&r1=8268&r2=8269&view=diff
==============================================================================
--- team/oej/multiparking/pbx.c (original)
+++ team/oej/multiparking/pbx.c Thu Jan 19 12:38:50 2006
@@ -1082,7 +1082,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *complete_show_function(char *line, char *word, int pos, int state)
+static char *complete_show_function(const char *line, const char *word, int pos, int state)
 {
 	struct ast_custom_function *acf;
 	char *ret = NULL;
@@ -2834,7 +2834,7 @@
  * application at one time. You can type 'show application Dial Echo' and
  * you will see informations about these two applications ...
  */
-static char *complete_show_application(char *line, char *word, int pos, int state)
+static char *complete_show_application(const char *line, const char *word, int pos, int state)
 {
 	struct ast_app *a;
 	char *ret = NULL;
@@ -3067,7 +3067,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *complete_show_applications(char *line, char *word, int pos, int state)
+static char *complete_show_applications(const char *line, const char *word, int pos, int state)
 {
 	int wordlen = strlen(word);
 
@@ -3101,7 +3101,7 @@
 /*
  * 'show dialplan' CLI command implementation functions ...
  */
-static char *complete_show_dialplan_context(char *line, char *word, int pos,
+static char *complete_show_dialplan_context(const char *line, const char *word, int pos,
 	int state)
 {
 	struct ast_context *c = NULL;

Modified: team/oej/multiparking/pbx/pbx_config.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/pbx/pbx_config.c?rev=8269&r1=8268&r2=8269&view=diff
==============================================================================
--- team/oej/multiparking/pbx/pbx_config.c (original)
+++ team/oej/multiparking/pbx/pbx_config.c Thu Jan 19 12:38:50 2006
@@ -143,7 +143,7 @@
 	return RESULT_FAILURE;
 }
 
-static char *complete_context_dont_include(char *line, char *word,
+static char *complete_context_dont_include(const char *line, const char *word,
 	int pos, int state)
 {
 	int which = 0;
@@ -449,7 +449,7 @@
  * It's ugly, I know, but I'm waiting for Mark suggestion if upper is
  * bug or feature ...
  */
-static int fix_complete_args(char *line, char **word, int *pos)
+static int fix_complete_args(const char *line, char **word, int *pos)
 {
 	char *_line, *_strsep_line, *_previous_word = NULL, *_word = NULL;
 	int words = 0;
@@ -481,13 +481,14 @@
 }
 #endif /* BROKEN_READLINE */
 
-static char *complete_context_remove_extension(char *line, char *word, int pos,
+static char *complete_context_remove_extension(const char *line, const char *word2, int pos,
 	int state)
 {
 	char *ret = NULL;
 	int which = 0;
 
 #ifdef BROKEN_READLINE
+	char *word = (char *)word2;	/* fool the compiler. XXX will go away later */
 	/*
 	 * Fix arguments, *word is a new allocated structure, REMEMBER to
 	 * free *word when you want to return from this function ...
@@ -496,6 +497,8 @@
 		ast_log(LOG_ERROR, "Out of free memory\n");
 		return NULL;
 	}
+#else
+	const char *word = word2;
 #endif
 
 	/*
@@ -745,7 +748,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *complete_context_add_include(char *line, char *word, int pos,
+static char *complete_context_add_include(const char *line, const char *word, int pos,
     int state)
 {
 	struct ast_context *c;
@@ -1243,7 +1246,7 @@
 }
 
 /*! add extension 6123,1,Dial,IAX/212.71.138.13/6123 into local */
-static char *complete_context_add_extension(char *line, char *word,
+static char *complete_context_add_extension(const char *line, const char *word,
 	int pos, int state)
 {
 	int which = 0;
@@ -1326,7 +1329,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *complete_context_add_ignorepat(char *line, char *word,
+static char *complete_context_add_ignorepat(const char *line, const char *word,
 	int pos, int state)
 {
 	if (pos == 3) return state == 0 ? strdup("into") : NULL;
@@ -1427,7 +1430,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *complete_context_remove_ignorepat(char *line, char *word,
+static char *complete_context_remove_ignorepat(const char *line, const char *word,
 	int pos, int state)
 {
 	struct ast_context *c;

Modified: team/oej/multiparking/pbx/pbx_dundi.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/pbx/pbx_dundi.c?rev=8269&r1=8268&r2=8269&view=diff
==============================================================================
--- team/oej/multiparking/pbx/pbx_dundi.c (original)
+++ team/oej/multiparking/pbx/pbx_dundi.c Thu Jan 19 12:38:50 2006
@@ -2226,7 +2226,7 @@
 	}
 }
 
-static char *complete_peer_helper(char *line, char *word, int pos, int state, int rpos)
+static char *complete_peer_helper(const char *line, const char *word, int pos, int state, int rpos)
 {
 	int which=0;
 	char *ret;
@@ -2251,7 +2251,7 @@
 	return ret;
 }
 
-static char *complete_peer_4(char *line, char *word, int pos, int state)
+static char *complete_peer_4(const char *line, const char *word, int pos, int state)
 {
 	return complete_peer_helper(line, word, pos, state, 3);
 }

Modified: team/oej/multiparking/res/res_clioriginate.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/res/res_clioriginate.c?rev=8269&r1=8268&r2=8269&view=diff
==============================================================================
--- team/oej/multiparking/res/res_clioriginate.c (original)
+++ team/oej/multiparking/res/res_clioriginate.c Thu Jan 19 12:38:50 2006
@@ -64,7 +64,7 @@
 "used. If no extension is given, the 's' extension will be used.\n";
 
 static int handle_orig(int fd, int argc, char *argv[]);
-static char *complete_orig(char *line, char *word, int pos, int state);
+static char *complete_orig(const char *line, const char *word, int pos, int state);
 
 struct ast_cli_entry cli_orig = { { "originate", NULL }, handle_orig, "Originate a call", orig_help, complete_orig };
 
@@ -144,7 +144,7 @@
 	return res;
 }
 
-static char *complete_orig(char *line, char *word, int pos, int state)
+static char *complete_orig(const char *line, const char *word, int pos, int state)
 {
 	int wordlen;
 	char *app = "application";



More information about the asterisk-commits mailing list