[asterisk-commits] branch russell/ast_malloc - r7653 in /team/russell/ast_malloc: ./ apps/ cdr/ ...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Dec 27 10:20:23 CST 2005


Author: russell
Date: Tue Dec 27 10:20:10 2005
New Revision: 7653

URL: http://svn.digium.com/view/asterisk?rev=7653&view=rev
Log:
Merged revisions 7633,7635-7636,7638-7640,7642-7643,7646-7649 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r7633 | tilghman | 2005-12-26 11:48:12 -0500 (Mon, 26 Dec 2005) | 2 lines

Bug 6057 - Deprecate builtins that have been replaced by functions

................
r7635 | russell | 2005-12-26 13:35:28 -0500 (Mon, 26 Dec 2005) | 10 lines

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

........
r7634 | russell | 2005-12-26 13:19:12 -0500 (Mon, 26 Dec 2005) | 2 lines

cast time_t to an int in printf/scanf (issue #5635)

........

................
r7636 | jdixon | 2005-12-26 15:01:35 -0500 (Mon, 26 Dec 2005) | 3 lines

Added support for Feature Group C CAMA trunks (both DP and MF), and support
for Feature Group D Tamdem trunks inbound (outbound was already there)

................
r7638 | tilghman | 2005-12-26 15:34:46 -0500 (Mon, 26 Dec 2005) | 3 lines

Merged revisions 7637 via svnmerge from
/branches/1.2

................
r7639 | russell | 2005-12-26 16:38:50 -0500 (Mon, 26 Dec 2005) | 5 lines

- normalize some loops
- simplify and reduce code by keeping track of return value
- replace some simple if/then sections with conditional expressions
(issue #6065)

................
r7640 | markster | 2005-12-26 18:56:44 -0500 (Mon, 26 Dec 2005) | 2 lines

Don't do DTMF detect on pseudo's!

................
r7642 | tilghman | 2005-12-26 21:02:23 -0500 (Mon, 26 Dec 2005) | 2 lines

Add SQL_ESC to allow single ticks to be escaped

................
r7643 | tilghman | 2005-12-26 21:05:56 -0500 (Mon, 26 Dec 2005) | 2 lines

Reduce warnings on signedness conversions

................
r7646 | tilghman | 2005-12-27 01:24:28 -0500 (Tue, 27 Dec 2005) | 2 lines

Bug 5183 - Inline stack backtraces

................
r7647 | tilghman | 2005-12-27 01:42:29 -0500 (Tue, 27 Dec 2005) | 2 lines

Bug 5854 - Allow quotation of the second field in extconfig, for the purpose of including commas (for LDAP configuration)

................
r7648 | tilghman | 2005-12-27 01:50:25 -0500 (Tue, 27 Dec 2005) | 2 lines

Bug 5906 - ARRAY dialplan function

................
r7649 | tilghman | 2005-12-27 02:13:37 -0500 (Tue, 27 Dec 2005) | 2 lines

Bug 5382 - Allow VM_CATEGORY in voicemail emails

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

Modified:
    team/russell/ast_malloc/   (props changed)
    team/russell/ast_malloc/Makefile
    team/russell/ast_malloc/UPGRADE.txt
    team/russell/ast_malloc/apps/app_chanspy.c
    team/russell/ast_malloc/apps/app_externalivr.c
    team/russell/ast_malloc/apps/app_queue.c
    team/russell/ast_malloc/apps/app_sms.c
    team/russell/ast_malloc/apps/app_voicemail.c
    team/russell/ast_malloc/asterisk.c
    team/russell/ast_malloc/cdr/cdr_tds.c
    team/russell/ast_malloc/channels/chan_agent.c
    team/russell/ast_malloc/channels/chan_iax2.c
    team/russell/ast_malloc/channels/chan_sip.c
    team/russell/ast_malloc/channels/chan_zap.c
    team/russell/ast_malloc/cli.c
    team/russell/ast_malloc/config.c
    team/russell/ast_malloc/configs/extconfig.conf.sample
    team/russell/ast_malloc/configs/func_odbc.conf.sample
    team/russell/ast_malloc/configs/zapata.conf.sample
    team/russell/ast_malloc/funcs/func_odbc.c
    team/russell/ast_malloc/funcs/func_strings.c
    team/russell/ast_malloc/include/asterisk/logger.h
    team/russell/ast_malloc/logger.c
    team/russell/ast_malloc/pbx.c
    team/russell/ast_malloc/pbx/pbx_dundi.c
    team/russell/ast_malloc/res/res_monitor.c

Propchange: team/russell/ast_malloc/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Dec 27 10:20:10 2005
@@ -1,1 +1,1 @@
-/trunk:1-7628
+/trunk:1-7652

Modified: team/russell/ast_malloc/Makefile
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/Makefile?rev=7653&r1=7652&r2=7653&view=diff
==============================================================================
--- team/russell/ast_malloc/Makefile (original)
+++ team/russell/ast_malloc/Makefile Tue Dec 27 10:20:10 2005
@@ -45,6 +45,11 @@
 
 #Tell gcc to optimize the code
 OPTIMIZE+=-O6
+else
+  # Stack backtraces, while useful for debugging, are incompatible with optimizations
+  ifeq (${OSARCH},Linux)
+    CFLAGS+=-DSTACK_BACKTRACES
+  endif
 endif
 
 #Overwite config files on "make samples"
@@ -332,7 +337,10 @@
 ASTCFLAGS+= $(MALLOC_DEBUG)
 ASTCFLAGS+= $(BUSYDETECT)
 ASTCFLAGS+= $(OPTIONS)
+ifneq ($(findstring dont-optimize,$(MAKECMDGOALS)),dont-optimize)
 ASTCFLAGS+= -fomit-frame-pointer 
+endif
+
 SUBDIRS=res channels pbx apps codecs formats agi cdr funcs utils stdtime
 
 OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o \

Modified: team/russell/ast_malloc/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/UPGRADE.txt?rev=7653&r1=7652&r2=7653&view=diff
==============================================================================
--- team/russell/ast_malloc/UPGRADE.txt (original)
+++ team/russell/ast_malloc/UPGRADE.txt Tue Dec 27 10:20:10 2005
@@ -8,3 +8,21 @@
   marked deprecated in Asterisk 1.2.  An option to disable it was provided with
   the default value set to 'on'.  The default value for the global priority
   jumping option is now 'off'.
+
+* The applications Cut, Sort, DBGet, DBPut, SetCIDNum, SetCIDName, SetRDNIS,
+  AbsoluteTimeout, DigitTimeout, ResponseTimeout, SetLanguage, GetGroupCount,
+  and GetGroupMatchCount were all deprecated in version 1.2, and therefore have
+  been removed in this version.  You should use the equivalent dialplan
+  function in places where you have previously used one of these applications.
+
+* The application SetVar has been renamed to Set.  The syntax SetVar was marked
+  deprecated in version 1.2 and is no longer recognized in this version.
+
+Variables:
+
+* The builtin variables ${CALLERID}, ${CALLERIDNAME}, ${CALLERIDNUM},
+  ${CALLERANI}, ${DNID}, ${RDNIS}, ${DATETIME}, ${TIMESTAMP}, ${ACCOUNTCODE},
+  and ${LANGUAGE} have all been deprecated in favor of their related dialplan
+  functions.  You are encouraged to move towards the associated dialplan
+  function, as these variables will be removed in a future release.
+

Modified: team/russell/ast_malloc/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/apps/app_chanspy.c?rev=7653&r1=7652&r2=7653&view=diff
==============================================================================
--- team/russell/ast_malloc/apps/app_chanspy.c (original)
+++ team/russell/ast_malloc/apps/app_chanspy.c Tue Dec 27 10:20:10 2005
@@ -439,7 +439,7 @@
 
 	if (recbase) {
 		char filename[512];
-		snprintf(filename,sizeof(filename),"%s/%s.%ld.raw",ast_config_AST_MONITOR_DIR, recbase, time(NULL));
+		snprintf(filename,sizeof(filename),"%s/%s.%d.raw",ast_config_AST_MONITOR_DIR, recbase, (int)time(NULL));
 		if ((fd = open(filename, O_CREAT | O_WRONLY, O_TRUNC)) <= 0) {
 			ast_log(LOG_WARNING, "Cannot open %s for recording\n", filename);
 			fd = 0;

Modified: team/russell/ast_malloc/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/apps/app_externalivr.c?rev=7653&r1=7652&r2=7653&view=diff
==============================================================================
--- team/russell/ast_malloc/apps/app_externalivr.c (original)
+++ team/russell/ast_malloc/apps/app_externalivr.c Tue Dec 27 10:20:10 2005
@@ -94,9 +94,9 @@
 	char tmp[256];
 
 	if (!data) {
-		snprintf(tmp, sizeof(tmp), "%c,%10ld", event, time(NULL));
+		snprintf(tmp, sizeof(tmp), "%c,%10d", event, (int)time(NULL));
 	} else {
-		snprintf(tmp, sizeof(tmp), "%c,%10ld,%s", event, time(NULL), data);
+		snprintf(tmp, sizeof(tmp), "%c,%10d,%s", event, (int)time(NULL), data);
 	}
 
 	fprintf(handle, "%s\n", tmp);

Modified: team/russell/ast_malloc/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/apps/app_queue.c?rev=7653&r1=7652&r2=7653&view=diff
==============================================================================
--- team/russell/ast_malloc/apps/app_queue.c (original)
+++ team/russell/ast_malloc/apps/app_queue.c Tue Dec 27 10:20:10 2005
@@ -484,11 +484,11 @@
 							"Membership: %s\r\n"
 							"Penalty: %d\r\n"
 							"CallsTaken: %d\r\n"
-							"LastCall: %ld\r\n"
+							"LastCall: %d\r\n"
 							"Status: %d\r\n"
 							"Paused: %d\r\n",
 						q->name, cur->interface, cur->dynamic ? "dynamic" : "static",
-						cur->penalty, cur->calls, cur->lastcall, cur->status, cur->paused);
+						cur->penalty, cur->calls, (int)cur->lastcall, cur->status, cur->paused);
 					}
 				}
 			}
