[asterisk-commits] branch oej/astum - r8358 in /team/oej/astum: ./ apps/ channels/ configs/ doc/...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Jan 20 15:00:17 MST 2006


Author: oej
Date: Fri Jan 20 15:59:49 2006
New Revision: 8358

URL: http://svn.digium.com/view/asterisk?rev=8358&view=rev
Log:
Merged revisions 8195,8203,8233,8243,8270,8278,8282,8299-8300,8313,8315,8323-8324,8336,8338,8345-8346,8348,8356-8357 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)

........

................
r8270 | tilghman | 2006-01-19 19:58:45 +0100 (Thu, 19 Jan 2006) | 2 lines

Deprecate the use of Random in 1.3, 1.4

................
r8278 | tilghman | 2006-01-19 20:18:51 +0100 (Thu, 19 Jan 2006) | 3 lines

Merged revisions 8276 via svnmerge from
/branches/1.2

................
r8282 | oej | 2006-01-19 20:41:06 +0100 (Thu, 19 Jan 2006) | 2 lines

Enable "musicclass" setting for sip peers

................
r8299 | oej | 2006-01-19 23:09:18 +0100 (Thu, 19 Jan 2006) | 2 lines

Doxygen fixes

................
r8300 | oej | 2006-01-19 23:41:55 +0100 (Thu, 19 Jan 2006) | 3 lines

Add support for "musicclass" instead of "musiconhold" to make chan_zap compatible
with other channels.

................
r8313 | oej | 2006-01-20 01:08:36 +0100 (Fri, 20 Jan 2006) | 2 lines

Doxygen updates

................
r8315 | oej | 2006-01-20 01:18:42 +0100 (Fri, 20 Jan 2006) | 2 lines

More doxygen updates

................
r8323 | mogorman | 2006-01-20 02:07:46 +0100 (Fri, 20 Jan 2006) | 11 lines

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

........
r8320 | mogorman | 2006-01-19 19:00:46 -0600 (Thu, 19 Jan 2006) | 3 lines

solved problem with delayreject and iax trunking
bug 4291

........

................
r8324 | russell | 2006-01-20 02:25:12 +0100 (Fri, 20 Jan 2006) | 2 lines