@@ -1262,11 +1262,11 @@
 					"Membership: %s\r\n"
 					"Penalty: %d\r\n"
 					"CallsTaken: %d\r\n"
-					"LastCall: %ld\r\n"
+					"LastCall: %d\r\n"
 					"Status: %d\r\n"
 					"Paused: %d\r\n",
 				q->name, cur->interface, cur->dynamic ? "dynamic" : "static",
-				cur->penalty, cur->calls, cur->lastcall, cur->status, cur->paused);
+				cur->penalty, cur->calls, (int)cur->lastcall, cur->status, cur->paused);
 			}
 			break;
 		}
@@ -2421,11 +2421,11 @@
 						"Membership: %s\r\n"
 						"Penalty: %d\r\n"
 						"CallsTaken: %d\r\n"
-						"LastCall: %ld\r\n"
+						"LastCall: %d\r\n"
 						"Status: %d\r\n"
 						"Paused: %d\r\n",
 					q->name, new_member->interface, new_member->dynamic ? "dynamic" : "static",
-					new_member->penalty, new_member->calls, new_member->lastcall, new_member->status, new_member->paused);
+					new_member->penalty, new_member->calls, (int)new_member->lastcall, new_member->status, new_member->paused);
 					
 					if (dump)
 						dump_queue_members(q);
@@ -3435,13 +3435,13 @@
 						"Membership: %s\r\n"
 						"Penalty: %d\r\n"
 						"CallsTaken: %d\r\n"
-						"LastCall: %ld\r\n"
+						"LastCall: %d\r\n"
 						"Status: %d\r\n"
 						"Paused: %d\r\n"
 						"%s"
 						"\r\n",
 							q->name, mem->interface, mem->dynamic ? "dynamic" : "static",
-							mem->penalty, mem->calls, mem->lastcall, mem->status, mem->paused, idText);
+							mem->penalty, mem->calls, (int)mem->lastcall, mem->status, mem->paused, idText);
 				}
 			}
 			/* List Queue Entries */

Modified: team/russell/ast_malloc/apps/app_sms.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/apps/app_sms.c?rev=7653&r1=7652&r2=7653&view=diff
==============================================================================
--- team/russell/ast_malloc/apps/app_sms.c (original)
+++ team/russell/ast_malloc/apps/app_sms.c Tue Dec 27 10:20:10 2005
@@ -1379,8 +1379,8 @@
 		ast_copy_string (h.cli, chan->cid.cid_num, sizeof (h.cli));
 
 	{
-		char *d = data,
-			*p,
+		unsigned char *p;
+		unsigned char *d = data,
 			answer = 0;
 		if (!*d || *d == '|') {
 			ast_log (LOG_ERROR, "Requires queue name\n");
@@ -1393,11 +1393,11 @@
 			LOCAL_USER_REMOVE(u);
 			return -1;
 		}
-		strncpy (h.queue, d, p - d);
+		strncpy (h.queue, (char *)d, p - d);
 		if (*p == '|')
 			p++;
 		d = p;
-		for (p = h.queue; *p; p++)
+		for (p = (unsigned char *)h.queue; *p; p++)
 			if (!isalnum (*p))
 				*p = '-';			  /* make very safe for filenames */
 		while (*d && *d != '|') {
@@ -1429,27 +1429,27 @@
 		}
 		if (*d == '|') {
 			/* submitting a message, not taking call. */
-			/* depricated, use smsq instead */
+			/* deprecated, use smsq instead */
 			d++;
 			h.scts = time (0);
 			for (p = d; *p && *p != '|'; p++);
 			if (*p)
 				*p++ = 0;
-			if (strlen (d) >= sizeof (h.oa)) {
+			if (strlen ((char *)d) >= sizeof (h.oa)) {
 				ast_log (LOG_ERROR, "Address too long %s\n", d);
 				return 0;
 			}
 			if (h.smsc) {
-				ast_copy_string (h.oa, d, sizeof (h.oa));
+				ast_copy_string (h.oa, (char *)d, sizeof (h.oa));
 			} else {
-				ast_copy_string (h.da, d, sizeof (h.da));
+				ast_copy_string (h.da, (char *)d, sizeof (h.da));
 			}
 			if (!h.smsc)
 				ast_copy_string (h.oa, h.cli, sizeof (h.oa));
 			d = p;
 			h.udl = 0;
 			while (*p && h.udl < SMSLEN)
-				h.ud[h.udl++] = utf8decode((unsigned char **)&p);
+				h.ud[h.udl++] = utf8decode(&p);
 			if (is7bit (h.dcs) && packsms7 (0, h.udhl, h.udh, h.udl, h.ud) < 0)
 				ast_log (LOG_WARNING, "Invalid 7 bit GSM data\n");
 			if (is8bit (h.dcs) && packsms8 (0, h.udhl, h.udh, h.udl, h.ud) < 0)

Modified: team/russell/ast_malloc/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/apps/app_voicemail.c?rev=7653&r1=7652&r2=7653&view=diff
==============================================================================
--- team/russell/ast_malloc/apps/app_voicemail.c (original)
+++ team/russell/ast_malloc/apps/app_voicemail.c Tue Dec 27 10:20:10 2005
@@ -1587,7 +1587,7 @@
 	return 1;
 }
 
-static void prep_email_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, char *dur, char *date, char *passdata, size_t passdatasize)
+static void prep_email_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, char *dur, char *date, char *passdata, size_t passdatasize, const char *category)
 {
 	char callerid[256];
 	/* Prepare variables for substition in email body and subject */
@@ -1601,6 +1601,7 @@
 	pbx_builtin_setvar_helper(ast, "VM_CIDNAME", (cidname ? cidname : "an unknown caller"));
 	pbx_builtin_setvar_helper(ast, "VM_CIDNUM", (cidnum ? cidnum : "an unknown caller"));
 	pbx_builtin_setvar_helper(ast, "VM_DATE", date);
+	pbx_builtin_setvar_helper(ast, "VM_CATEGORY", category ? ast_strdupa(category) : "no category");
 }
 
 /*
@@ -1638,7 +1639,7 @@
 	return p;
 }
 
-static int sendmail(char *srcemail, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, char *attach, char *format, int duration, int attach_user_voicemail)
+static int sendmail(char *srcemail, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, char *attach, char *format, int duration, int attach_user_voicemail, const char *category)
 {
 	FILE *p=NULL;
 	char date[256];
@@ -1685,7 +1686,7 @@
 				int vmlen = strlen(fromstring)*3 + 200;
 				if ((passdata = alloca(vmlen))) {
 					memset(passdata, 0, vmlen);
-					prep_email_sub_vars(ast,vmu,msgnum + 1,context,mailbox,cidnum, cidname,dur,date,passdata, vmlen);
+					prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, cidnum, cidname, dur, date, passdata, vmlen, category);
 					pbx_substitute_variables_helper(ast,fromstring,passdata,vmlen);
 					fprintf(p, "From: %s <%s>\n",passdata,who);
 				} else ast_log(LOG_WARNING, "Cannot allocate workspace for variable substitution\n");
@@ -1702,7 +1703,7 @@
 				int vmlen = strlen(emailsubject)*3 + 200;
 				if ((passdata = alloca(vmlen))) {
 					memset(passdata, 0, vmlen);
-					prep_email_sub_vars(ast,vmu,msgnum + 1,context,mailbox,cidnum, cidname,dur,date,passdata, vmlen);
+					prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, cidnum, cidname, dur, date, passdata, vmlen, category);
 					pbx_substitute_variables_helper(ast,emailsubject,passdata,vmlen);
 					fprintf(p, "Subject: %s\n",passdata);
 				} else ast_log(LOG_WARNING, "Cannot allocate workspace for variable substitution\n");
@@ -1734,7 +1735,7 @@
 				int vmlen = strlen(emailbody)*3 + 200;
 				if ((passdata = alloca(vmlen))) {
 					memset(passdata, 0, vmlen);
-					prep_email_sub_vars(ast,vmu,msgnum + 1,context,mailbox,cidnum, cidname,dur,date,passdata, vmlen);
+					prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, cidnum, cidname, dur, date, passdata, vmlen, category);
 					pbx_substitute_variables_helper(ast,emailbody,passdata,vmlen);
 					fprintf(p, "%s\n",passdata);
 				} else ast_log(LOG_WARNING, "Cannot allocate workspace for variable substitution\n");
@@ -1771,7 +1772,7 @@
 	return 0;
 }
 
-static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, int duration, struct ast_vm_user *vmu)
+static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, int duration, struct ast_vm_user *vmu, const char *category)
 {
 	char date[256];
 	char host[MAXHOSTNAMELEN]="";
@@ -1803,7 +1804,7 @@
 				int vmlen = strlen(fromstring)*3 + 200;
 				if ((passdata = alloca(vmlen))) {
 					memset(passdata, 0, vmlen);
-					prep_email_sub_vars(ast,vmu,msgnum + 1,context,mailbox,cidnum, cidname,dur,date,passdata, vmlen);
+					prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, cidnum, cidname, dur, date, passdata, vmlen, category);
 					pbx_substitute_variables_helper(ast,pagerfromstring,passdata,vmlen);
 					fprintf(p, "From: %s <%s>\n",passdata,who);
 				} else 
@@ -1820,7 +1821,7 @@
                                int vmlen = strlen(pagersubject)*3 + 200;
                                if ((passdata = alloca(vmlen))) {
                                        memset(passdata, 0, vmlen);
-                                       prep_email_sub_vars(ast,vmu,msgnum + 1,context,mailbox,cidnum, cidname,dur,date,passdata, vmlen);
+                                       prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, cidnum, cidname, dur, date, passdata, vmlen, category);
                                        pbx_substitute_variables_helper(ast,pagersubject,passdata,vmlen);
                                        fprintf(p, "Subject: %s\n\n",passdata);
                                } else ast_log(LOG_WARNING, "Cannot allocate workspace for variable substitution\n");
@@ -1836,7 +1837,7 @@
                                int vmlen = strlen(pagerbody)*3 + 200;
                                if ((passdata = alloca(vmlen))) {
                                        memset(passdata, 0, vmlen);
-                                       prep_email_sub_vars(ast,vmu,msgnum + 1,context,mailbox,cidnum, cidname,dur,date,passdata, vmlen);
+                                       prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, cidnum, cidname, dur, date, passdata, vmlen, category);
                                        pbx_substitute_variables_helper(ast,pagerbody,passdata,vmlen);
                                        fprintf(p, "%s\n",passdata);
                                } else ast_log(LOG_WARNING, "Cannot allocate workspace for variable substitution\n");
@@ -3259,6 +3260,7 @@
 {
 	char todir[256], fn[256], ext_context[256], *stringp;
 	int newmsgs = 0, oldmsgs = 0;
+	const char *category = pbx_builtin_getvar_helper(chan, "VM_CATEGORY");
 
 	make_dir(todir, sizeof(todir), vmu->context, vmu->mailbox, "INBOX");
 	make_file(fn, sizeof(fn), todir, msgnum);
@@ -3276,14 +3278,14 @@
 			attach_user_voicemail = ast_test_flag(vmu, VM_ATTACH);
 			if (!ast_strlen_zero(vmu->serveremail))
 				myserveremail = vmu->serveremail;
-			sendmail(myserveremail, vmu, msgnum, vmu->context, vmu->mailbox, cidnum, cidname, fn, fmt, duration, attach_user_voicemail);
+			sendmail(myserveremail, vmu, msgnum, vmu->context, vmu->mailbox, cidnum, cidname, fn, fmt, duration, attach_user_voicemail, category);
 		}
 
 		if (!ast_strlen_zero(vmu->pager)) {
 			char *myserveremail = serveremail;
 			if (!ast_strlen_zero(vmu->serveremail))
 				myserveremail = vmu->serveremail;
-			sendpage(myserveremail, vmu->pager, msgnum, vmu->context, vmu->mailbox, cidnum, cidname, duration, vmu);
+			sendpage(myserveremail, vmu->pager, msgnum, vmu->context, vmu->mailbox, cidnum, cidname, duration, vmu, category);
 		}
 	} else {
 		ast_log(LOG_ERROR, "Out of memory\n");
@@ -3443,6 +3445,7 @@
 		leave_options.record_gain = record_gain;
 		cmd = leave_voicemail(chan, username, &leave_options);
 	} else {
+
 		/* Forward VoiceMail */
 		RETRIEVE(dir, curmsg);
 		cmd = vm_forwardoptions(chan, sender, dir, curmsg, vmfmts, context, record_gain);