fix version reporting (issue #6292)

................
r8336 | oej | 2006-01-20 15:32:30 +0100 (Fri, 20 Jan 2006) | 4 lines

- Add DOC file about caller ID presentation values
- Add callingpres to sip.conf
- Add reference to README.callingpres from zapata.conf

................
r8338 | kpfleming | 2006-01-20 18:27:51 +0100 (Fri, 20 Jan 2006) | 2 lines

eliminate compiler warnings from recent const-ification

................
r8345 | mattf | 2006-01-20 19:17:46 +0100 (Fri, 20 Jan 2006) | 2 lines

Update config.  Apprently default doesn't always work now.

................
r8346 | mattf | 2006-01-20 19:18:40 +0100 (Fri, 20 Jan 2006) | 2 lines

Change chan_alsa to default open the first sound card device

................
r8348 | russell | 2006-01-20 19:40:24 +0100 (Fri, 20 Jan 2006) | 10 lines

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

........
r8347 | russell | 2006-01-20 13:34:42 -0500 (Fri, 20 Jan 2006) | 2 lines

fix invalid value of prev_q (issue #6302)

........

................
r8356 | russell | 2006-01-20 20:24:42 +0100 (Fri, 20 Jan 2006) | 11 lines

- move ast_strdupa from channel.h to utils.h
- attempt to log an error message if the __builtin_alloca inside of ast_strdupa
  fails.
- document the fact that it is known and intended behavior for ast_strdupa to
  cause Asterisk to crash if the alloca fails
- use __builtin_expect when checking for allocation failure in all of the
  allocation wrappers

New Janitor Project!  Anywhere that we check for a successful allocation after
a call to ast_strdupa is unnecessary and should be removed.

................
r8357 | mattf | 2006-01-20 22:36:33 +0100 (Fri, 20 Jan 2006) | 2 lines

Fix for formats so they give better output on failure conditions. (#6141)

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

Added:
    team/oej/astum/doc/README.callingpres
      - copied unchanged from r8357, trunk/doc/README.callingpres
Modified:
    team/oej/astum/   (props changed)
    team/oej/astum/apps/app_meetme.c
    team/oej/astum/apps/app_milliwatt.c
    team/oej/astum/apps/app_queue.c
    team/oej/astum/apps/app_random.c
    team/oej/astum/apps/app_sms.c
    team/oej/astum/apps/app_voicemail.c
    team/oej/astum/ast_expr2.fl
    team/oej/astum/ast_expr2.y
    team/oej/astum/asterisk.c
    team/oej/astum/channels/chan_agent.c
    team/oej/astum/channels/chan_alsa.c
    team/oej/astum/channels/chan_iax2.c
    team/oej/astum/channels/chan_local.c
    team/oej/astum/channels/chan_oss.c
    team/oej/astum/channels/chan_sip.c
    team/oej/astum/channels/chan_zap.c
    team/oej/astum/channels/iax2-provision.c
    team/oej/astum/channels/iax2-provision.h
    team/oej/astum/cli.c
    team/oej/astum/config.c
    team/oej/astum/configs/alsa.conf.sample
    team/oej/astum/configs/sip.conf.sample
    team/oej/astum/configs/zapata.conf.sample
    team/oej/astum/devicestate.c
    team/oej/astum/enum.c
    team/oej/astum/formats/format_pcm.c
    team/oej/astum/formats/format_pcm_alaw.c
    team/oej/astum/include/asterisk/channel.h
    team/oej/astum/include/asterisk/cli.h
    team/oej/astum/include/asterisk/module.h
    team/oej/astum/include/asterisk/utils.h
    team/oej/astum/loader.c
    team/oej/astum/logger.c
    team/oej/astum/manager.c
    team/oej/astum/pbx.c
    team/oej/astum/pbx/pbx_config.c
    team/oej/astum/pbx/pbx_dundi.c
    team/oej/astum/res/res_clioriginate.c
    team/oej/astum/res/res_features.c
    team/oej/astum/udptl.c

Propchange: team/oej/astum/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Jan 20 15:59:49 2006
@@ -1,1 +1,1 @@
-/trunk:1-8191
+/trunk:1-8357

Modified: team/oej/astum/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/apps/app_meetme.c?rev=8358&r1=8357&r2=8358&view=diff
==============================================================================
--- team/oej/astum/apps/app_meetme.c (original)
+++ team/oej/astum/apps/app_meetme.c Fri Jan 20 15:59:49 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 {
@@ -1816,7 +1817,7 @@
 	return cnf;
 }
 
-/*--- count_exec: The MeetmeCount application */
+/*! \brief The MeetmeCount application */
 static int count_exec(struct ast_channel *chan, void *data)
 {
 	struct localuser *u;
@@ -1866,7 +1867,7 @@
 	return res;
 }
 
-/*--- conf_exec: The meetme() application */
+/*! \brief The meetme() application */
 static int conf_exec(struct ast_channel *chan, void *data)
 {
 	int res=-1;
@@ -2136,7 +2137,7 @@
 	return NULL;
 }
 
-/*--- admin_exec: The MeetMeadmin application */
+/*! \brief The MeetMeadmin application */
 /* MeetMeAdmin(confno, command, caller) */
 static int admin_exec(struct ast_channel *chan, void *data) {
 	char *params;

Modified: team/oej/astum/apps/app_milliwatt.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/apps/app_milliwatt.c?rev=8358&r1=8357&r2=8358&view=diff
==============================================================================
--- team/oej/astum/apps/app_milliwatt.c (original)
+++ team/oej/astum/apps/app_milliwatt.c Fri Jan 20 15:59:49 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/astum/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/apps/app_queue.c?rev=8358&r1=8357&r2=8358&view=diff
==============================================================================
--- team/oej/astum/apps/app_queue.c (original)
+++ team/oej/astum/apps/app_queue.c Fri Jan 20 15:59:49 2006
@@ -796,20 +796,17 @@
 static struct ast_call_queue *find_queue_by_name_rt(const char *queuename, struct ast_variable *queue_vars, struct ast_config *member_config)
 {
 	struct ast_variable *v;
-	struct ast_call_queue *q, *prev_q;
+	struct ast_call_queue *q, *prev_q = NULL;
 	struct member *m, *prev_m, *next_m;
 	char *interface;
 	char *tmp, *tmp_name;
 	char tmpbuf[64];	/* Must be longer than the longest queue param name. */
 
 	/* Find the queue in the in-core list (we will create a new one if not found). */
-	q = queues;
-	prev_q = NULL;
-	while (q) {
+	for (q = queues; q; q = q->next) {
 		if (!strcasecmp(q->name, queuename)) {
 			break;
 		}
-		q = q->next;
 		prev_q = q;
 	}
 
@@ -3503,7 +3500,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 +3774,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 +3842,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/astum/apps/app_random.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/apps/app_random.c?rev=8358&r1=8357&r2=8358&view=diff
==============================================================================
--- team/oej/astum/apps/app_random.c (original)
+++ team/oej/astum/apps/app_random.c Fri Jan 20 15:59:49 2006
@@ -39,6 +39,8 @@
 #include "asterisk/pbx.h"
 #include "asterisk/module.h"
 
+/* TODO This app should be removed from trunk following the release of 1.4 */
+
 static char *tdesc = "Random goto";
 
 static char *app_random = "Random";
@@ -47,13 +49,12 @@
 
 static char *random_descrip =
 "Random([probability]:[[context|]extension|]priority)\n"
-"  probability := INTEGER in the range 1 to 100\n";
+"  probability := INTEGER in the range 1 to 100\n"
+"DEPRECATED: Use GotoIf($[${RAND(1,100)} > <number>]?<label>)\n";
 
 STANDARD_LOCAL_USER;
 
 LOCAL_USER_DECL;
-
-static char random_state[256];
 
 static int random_exec(struct ast_channel *chan, void *data)
 {
@@ -63,7 +64,8 @@
 	char *s;
 	char *prob;
 	int probint;
-	
+	static int deprecated = 0;
+
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Random requires an argument ([probability]:[[context|]extension|]priority)\n");
 		return -1;
@@ -82,7 +84,12 @@
 	if ((!prob) || (sscanf(prob, "%d", &probint) != 1))
 		probint = 0;
 
-	if ((random() % 100) + probint > 100) {
+	if (!deprecated) {
+		deprecated = 1;
+		ast_log(LOG_WARNING, "Random is deprecated in Asterisk 1.3 or later.  Replace with GotoIf($[${RAND(0,99)} + %d >= 100]?%s)\n", probint, s);
+	}
+
+	if ((ast_random() % 100) + probint > 100) {
 		res = ast_parseable_goto(chan, s);
 		if (option_verbose > 2)
 			ast_verbose( VERBOSE_PREFIX_3 "Random branches to (%s,%s,%d)\n",
@@ -105,7 +112,6 @@
 
 int load_module(void)
 {
-	initstate((getppid() * 65535 + getpid()) % RAND_MAX, random_state, 256);
 	return ast_register_application(app_random, random_exec, random_synopsis, random_descrip);
 }
 

Modified: team/oej/astum/apps/app_sms.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/apps/app_sms.c?rev=8358&r1=8357&r2=8358&view=diff
==============================================================================
--- team/oej/astum/apps/app_sms.c (original)
+++ team/oej/astum/apps/app_sms.c Fri Jan 20 15:59:49 2006
@@ -198,7 +198,7 @@
 
 static void sms_messagetx (sms_t * h);
 
-/*--- numcpy: copy number, skipping non digits apart from leading + */
+/*! \brief copy number, skipping non digits apart from leading + */
 static void numcpy (char *d, char *s)
 {
 	if (*s == '+')
@@ -211,7 +211,7 @@
 	*d = 0;
 }
 
-/*--- isodate: static, return a date/time in ISO format */
+/*! \brief static, return a date/time in ISO format */
 static char * isodate (time_t t)
 {
 	static char date[20];
@@ -219,7 +219,7 @@
 	return date;
 }
 
-/*--- utf8decode: reads next UCS character from null terminated UTF-8 string and advanced pointer */
+/*! \brief reads next UCS character from null terminated UTF-8 string and advanced pointer */
 /* for non valid UTF-8 sequences, returns character as is */
 /* Does not advance pointer for null termination */
 static long utf8decode (unsigned char **pp)
@@ -265,7 +265,7 @@
 	return *p;                   /* not sensible */
 }
 
-/*--- packsms7: takes a binary header (udhl bytes at udh) and UCS-2 message (udl characters at ud) and packs in to o using SMS 7 bit character codes */
+/*! \brief takes a binary header (udhl bytes at udh) and UCS-2 message (udl characters at ud) and packs in to o using SMS 7 bit character codes */
 /* The return value is the number of septets packed in to o, which is internally limited to SMSLEN */
 /* o can be null, in which case this is used to validate or count only */
 /* if the input contains invalid characters then the return value is -1 */
@@ -335,7 +335,7 @@
 	return n;
 }
 
-/*--- packsms8: takes a binary header (udhl bytes at udh) and UCS-2 message (udl characters at ud) and packs in to o using 8 bit character codes */
+/*! \brief takes a binary header (udhl bytes at udh) and UCS-2 message (udl characters at ud) and packs in to o using 8 bit character codes */
 /* The return value is the number of bytes packed in to o, which is internally limited to 140 */
 /* o can be null, in which case this is used to validate or count only */
 /* if the input contains invalid characters then the return value is -1 */
@@ -367,7 +367,7 @@
 	return p;
 }
 
-/*--- packsms16: takes a binary header (udhl bytes at udh) and UCS-2 
+/*! \brief takes a binary header (udhl bytes at udh) and UCS-2 
 	message (udl characters at ud) and packs in to o using 16 bit 
 	UCS-2 character codes 
 	The return value is the number of bytes packed in to o, which is 
@@ -404,7 +404,7 @@
 	return p;
 }
 
-/*--- packsms: general pack, with length and data, 
+/*! \brief general pack, with length and data, 
 	returns number of bytes of target used */
 static int packsms (unsigned char dcs, unsigned char *base, unsigned int udhl, unsigned char *udh, int udl, unsigned short *ud)
 {
@@ -436,7 +436,7 @@
 }
 
 
-/*--- packdate: pack a date and return */
+/*! \brief pack a date and return */
 static void packdate (unsigned char *o, time_t w)
 {
 	struct tm *t = localtime (&w);
@@ -457,7 +457,7 @@
 		*o++ = ((z % 10) << 4) + z / 10;
 }
 
-/*--- unpackdate: unpack a date and return */
+/*! \brief unpack a date and return */
 static time_t unpackdate (unsigned char *i)
 {
 	struct tm t;
@@ -475,7 +475,7 @@
 	return mktime (&t);
 }
 
-/*--- unpacksms7: unpacks bytes (7 bit encoding) at i, len l septets, 
+/*! \brief unpacks bytes (7 bit encoding) at i, len l septets, 
 	and places in udh and ud setting udhl and udl. udh not used 
 	if udhi not set */
 static void unpacksms7 (unsigned char *i, unsigned char l, unsigned char *udh, int *udhl, unsigned short *ud, int *udl, char udhi)
@@ -526,7 +526,7 @@
 	*udl = (o - ud);
 }
 
-/*--- unpacksms8: unpacks bytes (8 bit encoding) at i, len l septets, 
+/*! \brief unpacks bytes (8 bit encoding) at i, len l septets, 
       and places in udh and ud setting udhl and udl. udh not used 
       if udhi not set */
 static void unpacksms8 (unsigned char *i, unsigned char l, unsigned char *udh, int *udhl, unsigned short *ud, int *udl, char udhi)
@@ -551,7 +551,7 @@
 	*udl = (o - ud);
 }
 
-/*--- unpacksms16: unpacks bytes (16 bit encoding) at i, len l septets,
+/*! \brief unpacks bytes (16 bit encoding) at i, len l septets,
 	 and places in udh and ud setting udhl and udl. 
 	udh not used if udhi not set */
 static void unpacksms16 (unsigned char *i, unsigned char l, unsigned char *udh, int *udhl, unsigned short *ud, int *udl, char udhi)
@@ -580,7 +580,7 @@
 	*udl = (o - ud);
 }
 
-/*--- unpacksms: general unpack - starts with length byte (octet or septet) and returns number of bytes used, inc length */
+/*! \brief general unpack - starts with length byte (octet or septet) and returns number of bytes used, inc length */
 static int unpacksms (unsigned char dcs, unsigned char *i, unsigned char *udh, int *udhl, unsigned short *ud, int *udl, char udhi)
 {
 	int l = *i++;
@@ -594,7 +594,7 @@
 	return l + 1;
 }
 
-/*--- unpackaddress: unpack an address from i, return byte length, unpack to o */
+/*! \brief unpack an address from i, return byte length, unpack to o */
 static unsigned char unpackaddress (char *o, unsigned char *i)
 {
 	unsigned char l = i[0],
@@ -611,7 +611,7 @@
 	return (l + 5) / 2;
 }
 
-/*--- packaddress: store an address at o, and return number of bytes used */
+/*! \brief store an address at o, and return number of bytes used */
 static unsigned char packaddress (unsigned char *o, char *i)
 {
 	unsigned char p = 2;
@@ -636,7 +636,7 @@
 	return p;
 }
 
-/*--- sms_log: Log the output, and remove file */
+/*! \brief Log the output, and remove file */
 static void sms_log (sms_t * h, char status)
 {
 	if (*h->oa || *h->da) {
@@ -674,7 +674,7 @@
 	}
 }
 
-/*--- sms_readfile: parse and delete a file */
+/*! \brief parse and delete a file */
 static void sms_readfile (sms_t * h, char *fn)
 {
 	char line[1000];
@@ -856,7 +856,7 @@
 	}
 }
 
-/*--- sms_writefile: white a received text message to a file */
+/*! \brief white a received text message to a file */
 static void sms_writefile (sms_t * h)
 {
 	char fn[200] = "", fn2[200] = "";
@@ -943,7 +943,7 @@
 	}
 }
 
-/*--- readdirqueue: read dir skipping dot files... */
+/*! \brief read dir skipping dot files... */
 static struct dirent *readdirqueue (DIR * d, char *queue)
 {
    struct dirent *f;
@@ -953,7 +953,7 @@
    return f;
 }
 
-/*--- sms_handleincoming: handle the incoming message */
+/*! \brief handle the incoming message */
 static unsigned char sms_handleincoming (sms_t * h)
 {
 	unsigned char p = 3;
@@ -1024,8 +1024,7 @@
 #define NAME_MAX 1024
 #endif
 
-/*--- sms_nextoutgoing: find and fill in next message, 
-	or send a REL if none waiting */
+/*! \brief find and fill in next message, or send a REL if none waiting */
 static void sms_nextoutgoing (sms_t * h)
 {          
 	char fn[100 + NAME_MAX] = "";

Modified: team/oej/astum/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/apps/app_voicemail.c?rev=8358&r1=8357&r2=8358&view=diff
==============================================================================
--- team/oej/astum/apps/app_voicemail.c (original)
+++ team/oej/astum/apps/app_voicemail.c Fri Jan 20 15:59:49 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/astum/ast_expr2.fl
URL: http://svn.digium.com/view/asterisk/team/oej/astum/ast_expr2.fl?rev=8358&r1=8357&r2=8358&view=diff
==============================================================================
--- team/oej/astum/ast_expr2.fl (original)
+++ team/oej/astum/ast_expr2.fl Fri Jan 20 15:59:49 2006
@@ -67,7 +67,7 @@
  
 void ast_yyset_column(int column_no, yyscan_t yyscanner);
 int ast_yyget_column(yyscan_t yyscanner);
-
+static int curlycount = 0;
 %}
 
 %option prefix="ast_yy"
@@ -77,6 +77,7 @@
 %option bison-bridge
 %option bison-locations
 %option noyywrap
+%x var trail
 
 %%
 
@@ -98,6 +99,8 @@
 \:\:	{ SET_COLUMNS; SET_STRING; return TOK_COLONCOLON;}
 \(	{ SET_COLUMNS; SET_STRING; return TOK_LP;}
 \)	{ SET_COLUMNS; SET_STRING; return TOK_RP;}
+\$\{   {/* gather the contents of ${} expressions, with trailing stuff, into a single TOKEN. They are much more complex now than they used to be */
+                       curlycount = 0; BEGIN(var); yymore();}
 
 [ 	\r]		{}
 \"[^"]*\"   {SET_COLUMNS; SET_STRING; return TOKEN;}
@@ -106,7 +109,14 @@
 [0-9]+		{   SET_COLUMNS;  /* the original behavior of the expression parser was to bring in numbers as a numeric string */
 				SET_NUMERIC_STRING;
 				return TOKEN;}
-[a-zA-Z0-9,.';{}\\_^%$#@!]+	{SET_COLUMNS; SET_STRING; return TOKEN;}
+[a-zA-Z0-9,.';\\_^%$#@!]+	{SET_COLUMNS; SET_STRING; return TOKEN;}
+
+<var>[^{}]*\}  {curlycount--; if(curlycount < 0){ BEGIN(trail);  yymore();} else {  yymore();}}
+<var>[^{}]*\{  {curlycount++; yymore();  }
+<trail>[^-\t\r \n$():?%/+=*<>!|&]* {BEGIN(0); SET_COLUMNS; SET_STRING; return TOKEN;}
+<trail>[-\t\r \n$():?%/+=*<>!|&]        {char c = yytext[yyleng-1]; BEGIN(0); unput(c); SET_COLUMNS; SET_STRING; return TOKEN;}
+<trail>\$\{            {curlycount = 0; BEGIN(var); yymore();  }
+<trail><<EOF>>		{BEGIN(0); SET_COLUMNS; SET_STRING; return TOKEN; /* actually, if an expr is only a variable ref, this could happen a LOT */}
 
 %%
 
@@ -153,6 +163,7 @@
 			ast_copy_string(buf, io.val->u.s, length);
 #endif /* STANDALONE */
 			return_value = strlen(buf);
+			free(io.val->u.s);
 		}
 		free(io.val);
 	}
@@ -167,15 +178,6 @@
 	int i=0;
 	spacebuf[0] = 0;
 	
-#ifdef WHEN_LOC_MEANS_SOMETHING
-	if( loc->first_column > 7990 ) /* if things get out of whack, why crash? */
-		loc->first_column = 7990;
-	if( loc->last_column > 7990 )
-		loc->last_column = 7990;
-	for(i=0;i<loc->first_column;i++) spacebuf[i] = ' ';
-	for(   ;i<loc->last_column;i++) spacebuf[i] = '^';
-	spacebuf[i] = 0;
-#endif
 	for(i=0;i< (int)(yytext - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);i++) spacebuf2[i] = ' ';  /* uh... assuming yyg is defined, then I can use the yycolumn macro,
 													which is the same thing as... get this:
 													yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]->yy_bs_column

Modified: team/oej/astum/ast_expr2.y
URL: http://svn.digium.com/view/asterisk/team/oej/astum/ast_expr2.y?rev=8358&r1=8357&r2=8358&view=diff
==============================================================================
--- team/oej/astum/ast_expr2.y (original)
+++ team/oej/astum/ast_expr2.y Fri Jan 20 15:59:49 2006
@@ -124,7 +124,12 @@
    some useful info about the error. Not as easy as it looks, but it
    is possible. */
 #define ast_yyerror(x) ast_yyerror(x,&yyloc,parseio)
-
+#define DESTROY(x) { \
+if ((x)->type == AST_EXPR_numeric_string || (x)->type == AST_EXPR_string) \
+	free((x)->u.s); \
+	(x)->u.s = 0; \
+	free(x); \
+}
 %}
  
 %pure-parser
@@ -158,69 +163,91 @@
 %%
 
 start: expr { ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1);
-              ((struct parse_io *)parseio)->val->type = $$->type;
-              if( $$->type == AST_EXPR_integer )
-		((struct parse_io *)parseio)->val->u.i = $$->u.i;
+              ((struct parse_io *)parseio)->val->type = $1->type;
+              if( $1->type == AST_EXPR_integer )
+				  ((struct parse_io *)parseio)->val->u.i = $1->u.i;
               else
-                ((struct parse_io *)parseio)->val->u.s = $$->u.s; }
+				  ((struct parse_io *)parseio)->val->u.s = $1->u.s; 
+			  free($1);
+			}
 	;
 
 expr:	TOKEN   { $$= $1;}
 	| TOK_LP expr TOK_RP { $$ = $2; 
 	                       @$.first_column = @1.first_column; @$.last_column = @3.last_column; 
-						   @$.first_line=0; @$.last_line=0;}
+						   @$.first_line=0; @$.last_line=0;
+							DESTROY($1); DESTROY($3); }
 	| expr TOK_OR expr { $$ = op_or ($1, $3);
+						DESTROY($2);	
                          @$.first_column = @1.first_column; @$.last_column = @3.last_column; 
 						 @$.first_line=0; @$.last_line=0;}
 	| expr TOK_AND expr { $$ = op_and ($1, $3); 
+						DESTROY($2);	
 	                      @$.first_column = @1.first_column; @$.last_column = @3.last_column; 
                           @$.first_line=0; @$.last_line=0;}
 	| expr TOK_EQ expr { $$ = op_eq ($1, $3);
+						DESTROY($2);	
 	                     @$.first_column = @1.first_column; @$.last_column = @3.last_column;
 						 @$.first_line=0; @$.last_line=0;}
 	| expr TOK_GT expr { $$ = op_gt ($1, $3);
+						DESTROY($2);	
                          @$.first_column = @1.first_column; @$.last_column = @3.last_column;
 						 @$.first_line=0; @$.last_line=0;}
 	| expr TOK_LT expr { $$ = op_lt ($1, $3); 
+						DESTROY($2);	
 	                     @$.first_column = @1.first_column; @$.last_column = @3.last_column; 
 						 @$.first_line=0; @$.last_line=0;}
 	| expr TOK_GE expr  { $$ = op_ge ($1, $3); 
+						DESTROY($2);	
 	                      @$.first_column = @1.first_column; @$.last_column = @3.last_column; 
 						  @$.first_line=0; @$.last_line=0;}
 	| expr TOK_LE expr  { $$ = op_le ($1, $3); 
+						DESTROY($2);	
 	                      @$.first_column = @1.first_column; @$.last_column = @3.last_column; 
 						  @$.first_line=0; @$.last_line=0;}
 	| expr TOK_NE expr  { $$ = op_ne ($1, $3); 
+						DESTROY($2);	
 	                      @$.first_column = @1.first_column; @$.last_column = @3.last_column; 
 						  @$.first_line=0; @$.last_line=0;}
 	| expr TOK_PLUS expr { $$ = op_plus ($1, $3); 
+						DESTROY($2);	
 	                       @$.first_column = @1.first_column; @$.last_column = @3.last_column; 
 						   @$.first_line=0; @$.last_line=0;}
 	| expr TOK_MINUS expr { $$ = op_minus ($1, $3); 
+						DESTROY($2);	
 	                        @$.first_column = @1.first_column; @$.last_column = @3.last_column; 
 							@$.first_line=0; @$.last_line=0;}
 	| TOK_MINUS expr %prec TOK_COMPL { $$ = op_negate ($2); 
+						DESTROY($1);	
 	                        @$.first_column = @1.first_column; @$.last_column = @2.last_column; 
 							@$.first_line=0; @$.last_line=0;}
 	| TOK_COMPL expr   { $$ = op_compl ($2); 
+						DESTROY($1);	
 	                        @$.first_column = @1.first_column; @$.last_column = @2.last_column; 
 							@$.first_line=0; @$.last_line=0;}
 	| expr TOK_MULT expr { $$ = op_times ($1, $3); 
+						DESTROY($2);	
 	                       @$.first_column = @1.first_column; @$.last_column = @3.last_column; 
 						   @$.first_line=0; @$.last_line=0;}
 	| expr TOK_DIV expr { $$ = op_div ($1, $3); 
+						DESTROY($2);	
 	                      @$.first_column = @1.first_column; @$.last_column = @3.last_column; 
 						  @$.first_line=0; @$.last_line=0;}
 	| expr TOK_MOD expr { $$ = op_rem ($1, $3); 
+						DESTROY($2);	
 	                      @$.first_column = @1.first_column; @$.last_column = @3.last_column; 
 						  @$.first_line=0; @$.last_line=0;}
 	| expr TOK_COLON expr { $$ = op_colon ($1, $3); 
+						DESTROY($2);	
 	                        @$.first_column = @1.first_column; @$.last_column = @3.last_column; 
 							@$.first_line=0; @$.last_line=0;}
 	| expr TOK_EQTILDE expr { $$ = op_eqtilde ($1, $3); 
+						DESTROY($2);	
 	                        @$.first_column = @1.first_column; @$.last_column = @3.last_column; 
 							@$.first_line=0; @$.last_line=0;}
 	| expr TOK_COND expr TOK_COLONCOLON expr  { $$ = op_cond ($1, $3, $5); 
+						DESTROY($2);	
+						DESTROY($4);	
 	                        @$.first_column = @1.first_column; @$.last_column = @3.last_column; 
 							@$.first_line=0; @$.last_line=0;}
 	;