@@ -3487,7 +3490,8 @@
 				/* load the information on the source message so we can send an e-mail like a new message */
 				snprintf(miffile, sizeof(miffile), "%s/msg%04d.txt", dir, curmsg);
 				if ((mif=ast_config_load(miffile))) {
-	
+					const char *category = ast_variable_retrieve(mif, NULL, "category");
+
 					/* set callerid and duration variables */
 					snprintf(callerid, sizeof(callerid), "FWD from: %s from %s", sender->fullname, ast_variable_retrieve(mif, NULL, "callerid"));
 					s = ast_variable_retrieve(mif, NULL, "duration");
@@ -3501,14 +3505,14 @@
 						attach_user_voicemail = ast_test_flag(vmtmp, VM_ATTACH);
 						if (!ast_strlen_zero(vmtmp->serveremail))
 							myserveremail = vmtmp->serveremail;
-						sendmail(myserveremail, vmtmp, todircount, vmtmp->context, vmtmp->mailbox, chan->cid.cid_num, chan->cid.cid_name, fn, tmp, duration, attach_user_voicemail);
+						sendmail(myserveremail, vmtmp, todircount, vmtmp->context, vmtmp->mailbox, chan->cid.cid_num, chan->cid.cid_name, fn, tmp, duration, attach_user_voicemail, category);
 					}
 
 					if (!ast_strlen_zero(vmtmp->pager)) {
 						char *myserveremail = serveremail;
 						if (!ast_strlen_zero(vmtmp->serveremail))
 							myserveremail = vmtmp->serveremail;
-						sendpage(myserveremail, vmtmp->pager, todircount, vmtmp->context, vmtmp->mailbox, chan->cid.cid_num, chan->cid.cid_name, duration, vmtmp);
+						sendpage(myserveremail, vmtmp->pager, todircount, vmtmp->context, vmtmp->mailbox, chan->cid.cid_num, chan->cid.cid_name, duration, vmtmp, category);
 					}
 				  
 					ast_config_destroy(mif); /* or here */

Modified: team/russell/ast_malloc/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/asterisk.c?rev=7653&r1=7652&r2=7653&view=diff
==============================================================================
--- team/russell/ast_malloc/asterisk.c (original)
+++ team/russell/ast_malloc/asterisk.c Tue Dec 27 10:20:10 2005
@@ -671,8 +671,10 @@
 		ast_log(LOG_WARNING, "Unable to change ownership of %s: %s\n", ast_config_AST_SOCKET, strerror(errno));
 
 	if (!ast_strlen_zero(ast_config_AST_CTL_PERMISSIONS)) {
+		int p1;
 		mode_t p;
-		sscanf(ast_config_AST_CTL_PERMISSIONS, "%o", (int *) &p);
+		sscanf(ast_config_AST_CTL_PERMISSIONS, "%o", &p1);
+		p = p1;
 		if ((chmod(ast_config_AST_SOCKET, p)) < 0)
 			ast_log(LOG_WARNING, "Unable to change file permissions of %s: %s\n", ast_config_AST_SOCKET, strerror(errno));
 	}
@@ -1319,7 +1321,7 @@
 			if (*t == '%') {
 				char hostname[MAXHOSTNAMELEN]="";
 				int i;
-				struct timeval tv;
+				time_t ts;
 				struct tm tm;
 #ifdef linux
 				FILE *LOADAVG;
@@ -1347,8 +1349,8 @@
 						break;
 					case 'd': /* date */
 						memset(&tm, 0, sizeof(struct tm));
-						tv = ast_tvnow();
-						if (localtime_r(&(tv.tv_sec), &tm)) {
+						time(&ts);
+						if (localtime_r(&ts, &tm)) {
 							strftime(p, sizeof(prompt) - strlen(prompt), "%Y-%m-%d", &tm);
 						}
 						break;
@@ -1404,8 +1406,8 @@
 #endif
 					case 't': /* time */
 						memset(&tm, 0, sizeof(struct tm));
-						tv = ast_tvnow();
-						if (localtime_r(&(tv.tv_sec), &tm)) {
+						time(&ts);
+						if (localtime_r(&ts, &tm)) {
 							strftime(p, sizeof(prompt) - strlen(prompt), "%H:%M:%S", &tm);
 						}
 						break;

Modified: team/russell/ast_malloc/cdr/cdr_tds.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/cdr/cdr_tds.c?rev=7653&r1=7652&r2=7653&view=diff
==============================================================================
--- team/russell/ast_malloc/cdr/cdr_tds.c (original)
+++ team/russell/ast_malloc/cdr/cdr_tds.c Tue Dec 27 10:20:10 2005
@@ -98,7 +98,6 @@
 static TDSLOGIN *login;
 static TDSCONTEXT *context;
 
-static char *stristr(const char*, const char*);
 static char *anti_injection(const char *, int);
 static void get_date(char *, struct timeval);
 
@@ -233,119 +232,6 @@
 	return res;
 }
 
-/* Return the offset of one string within another.
-   Copyright (C) 1994, 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-/*
- * My personal strstr() implementation that beats most other algorithms.
- * Until someone tells me otherwise, I assume that this is the
- * fastest implementation of strstr() in C.
- * I deliberately chose not to comment it.  You should have at least
- * as much fun trying to understand it, as I had to write it :-).
- *
- * Stephen R. van den Berg, berg at pool.informatik.rwth-aachen.de	*/
-
-static char *
-stristr (phaystack, pneedle)
-     const char *phaystack;
-     const char *pneedle;
-{
-  typedef unsigned chartype;
-
-  const unsigned char *haystack, *needle;
-  chartype b;
-  const unsigned char *rneedle;
-
-  haystack = (const unsigned char *) phaystack;
-
-  if ((b = toupper(*(needle = (const unsigned char *) pneedle))))
-    {
-      chartype c;
-      haystack--;		/* possible ANSI violation */
-
-      {
-	chartype a;
-	do
-	  if (!(a = toupper(*++haystack)))
-	    goto ret0;
-	while (a != b);
-      }
-
-      if (!(c = toupper(*++needle)))
-	goto foundneedle;
-      ++needle;
-      goto jin;
-
-      for (;;)
-	{
-	  {
-	    chartype a;
-	    if (0)
-	    jin:{
-		if ((a = toupper(*++haystack)) == c)
-		  goto crest;
-	      }
-	    else
-	      a = toupper(*++haystack);
-	    do
-	      {
-		for (; a != b; a = toupper(*++haystack))
-		  {
-		    if (!a)
-		      goto ret0;
-		    if ((a = toupper(*++haystack)) == b)
-		      break;
-		    if (!a)
-		      goto ret0;
-		  }
-	      }
-	    while ((a = toupper(*++haystack)) != c);
-	  }
-	crest:
-	  {
-	    chartype a;
-	    {
-	      const unsigned char *rhaystack;
-	      if (toupper(*(rhaystack = haystack-- + 1)) == (a = toupper(*(rneedle = needle))))
-		do
-		  {
-		    if (!a)
-		      goto foundneedle;
-		    if (toupper(*++rhaystack) != (a = toupper(*++needle)))
-		      break;
-		    if (!a)
-		      goto foundneedle;
-		  }
-		while (toupper(*++rhaystack) == (a = toupper(*++needle)));
-	      needle = rneedle;	/* took the register-poor aproach */
-	    }
-	    if (!a)
-	      break;
-	  }
-	}
-    }
-foundneedle:
-  return (char *) haystack;
-ret0:
-  return 0;
-}
-
 static char *anti_injection(const char *str, int len)
 {
 	/* Reference to http://www.nextgenss.com/papers/advanced_sql_injection.pdf */
@@ -376,7 +262,7 @@
 	/* Erase known bad input */
 	for (idx=0; *known_bad[idx]; idx++)
 	{
-		while((srh_ptr = stristr(buf, known_bad[idx]))) /* fix me! */
+		while((srh_ptr = strcasestr(buf, known_bad[idx])))
 		{
 			memmove(srh_ptr, srh_ptr+strlen(known_bad[idx]), strlen(srh_ptr+strlen(known_bad[idx]))+1);
 		}

Modified: team/russell/ast_malloc/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/channels/chan_agent.c?rev=7653&r1=7652&r2=7653&view=diff
==============================================================================
--- team/russell/ast_malloc/channels/chan_agent.c (original)
+++ team/russell/ast_malloc/channels/chan_agent.c Tue Dec 27 10:20:10 2005
@@ -1445,11 +1445,11 @@
 			"Name: %s\r\n"
 			"Status: %s\r\n"
 			"LoggedInChan: %s\r\n"
-			"LoggedInTime: %ld\r\n"
+			"LoggedInTime: %d\r\n"
 			"TalkingTo: %s\r\n"
 			"%s"
 			"\r\n",
-			p->agent, username, status, loginChan, p->loginstart, talkingtoChan, idText);
+			p->agent, username, status, loginChan, (int)p->loginstart, talkingtoChan, idText);
 		ast_mutex_unlock(&p->lock);
 		p = p->next;
 	}

Modified: team/russell/ast_malloc/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/channels/chan_iax2.c?rev=7653&r1=7652&r2=7653&view=diff
==============================================================================
--- team/russell/ast_malloc/channels/chan_iax2.c (original)
+++ team/russell/ast_malloc/channels/chan_iax2.c Tue Dec 27 10:20:10 2005
@@ -2599,7 +2599,7 @@
 				break;
 			} 
 		} else if (!strcasecmp(tmp->name, "regseconds")) {
-			if (sscanf(tmp->value, "%li", &regseconds) != 1)
+			if (sscanf(tmp->value, "%i", (int *)&regseconds) != 1)
 				regseconds = 0;
 		} else if (!strcasecmp(tmp->name, "ipaddr")) {
 			inet_aton(tmp->value, &(peer->addr.sin_addr));
@@ -2638,13 +2638,13 @@
 		if ((nowtime - regseconds) > IAX_DEFAULT_REG_EXPIRE) {
 			memset(&peer->addr, 0, sizeof(peer->addr));
 			if (option_debug)
-				ast_log(LOG_DEBUG, "realtime_peer: Bah, '%s' is expired (%ld/%ld/%ld)!\n",
-						peername, nowtime - regseconds, regseconds, nowtime);
+				ast_log(LOG_DEBUG, "realtime_peer: Bah, '%s' is expired (%d/%d/%d)!\n",
+						peername, (int)(nowtime - regseconds), (int)regseconds, (int)nowtime);
 		}
 		else {
 			if (option_debug)
-				ast_log(LOG_DEBUG, "realtime_peer: Registration for '%s' still active (%ld/%ld/%ld)!\n",
-						peername, nowtime - regseconds, regseconds, nowtime);
+				ast_log(LOG_DEBUG, "realtime_peer: Registration for '%s' still active (%d/%d/%d)!\n",
+						peername, (int)(nowtime - regseconds), (int)regseconds, (int)nowtime);
 		}
 	}
 