@@ -281,6 +308,7 @@
 	}
 	if (vp->type == AST_EXPR_string || vp->type == AST_EXPR_numeric_string)
 		free (vp->u.s);	
+	free(vp);
 }
 
 

Modified: team/oej/astum/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/asterisk.c?rev=8358&r1=8357&r2=8358&view=diff
==============================================================================
--- team/oej/astum/asterisk.c (original)
+++ team/oej/astum/asterisk.c Fri Jan 20 15:59:49 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/astum/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/channels/chan_agent.c?rev=8358&r1=8357&r2=8358&view=diff
==============================================================================
--- team/oej/astum/channels/chan_agent.c (original)
+++ team/oej/astum/channels/chan_agent.c Fri Jan 20 15:59:49 2006
@@ -940,7 +940,7 @@
 	return ret;
 }
 
-/*--- agent_new: Create new agent channel ---*/
+/*! \brief Create new agent channel ---*/
 static struct ast_channel *agent_new(struct agent_pvt *p, int state)
 {
 	struct ast_channel *tmp;
@@ -1305,7 +1305,7 @@
 	return -1;
 }
 
-/*--- agent_request: Part of the Asterisk PBX interface ---*/
+/*! \brief Part of the Asterisk PBX interface ---*/
 static struct ast_channel *agent_request(const char *type, int format, void *data, int *cause)
 {
 	struct agent_pvt *p;
@@ -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];
@@ -2434,7 +2434,7 @@
 	}
 }
 