@@ -2700,7 +2700,7 @@
 	time_t nowtime;
 	
 	time(&nowtime);
-	snprintf(regseconds, sizeof(regseconds), "%ld", nowtime);
+	snprintf(regseconds, sizeof(regseconds), "%d", (int)nowtime);
 	ast_inet_ntoa(ipaddr, sizeof(ipaddr), sin->sin_addr);
 	snprintf(port, sizeof(port), "%d", ntohs(sin->sin_port));
 	ast_update_realtime("iaxpeers", "name", peername, "ipaddr", ipaddr, "port", port, "regseconds", regseconds, NULL);
@@ -4285,7 +4285,7 @@
 #if !defined(__FreeBSD__)
 #define FORMAT "%-15.15s  %-15d %-15d\n"
 #else /* __FreeBSD__ */
-#define FORMAT "%-15.15s  %-15d %-15ld\n"
+#define FORMAT "%-15.15s  %-15d %-15d\n" /* XXX 2.95 ? */
 #endif /* __FreeBSD__ */
 	struct iax_firmware *cur;
 	if ((argc != 3) && (argc != 4))
@@ -4296,7 +4296,7 @@
 	for (cur = waresl.wares;cur;cur = cur->next) {
 		if ((argc == 3) || (!strcasecmp(argv[3], (char *)cur->fwh->devname))) 
 			ast_cli(fd, FORMAT, cur->fwh->devname, ntohs(cur->fwh->version),
-				ntohl(cur->fwh->datalen));
+				(int)ntohl(cur->fwh->datalen));
 	}
 	ast_mutex_unlock(&waresl.lock);
 	return RESULT_SUCCESS;

Modified: team/russell/ast_malloc/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/channels/chan_sip.c?rev=7653&r1=7652&r2=7653&view=diff
==============================================================================
--- team/russell/ast_malloc/channels/chan_sip.c (original)
+++ team/russell/ast_malloc/channels/chan_sip.c Tue Dec 27 10:20:10 2005
@@ -1598,7 +1598,7 @@
 		time_t nowtime;
 		time(&nowtime);
 		nowtime += expirey;
-		snprintf(regseconds, sizeof(regseconds), "%ld", nowtime);	/* Expiration time */
+		snprintf(regseconds, sizeof(regseconds), "%d", (int)nowtime);	/* Expiration time */
 		ast_inet_ntoa(ipaddr, sizeof(ipaddr), sin->sin_addr);
 		snprintf(port, sizeof(port), "%d", ntohs(sin->sin_port));
 	}
@@ -12058,7 +12058,7 @@
 		}
 
 		if (realtime && !strcasecmp(v->name, "regseconds")) {
-			if (sscanf(v->value, "%li", &regseconds) != 1)
+			if (sscanf(v->value, "%i", (int *)&regseconds) != 1)
 				regseconds = 0;
 		} else if (realtime && !strcasecmp(v->name, "ipaddr") && !ast_strlen_zero(v->value) ) {
 			inet_aton(v->value, &(peer->addr.sin_addr));
@@ -12221,7 +12221,7 @@
 			destroy_association(peer);
 			memset(&peer->addr, 0, sizeof(peer->addr));
 			if (option_debug)
-				ast_log(LOG_DEBUG, "Bah, we're expired (%ld/%ld/%ld)!\n", nowtime - regseconds, regseconds, nowtime);
+				ast_log(LOG_DEBUG, "Bah, we're expired (%d/%d/%d)!\n", (int)(nowtime - regseconds), (int)regseconds, (int)nowtime);
 		}
 	}
 	ast_copy_flags(peer, &peerflags, mask.flags);

Modified: team/russell/ast_malloc/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/channels/chan_zap.c?rev=7653&r1=7652&r2=7653&view=diff
==============================================================================
--- team/russell/ast_malloc/channels/chan_zap.c (original)
+++ team/russell/ast_malloc/channels/chan_zap.c Tue Dec 27 10:20:10 2005
@@ -133,7 +133,7 @@
 #define AST_LAW(p) (((p)->law == ZT_LAW_ALAW) ? AST_FORMAT_ALAW : AST_FORMAT_ULAW)
 
 /*! \brief Signaling types that need to use MF detection should be placed in this macro */
-#define NEED_MFDETECT(p) (((p)->sig == SIG_FEATDMF) || ((p)->sig == SIG_FEATDMF_TA) || ((p)->sig == SIG_E911) || ((p)->sig == SIG_FEATB)) 
+#define NEED_MFDETECT(p) (((p)->sig == SIG_FEATDMF) || ((p)->sig == SIG_FEATDMF_TA) || ((p)->sig == SIG_E911) || ((p)->sig == SIG_FGC_CAMA) || ((p)->sig == SIG_FGC_CAMAMF) || ((p)->sig == SIG_FEATB)) 
 
 static const char desc[] = "Zapata Telephony"
 #ifdef ZAPATA_PRI
@@ -163,6 +163,8 @@
 #define	SIG_FEATB	(0x0800000 | ZT_SIG_EM)
 #define	SIG_E911	(0x1000000 | ZT_SIG_EM)
 #define	SIG_FEATDMF_TA	(0x2000000 | ZT_SIG_EM)
+#define	SIG_FGC_CAMA	(0x4000000 | ZT_SIG_EM)
+#define	SIG_FGC_CAMAMF	(0x8000000 | ZT_SIG_EM)
 #define SIG_FXSLS	ZT_SIG_FXSLS
 #define SIG_FXSGS	ZT_SIG_FXSGS
 #define SIG_FXSKS	ZT_SIG_FXSKS
@@ -1148,6 +1150,10 @@
 		return "Feature Group B (MF)";
 	case SIG_E911:
 		return "E911 (MF)";
+	case SIG_FGC_CAMA:
+		return "FGC/CAMA (Dialpulse)";
+	case SIG_FGC_CAMAMF:
+		return "FGC/CAMA (MF)";
 	case SIG_FXSLS:
 		return "FXS Loopstart";
 	case SIG_FXSGS:
@@ -1877,6 +1883,8 @@
 	case SIG_FEATD:
 	case SIG_FEATDMF:
 	case SIG_E911:
+	case SIG_FGC_CAMA:
+	case SIG_FGC_CAMAMF:
 	case SIG_FEATB:
 	case SIG_SFWINK:
 	case SIG_SF:
@@ -1954,6 +1962,10 @@
 		case SIG_E911:
 			ast_copy_string(p->dop.dialstr, "M*911#", sizeof(p->dop.dialstr));
 			break;
+		case SIG_FGC_CAMA:
+			snprintf(p->dop.dialstr, sizeof(p->dop.dialstr), "P%s", c);
+			break;
+		case SIG_FGC_CAMAMF:
 		case SIG_FEATB:
 			snprintf(p->dop.dialstr, sizeof(p->dop.dialstr), "M*%s#", c);
 			break;
@@ -2692,7 +2704,10 @@
 	case SIG_EMWINK:
 	case SIG_FEATD:
 	case SIG_FEATDMF:
+	case SIG_FEATDMF_TA:
 	case SIG_E911:
+	case SIG_FGC_CAMA:
+	case SIG_FGC_CAMAMF:
 	case SIG_FEATB:
 	case SIG_SF:
 	case SIG_SFWINK:
@@ -3006,6 +3021,9 @@
 #ifdef ZT_TONEDETECT
 	int val;
 #endif
+
+	if (p->channel == CHAN_PSEUDO)
+		return;
 
 	p->ignoredtmf = 0;
 