-/*--- agent_devicestate: Part of PBX channel interface ---*/
+/*! \brief Part of PBX channel interface ---*/
 static int agent_devicestate(void *data)
 {
 	struct agent_pvt *p;

Modified: team/oej/astum/channels/chan_alsa.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/channels/chan_alsa.c?rev=8358&r1=8357&r2=8358&view=diff
==============================================================================
--- team/oej/astum/channels/chan_alsa.c (original)
+++ team/oej/astum/channels/chan_alsa.c Fri Jan 20 15:59:49 2006
@@ -68,8 +68,8 @@
 
 #define DEBUG 0
 /* Which device to use */
-#define ALSA_INDEV "default"
-#define ALSA_OUTDEV "default"
+#define ALSA_INDEV "hw:0,0"
+#define ALSA_OUTDEV "hw:0,0"
 #define DESIRED_RATE 8000
 
 /* Lets use 160 sample frames, just like GSM.  */

Modified: team/oej/astum/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/channels/chan_iax2.c?rev=8358&r1=8357&r2=8358&view=diff
==============================================================================
--- team/oej/astum/channels/chan_iax2.c (original)
+++ team/oej/astum/channels/chan_iax2.c Fri Jan 20 15:59:49 2006
@@ -1908,7 +1908,7 @@
 	return res;
 }
 
-/*--- iax2_show_peer: Show one peer in detail ---*/
+/*! \brief Show one peer in detail */
 static int iax2_show_peer(int fd, int argc, char *argv[])
 {
 	char status[30];
@@ -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;
@@ -3370,7 +3370,7 @@
 	return res;
 }
 
-/*--- ast_iax2_new: Create new call, interface with the PBX core */
+/*! \brief  Create new call, interface with the PBX core */
 static struct ast_channel *ast_iax2_new(int callno, int state, int capability)
 {
 	struct ast_channel *tmp;
@@ -4888,6 +4888,8 @@
 	fh.iseqno = 0;
 	fh.type = AST_FRAME_IAX;
 	fh.csub = compress_subclass(IAX_COMMAND_INVAL);
+	if (iaxdebug)
+		 iax_showframe(NULL, &fh, 0, sin, 0);
 #if 0
 	if (option_debug)
 #endif	
@@ -6753,6 +6755,10 @@
 					break;
 				if (ies.provverpres && ies.serviceident && sin.sin_addr.s_addr)
 					check_provisioning(&sin, fd, ies.serviceident, ies.provver);
+				/* If we're in trunk mode, do it now, and update the trunk number in our frame before continuing */
+				if (ast_test_flag(iaxs[fr.callno], IAX_TRUNK)) {
+					fr.callno = make_trunk(fr.callno, 1);
+				}
 				/* For security, always ack immediately */
 				if (delayreject)
 					send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
@@ -6762,10 +6768,6 @@
 					if (authdebug)
 						ast_log(LOG_NOTICE, "Rejected connect attempt from %s, who was trying to reach '%s@%s'\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr.callno]->exten, iaxs[fr.callno]->context);
 					break;
-				}
-				/* If we're in trunk mode, do it now, and update the trunk number in our frame before continuing */
-				if (ast_test_flag(iaxs[fr.callno], IAX_TRUNK)) {
-					fr.callno = make_trunk(fr.callno, 1);
 				}
 				/* This might re-enter the IAX code and need the lock */
 				if (strcasecmp(iaxs[fr.callno]->exten, "TBD")) {
@@ -7631,7 +7633,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;
@@ -7993,11 +7995,8 @@
 }
 
 
-/*--- check_src_ip: Check if address can be used as packet source.
- returns:
- 0  address available
- 1  address unavailable
--1  error
+/*! \brief Check if address can be used as packet source.
+ \return 0  address available, 1  address unavailable, -1  error
 */
 static int check_srcaddr(struct sockaddr *sa, socklen_t salen)
 {
@@ -8021,7 +8020,7 @@
 	return 0;
 }
 
-/*--- peer_set_srcaddr: Parse the "sourceaddress" value,
+/*! \brief Parse the "sourceaddress" value,
   lookup in netsock list and set peer's sockfd. Defaults to defaultsockfd if
   not found. */
 static int peer_set_srcaddr(struct iax2_peer *peer, const char *srcaddr)
@@ -8079,7 +8078,7 @@
 }
 
 		