@@ -3632,7 +3650,7 @@
 					p->echobreak = 0;
 				} else {
 					p->dialing = 0;
-					if (p->sig == SIG_E911) {
+					if ((p->sig == SIG_E911) || (p->sig == SIG_FGC_CAMA) || (p->sig == SIG_FGC_CAMAMF)) {
 						/* if thru with dialing after offhook */
 						if (ast->_state == AST_STATE_DIALING_OFFHOOK) {
 							ast_setstate(ast, AST_STATE_UP);
@@ -3647,7 +3665,7 @@
 					if (ast->_state == AST_STATE_DIALING) {
 						if ((p->callprogress & 1) && CANPROGRESSDETECT(p) && p->dsp && p->outgoing) {
 							ast_log(LOG_DEBUG, "Done dialing, but waiting for progress detection before doing more...\n");
-						} else if (p->confirmanswer || (!p->dialednone && ((p->sig == SIG_EM) || (p->sig == SIG_EM_E1) ||  (p->sig == SIG_EMWINK) || (p->sig == SIG_FEATD) || (p->sig == SIG_FEATDMF) || (p->sig == SIG_E911) || (p->sig == SIG_FEATB) || (p->sig == SIG_SF) || (p->sig == SIG_SFWINK) || (p->sig == SIG_SF_FEATD) || (p->sig == SIG_SF_FEATDMF) || (p->sig == SIG_SF_FEATB)))) {
+						} else if (p->confirmanswer || (!p->dialednone && ((p->sig == SIG_EM) || (p->sig == SIG_EM_E1) ||  (p->sig == SIG_EMWINK) || (p->sig == SIG_FEATD) || (p->sig == SIG_FEATDMF_TA) || (p->sig == SIG_FEATDMF) || (p->sig == SIG_E911) || (p->sig == SIG_FGC_CAMA) || (p->sig == SIG_FGC_CAMAMF) || (p->sig == SIG_FEATB) || (p->sig == SIG_SF) || (p->sig == SIG_SFWINK) || (p->sig == SIG_SF_FEATD) || (p->sig == SIG_SF_FEATDMF) || (p->sig == SIG_SF_FEATB)))) {
 							ast_setstate(ast, AST_STATE_RINGING);
 						} else if (!p->answeronpolarityswitch) {
 							ast_setstate(ast, AST_STATE_UP);
@@ -3810,7 +3828,7 @@
 			}
 			/* for E911, its supposed to wait for offhook then dial
 			   the second half of the dial string */
-			if ((p->sig == SIG_E911) && (ast->_state == AST_STATE_DIALING_OFFHOOK)) {
+			if (((p->sig == SIG_E911) || (p->sig == SIG_FGC_CAMA) || (p->sig == SIG_FGC_CAMAMF)) && (ast->_state == AST_STATE_DIALING_OFFHOOK)) {
 				c = strchr(p->dialdest, '/');
 				if (c)
 					c++;
@@ -3924,6 +3942,8 @@
 			case SIG_FEATDMF:
 			case SIG_FEATDMF_TA:
 			case SIG_E911:
+			case SIG_FGC_CAMA:
+			case SIG_FGC_CAMAMF:
 			case SIG_FEATB:
 			case SIG_SF:
 			case SIG_SFWINK:
@@ -4177,6 +4197,8 @@
 				/* Fall through */
 			case SIG_FEATDMF:
 			case SIG_E911:
+			case SIG_FGC_CAMAMF:
+			case SIG_FGC_CAMA:
 			case SIG_FEATB:
 			case SIG_SF_FEATDMF:
 			case SIG_SF_FEATB:
@@ -4221,7 +4243,10 @@
 				p->dop.op = ZT_DIAL_OP_REPLACE;
 				break;
 			case SIG_FEATDMF:
+			case SIG_FEATDMF_TA:
 			case SIG_E911:
+			case SIG_FGC_CAMA:
+			case SIG_FGC_CAMAMF:
 			case SIG_FEATB:
 			case SIG_SF_FEATDMF:
 			case SIG_SF_FEATB:
@@ -5079,7 +5104,10 @@
 			if (i->dsp) {
 				ast_log(LOG_DEBUG, "Already have a dsp on %s?\n", tmp->name);
 			} else {
-				i->dsp = ast_dsp_new();
+				if (i->channel != CHAN_PSEUDO)
+					i->dsp = ast_dsp_new();
+				else
+					i->dsp = NULL;
 				if (i->dsp) {
 					i->dsp_features = features & ~DSP_PROGRESS_TALK;
 #ifdef ZAPATA_PRI
@@ -5304,7 +5332,9 @@
 #endif
 	case SIG_FEATD:
 	case SIG_FEATDMF:
+	case SIG_FEATDMF_TA:
 	case SIG_E911:
+	case SIG_FGC_CAMAMF:
 	case SIG_FEATB:
 	case SIG_EMWINK:
 	case SIG_SF_FEATD:
@@ -5317,6 +5347,7 @@
 	case SIG_EM:
 	case SIG_EM_E1:
 	case SIG_SF:
+	case SIG_FGC_CAMA:
 		res = tone_zone_play_tone(p->subs[index].zfd, -1);
 		if (p->dsp)
 			ast_dsp_digitreset(p->dsp);
@@ -5344,8 +5375,19 @@
 					res = my_getsigstr(chan, dtmfbuf + strlen(dtmfbuf), "*", 3000);
 				if ((res < 1) && (p->dsp)) ast_dsp_digitreset(p->dsp);
 				break;
+			case SIG_FEATDMF_TA:
+				res = my_getsigstr(chan, dtmfbuf + 1, "#", 3000);
+				if ((res < 1) && (p->dsp)) ast_dsp_digitreset(p->dsp);
+				if (zt_wink(p, index)) return NULL;
+				dtmfbuf[0] = 0;
+				/* Wait for the first digit (up to 5 seconds). */
+				res = ast_waitfordigit(chan, 5000);
+				if (res <= 0) break;
+				dtmfbuf[0] = res;
+				/* fall through intentionally */
 			case SIG_FEATDMF:
 			case SIG_E911:
+			case SIG_FGC_CAMAMF:
 			case SIG_SF_FEATDMF:
 				res = my_getsigstr(chan, dtmfbuf + 1, "#", 3000);
 				if (res > 0) {
@@ -5407,6 +5449,31 @@
 			ast_hangup(chan);
 			return NULL;
 		}
+
+		if (p->sig == SIG_FGC_CAMA)
+		{
+			char anibuf[100];
+
+			if (ast_safe_sleep(chan,1000) == -1)
+			{
+	                        ast_hangup(chan);
+	                        return NULL;
+			}
+                        zt_set_hook(p->subs[SUB_REAL].zfd, ZT_OFFHOOK);
+                        ast_dsp_digitmode(p->dsp,DSP_DIGITMODE_MF | p->dtmfrela\
+x);
+                        res = my_getsigstr(chan, anibuf, "#", 10000);
+                        if ((res > 0) && (strlen(anibuf) > 2))
+                          {
+                            if (anibuf[strlen(anibuf) - 1] == '#')
+                              anibuf[strlen(anibuf) - 1] = 0;
+                          ast_set_callerid(chan, anibuf + 2, NULL, anibuf + 2);
+                          printf("@@@@@ set ani to %s\n",anibuf + 2);
+                          }
+                        ast_dsp_digitmode(p->dsp,DSP_DIGITMODE_DTMF | p->dtmfre\
+lax);
+		}
+
 		ast_copy_string(exten, dtmfbuf, sizeof(exten));
 		if (ast_strlen_zero(exten))
 			ast_copy_string(exten, "s", sizeof(exten));
@@ -5430,7 +5497,7 @@

[... 843 lines stripped ...]


More information about the asterisk-commits mailing list