-/*--- build_peer: Create peer structure based on configuration */
+/*! \brief Create peer structure based on configuration */
 static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, int temponly)
 {
 	struct iax2_peer *peer;
@@ -8270,7 +8269,7 @@
 	return peer;
 }
 
-/*--- build_user: Create in-memory user structure from configuration */
+/*! \brief Create in-memory user structure from configuration */
 static struct iax2_user *build_user(const char *name, struct ast_variable *v, int temponly)
 {
 	struct iax2_user *prev, *user;
@@ -8550,7 +8549,7 @@
 }
 
 
-/*--- set_config: Load configuration */
+/*! \brief Load configuration */
 static int set_config(char *config_file, int reload)
 {
 	struct ast_config *cfg;
@@ -9046,7 +9045,7 @@
 	return dp;	
 }
 
-/*--- iax2_exists: Part of the IAX2 switch interface ---*/
+/*! \brief Part of the IAX2 switch interface */
 static int iax2_exists(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data)
 {
 	struct iax2_dpcache *dp;
@@ -9069,7 +9068,7 @@
 	return res;
 }
 
-/*--- iax2_canmatch: part of the IAX2 dial plan switch interface */
+/*! \brief part of the IAX2 dial plan switch interface */
 static int iax2_canmatch(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data)
 {
 	int res = 0;
@@ -9092,7 +9091,7 @@
 	return res;
 }
 
-/*--- iax2_matchmore: Part of the IAX2 Switch interface */
+/*! \brief Part of the IAX2 Switch interface */
 static int iax2_matchmore(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data)
 {
 	int res = 0;
@@ -9115,7 +9114,7 @@
 	return res;
 }
 
-/*--- iax2_exec: Execute IAX2 dialplan switch */
+/*! \brief Execute IAX2 dialplan switch */
 static int iax2_exec(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, int newstack, const char *data)
 {
 	char odata[256];
@@ -9256,7 +9255,7 @@
 };
 
 
-/*--- iax2_devicestate: Part of the device state notification system ---*/
+/*! \brief Part of the device state notification system ---*/
 static int iax2_devicestate(void *data) 
 {
 	char *dest = (char *) data;
@@ -9498,7 +9497,7 @@
 }
 
 
-/*--- load_module: Load IAX2 module, load configuraiton ---*/
+/*! \brief Load IAX2 module, load configuraiton ---*/
 int load_module(void)
 {
 	char *config = "iax.conf";

Modified: team/oej/astum/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/channels/chan_local.c?rev=8358&r1=8357&r2=8358&view=diff
==============================================================================
--- team/oej/astum/channels/chan_local.c (original)
+++ team/oej/astum/channels/chan_local.c Fri Jan 20 15:59:49 2006
@@ -316,8 +316,8 @@
 	return res;
 }
 
-/*--- local_call: Initiate new call, part of PBX interface */
-/* 	dest is the dial string */
+/*! \brief Initiate new call, part of PBX interface 
+ * 	dest is the dial string */
 static int local_call(struct ast_channel *ast, char *dest, int timeout)
 {
 	struct local_pvt *p = ast->tech_pvt;
@@ -381,7 +381,7 @@
 }
 #endif
 
-/*--- local_hangup: Hangup a call through the local proxy channel */
+/*! \brief Hangup a call through the local proxy channel */
 static int local_hangup(struct ast_channel *ast)
 {
 	struct local_pvt *p = ast->tech_pvt;
@@ -452,7 +452,7 @@
 	return 0;
 }
 
-/*--- local_alloc: Create a call structure */
+/*! \brief Create a call structure */
 static struct local_pvt *local_alloc(char *data, int format)
 {
 	struct local_pvt *tmp;
@@ -495,7 +495,7 @@
 	return tmp;
 }
 
-/*--- local_new: Start new local channel */
+/*! \brief Start new local channel */
 static struct ast_channel *local_new(struct local_pvt *p, int state)
 {
 	struct ast_channel *tmp, *tmp2;
@@ -548,7 +548,7 @@
 }
 
 
-/*--- local_request: Part of PBX interface */
+/*! \brief Part of PBX interface */
 static struct ast_channel *local_request(const char *type, int format, void *data, int *cause)
 {
 	struct local_pvt *p;
@@ -560,7 +560,7 @@
 	return chan;
 }
 

[... 1298 lines stripped ...]


More information about the asterisk-commits mailing list