[svn-commits] murf: branch murf/bug8221-1.4 r51220 - in /team/murf/bug8221-1.4: ./ apps/ ch...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed Jan 17 23:23:43 MST 2007


Author: murf
Date: Thu Jan 18 00:23:43 2007
New Revision: 51220

URL: http://svn.digium.com/view/asterisk?view=rev&rev=51220
Log:
Merged revisions 51146,51148,51150,51159,51162,51165,51167,51170,51172,51176,51182,51186,51195,51198,51204-51205,51211,51213 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r51146 | qwell | 2007-01-16 10:36:53 -0700 (Tue, 16 Jan 2007) | 6 lines

Display more useful output when streaming files.

Include the channel name to which the file is being played.

Issue 8828, patch by junky.

................
r51148 | file | 2007-01-16 10:39:50 -0700 (Tue, 16 Jan 2007) | 10 lines

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

........
r51145 | file | 2007-01-16 12:36:50 -0500 (Tue, 16 Jan 2007) | 2 lines

Return previous behavior. ParkedCalls will be able to do DTMF based transfers again. trunk however will get an option to allow this to be set on/off. (issue #8804 reported by nortex)

........

................
r51150 | mogorman | 2007-01-16 10:46:12 -0700 (Tue, 16 Jan 2007) | 2 lines

minor things i missed before i get jumped on

................
r51159 | tilghman | 2007-01-16 14:28:39 -0700 (Tue, 16 Jan 2007) | 10 lines

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

........
r51158 | tilghman | 2007-01-16 15:26:06 -0600 (Tue, 16 Jan 2007) | 2 lines

Postgres driver doesn't like a NULL pointer when retrieving the length (Bug 8513)

........

................
r51162 | tilghman | 2007-01-16 14:51:15 -0700 (Tue, 16 Jan 2007) | 10 lines

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

........
r51161 | tilghman | 2007-01-16 15:50:04 -0600 (Tue, 16 Jan 2007) | 2 lines

Add documentation walkthrough on getting Postgres to work with voicemail (from Issue 8513)

........

................
r51165 | qwell | 2007-01-16 15:07:53 -0700 (Tue, 16 Jan 2007) | 2 lines

change documentation to reflect new procedure in 1.4/trunk

................
r51167 | qwell | 2007-01-16 15:50:19 -0700 (Tue, 16 Jan 2007) | 6 lines

Fix an issue with IMAP storage and realtime voicemail.

Also update the vmdb sql script for IMAP specific options.

Issue 8819, initial patches by bsmithurst (slightly modified by me)

................
r51170 | qwell | 2007-01-16 17:20:56 -0700 (Tue, 16 Jan 2007) | 4 lines

Fix issue with dtmf continuation packets when the dtmf digit is 0...

Issue 8831

................
r51172 | file | 2007-01-16 17:46:29 -0700 (Tue, 16 Jan 2007) | 2 lines

Move rescheduling of lagrq/pings into the scheduler callback.

................
r51176 | kpfleming | 2007-01-16 18:29:12 -0700 (Tue, 16 Jan 2007) | 2 lines

a few more coding style cleanups and one bug fix (from AnthonyL)

................
r51182 | file | 2007-01-16 23:36:41 -0700 (Tue, 16 Jan 2007) | 2 lines

Return the correct result when directly writing out a packet so that the core doesn't then decide to handle it the regular way again. (issue #8833 reported by rcourtna)

................
r51186 | qwell | 2007-01-17 10:36:53 -0700 (Wed, 17 Jan 2007) | 2 lines

re-add "password" for realtime voicemail

................
r51195 | tilghman | 2007-01-17 13:56:15 -0700 (Wed, 17 Jan 2007) | 12 lines

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

........
r51194 | tilghman | 2007-01-17 14:52:21 -0600 (Wed, 17 Jan 2007) | 4 lines

When ast_strip_quoted was called with a zero-length string, it would treat a
NULL as if it were the quoting character (and would thus return the string
in memory immediately following the passed-in string).

........

................
r51198 | russell | 2007-01-17 14:18:35 -0700 (Wed, 17 Jan 2007) | 11 lines

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

........
r51197 | russell | 2007-01-17 15:17:21 -0600 (Wed, 17 Jan 2007) | 3 lines

Move the check for a failure of ast_channel_alloc() to before locking the
pvt structure again.  Otherwise, on a failure, this will cause a deadlock.

........

................
r51204 | russell | 2007-01-17 15:09:52 -0700 (Wed, 17 Jan 2007) | 4 lines

Instead of dividing the offset by 2 directly, make it more clear that the
offset is being scaled by the size of the elements in the buffer.
(Inspired by a discussing on the asterisk-dev list about this code)

................
r51205 | russell | 2007-01-17 16:31:11 -0700 (Wed, 17 Jan 2007) | 5 lines

Fix some instances where when loading func_odbc, a double-free could occur.
Also, remove an unneeded error message.  If the failure condition is
actually a memory allocation failure, a log message will already be
generated automatically.

................
r51211 | file | 2007-01-17 17:18:44 -0700 (Wed, 17 Jan 2007) | 2 lines

Pass data as well for hold/unhold/vidupdate frames. (issue #8840 reported by mdu113)

................
r51213 | file | 2007-01-17 17:48:55 -0700 (Wed, 17 Jan 2007) | 2 lines

Build the IMAP remote directory string better and properly. Fix an issue with encoding the GSM voicemail when attaching to the voicemail. (issue #8808 reported by akohlsmith)

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

Added:
    team/murf/bug8221-1.4/doc/voicemail_odbc_postgresql.txt
      - copied unchanged from r51213, branches/1.4/doc/voicemail_odbc_postgresql.txt
Modified:
    team/murf/bug8221-1.4/   (props changed)
    team/murf/bug8221-1.4/apps/app_voicemail.c
    team/murf/bug8221-1.4/channels/chan_iax2.c
    team/murf/bug8221-1.4/channels/chan_sip.c
    team/murf/bug8221-1.4/channels/chan_zap.c
    team/murf/bug8221-1.4/contrib/scripts/vmdb.sql
    team/murf/bug8221-1.4/funcs/func_odbc.c
    team/murf/bug8221-1.4/main/file.c
    team/murf/bug8221-1.4/main/rtp.c
    team/murf/bug8221-1.4/main/utils.c
    team/murf/bug8221-1.4/res/res_features.c

Propchange: team/murf/bug8221-1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/murf/bug8221-1.4/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jan 18 00:23:43 2007
@@ -1,1 +1,1 @@
-/branches/1.4:1-51094
+/branches/1.4:1-51219

Modified: team/murf/bug8221-1.4/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221-1.4/apps/app_voicemail.c?view=diff&rev=51220&r1=51219&r2=51220
==============================================================================
--- team/murf/bug8221-1.4/apps/app_voicemail.c (original)
+++ team/murf/bug8221-1.4/apps/app_voicemail.c Thu Jan 18 00:23:43 2007
@@ -657,12 +657,11 @@
 	struct ast_variable *tmp;
 	tmp = var;
 	while (tmp) {
-		if (!strcasecmp(tmp->name, "password") || !strcasecmp(tmp->name, "secret")) {
+		if (!strcasecmp(tmp->name, "vmpassword")) {
 			ast_copy_string(retval->password, tmp->value, sizeof(retval->password));
-		} else if  (!strcasecmp(tmp->name, "secret")) {
-			/* dont let secret override vmpassword */
-			if ((strlen(retval->password) == 0))
-				ast_copy_string(retval->password, tmp->value, sizeof(retval->password));	
+		} else if (!strcasecmp(tmp->name, "secret") || !strcasecmp(tmp->name, "password")) { /* don't overwrite vmpassword if it exists */
+			if (ast_strlen_zero(retval->password))
+				ast_copy_string(retval->password, tmp->value, sizeof(retval->password));
 		} else if (!strcasecmp(tmp->name, "uniqueid")) {
 			ast_copy_string(retval->uniqueid, tmp->value, sizeof(retval->uniqueid));
 		} else if (!strcasecmp(tmp->name, "pager")) {
@@ -673,6 +672,12 @@
 			ast_copy_string(retval->fullname, tmp->value, sizeof(retval->fullname));
 		} else if (!strcasecmp(tmp->name, "context")) {
 			ast_copy_string(retval->context, tmp->value, sizeof(retval->context));
+#ifdef IMAP_STORAGE
+		} else if (!strcasecmp(tmp->name, "imapuser")) {
+			ast_copy_string(retval->imapuser, tmp->value, sizeof(retval->imapuser));
+		} else if (!strcasecmp(tmp->name, "imappassword")) {
+			ast_copy_string(retval->imappassword, tmp->value, sizeof(retval->imappassword));
+#endif
 		} else
 			apply_option(retval, tmp->name, tmp->value);
 		tmp = tmp->next;
@@ -762,7 +767,6 @@
 	struct ast_category *cat=NULL;
 	char *category=NULL, *value=NULL, *new=NULL;
 	const char *tmp=NULL;
-	int len;
 					
 	if (!change_password_realtime(vmu, newpassword))
 		return;
@@ -781,14 +785,8 @@
 					ast_log(LOG_WARNING, "variable has bad format.\n");
 					break;
 				}
-				len  = (strlen(value) + strlen(newpassword));
-				
-				if (!(new = ast_calloc(1,len))) {
-					ast_log(LOG_WARNING, "Memory Allocation Failed.\n");
-					break;
-				}
+				new = alloca((strlen(value)+strlen(newpassword)+1));
 				sprintf(new,"%s%s", newpassword, value);
-	
 				if (!(cat = ast_category_get(cfg, category))) {
 					ast_log(LOG_WARNING, "Failed to get category structure.\n");
 					break;
@@ -800,29 +798,29 @@
 		reset_user_pw(vmu->context, vmu->mailbox, newpassword);
 		ast_copy_string(vmu->password, newpassword, sizeof(vmu->password));
 		config_text_file_save(VOICEMAIL_CONFIG, cfg, "AppVoicemail");
-		if (new)
-			free(new);
 	}
 	category = NULL;
 	var = NULL;
 	/* check users.conf and update the password stored for the mailbox*/
 	/* if no vmpassword entry exists create one. */
 	if ((cfg = ast_config_load_with_comments("users.conf"))) {
-		ast_log(LOG_WARNING, "we are looking for %s\n", vmu->mailbox);
+		if (option_debug > 3)
+			ast_log(LOG_DEBUG, "we are looking for %s\n", vmu->mailbox);
 		while ((category = ast_category_browse(cfg, category))) {
-			ast_log(LOG_WARNING, "users.conf: %s\n", category);
+			if (option_debug > 3)
+				ast_log(LOG_DEBUG, "users.conf: %s\n", category);
 			if (!strcasecmp(category, vmu->mailbox)) {
 				if (!(tmp = ast_variable_retrieve(cfg, category, "vmpassword"))) {
-					ast_log(LOG_WARNING, "looks like we need to make vmpassword!\n");
+					if (option_debug > 3)
+						ast_log(LOG_DEBUG, "looks like we need to make vmpassword!\n");
 					var = ast_variable_new("vmpassword", newpassword);
 				} 
-				if (!(new = ast_calloc(1,strlen(newpassword)))) {
-					ast_log(LOG_WARNING, "Memory Allocation Failed.\n");
-					break;
-				} 
+				new = alloca(strlen(newpassword)+1);
 				sprintf(new, "%s", newpassword);
 				if (!(cat = ast_category_get(cfg, category))) {
-					ast_log(LOG_WARNING, "failed to get category!\n");
+					if (option_debug > 3)
+						ast_log(LOG_DEBUG, "failed to get category!\n");
+					break;
 				}
 				if (!var)		
 					ast_variable_update(cat, "vmpassword", new, NULL);
@@ -834,10 +832,7 @@
 		reset_user_pw(vmu->context, vmu->mailbox, newpassword);	
 		ast_copy_string(vmu->password, newpassword, sizeof(vmu->password));
 		config_text_file_save("users.conf", cfg, "AppVoicemail");
-		if (new) 
-			free(new);
-	}
-
+	}
 }
 
 static void vm_change_password_shell(struct ast_vm_user *vmu, char *newpassword)
@@ -1052,7 +1047,7 @@
 			}
 			if (!strcasecmp(coltitle, "recording")) {
 				off_t offset;
-				res = SQLGetData(stmt, x + 1, SQL_BINARY, NULL, 0, &colsize2);
+				res = SQLGetData(stmt, x + 1, SQL_BINARY, rowdata, 0, &colsize2);
 				fdlen = colsize2;
 				if (fd > -1) {
 					char tmp[1]="";
@@ -1064,15 +1059,14 @@
 					}
 					/* Read out in small chunks */
 					for (offset = 0; offset < colsize2; offset += CHUNKSIZE) {
-						/* +1 because SQLGetData likes null-terminating binary data */
-						if ((fdm = mmap(NULL, CHUNKSIZE + 1, PROT_READ | PROT_WRITE, MAP_SHARED, fd, offset)) == (void *)-1) {
+						if ((fdm = mmap(NULL, CHUNKSIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, offset)) == (void *)-1) {
 							ast_log(LOG_WARNING, "Could not mmap the output file: %s (%d)\n", strerror(errno), errno);
 							SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 							ast_odbc_release_obj(obj);
 							goto yuck;
 						} else {
-							res = SQLGetData(stmt, x + 1, SQL_BINARY, fdm, CHUNKSIZE + 1, NULL);
-							munmap(fdm, 0);
+							res = SQLGetData(stmt, x + 1, SQL_BINARY, fdm, CHUNKSIZE, NULL);
+							munmap(fdm, CHUNKSIZE);
 							if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 								ast_log(LOG_WARNING, "SQL Get Data error!\n[%s]\n\n", sql);
 								unlink(full_fn);
@@ -1977,7 +1971,7 @@
 		snprintf(fname, sizeof(fname), "%s.%s", attach, format);
 		base_encode(fname, p);
 		/* only attach if necessary */
-		if (imap && strcmp(format, "gsm")) {
+		if (imap && !strcmp(format, "gsm")) {
 			fprintf(p, "--%s\r\n", bound);
 			fprintf(p, "Content-Type: audio/x-gsm; name=\"msg%04d.%s\"\r\n", msgnum, format);
 			fprintf(p, "Content-Transfer-Encoding: base64\r\n");
@@ -4575,8 +4569,9 @@
 #ifdef IMAP_STORAGE
 static void imap_mailbox_name(char *spec, struct vm_state *vms, int box, int use_folder)
 {
-	char tmp[256];
-	
+	char tmp[256], *t = tmp;
+	size_t left = sizeof(tmp);
+
 	if (box == 1) {
 		ast_copy_string(vms->curbox, mbox(0), sizeof(vms->curbox));
 		sprintf(vms->vmbox, "vm-%s", mbox(1));
@@ -4585,11 +4580,20 @@
 		snprintf(vms->vmbox, sizeof(vms->vmbox), "vm-%s", vms->curbox);
 	}
 
-	if (strlen(authuser) > 0) {
-		snprintf(tmp, sizeof(tmp), "{%s:%s/imap/authuser=%s/%s/user=%s}",imapserver,imapport,authuser,imapflags,vms->imapuser);
-	} else {
-		snprintf(tmp, sizeof(tmp), "{%s:%s/imap/%s/user=%s}",imapserver,imapport,imapflags,vms->imapuser);
-	}
+	/* Build up server information */
+	ast_build_string(&t, &left, "{%s:%s/imap", imapserver, imapport);
+
+	/* Add authentication user if present */
+	if (!ast_strlen_zero(authuser))
+		ast_build_string(&t, &left, "/%s", authuser);
+
+	/* Add flags if present */
+	if (!ast_strlen_zero(imapflags))
+		ast_build_string(&t, &left, "/%s", imapflags);
+
+	/* End with username */
+	ast_build_string(&t, &left, "/user=%s}", vms->imapuser);
+
 	if(box == 0 || box == 1)
 		sprintf(spec, "%s%s", tmp, use_folder? imapfolder: "INBOX");
 	else
@@ -8240,6 +8244,28 @@
 }
 #endif
 
+static struct ast_vm_user *find_user_realtime_imapuser(const char *imapuser)
+{
+	struct ast_variable *var;
+	struct ast_vm_user *vmu;
+
+	vmu = ast_calloc(1, sizeof *vmu);
+	if (!vmu)
+		return NULL;
+	ast_set_flag(vmu, VM_ALLOCED);
+	populate_defaults(vmu);
+
+	var = ast_load_realtime("voicemail", "imapuser", imapuser, NULL);
+	if (var) {
+		apply_options_full(vmu, var);
+		ast_variables_destroy(var);
+		return vmu;
+	} else {
+		free(vmu);
+		return NULL;
+	}
+}
+
 /* Interfaces to C-client */
 
 void mm_exists(MAILSTREAM * stream, unsigned long number)
@@ -8373,6 +8399,12 @@
 			if(!strcasecmp(mb->user, vmu->imapuser)) {
 				ast_copy_string(pwd, vmu->imappassword, MAILTMPLEN);
 				break;
+			}
+		}
+		if (!vmu) {
+			if ((vmu = find_user_realtime_imapuser(mb->user))) {
+				ast_copy_string(pwd, vmu->imappassword, MAILTMPLEN);
+				free_user(vmu);
 			}
 		}
 	}

Modified: team/murf/bug8221-1.4/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221-1.4/channels/chan_iax2.c?view=diff&rev=51220&r1=51219&r2=51220
==============================================================================
--- team/murf/bug8221-1.4/channels/chan_iax2.c (original)
+++ team/murf/bug8221-1.4/channels/chan_iax2.c Thu Jan 18 00:23:43 2007
@@ -908,26 +908,25 @@
 #define schedule_action(func, data) __schedule_action(func, data, __PRETTY_FUNCTION__)
 #endif
 
+static int send_ping(void *data);
+
 static void __send_ping(void *data)
 {
 	int callno = (long)data;
 	ast_mutex_lock(&iaxsl[callno]);
-	if (iaxs[callno])
+	if (iaxs[callno] && iaxs[callno]->pingid != -1) {
 		send_command(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_PING, 0, NULL, 0, -1);
+		iaxs[callno]->pingid = ast_sched_add(sched, ping_time * 1000, send_ping, data);
+	}
 	ast_mutex_unlock(&iaxsl[callno]);
 }
 
 static int send_ping(void *data)
 {
-	int callno = (long)data;
-	if (iaxs[callno]) {
 #ifdef SCHED_MULTITHREADED
-		if (schedule_action(__send_ping, data))
+	if (schedule_action(__send_ping, data))
 #endif		
-			__send_ping(data);
-		return 1;
-	} else
-		return 0;
+		__send_ping(data);
 	return 0;
 }
 
@@ -943,27 +942,26 @@
 	return e;
 }
 
+static int send_lagrq(void *data);
+
 static void __send_lagrq(void *data)
 {
 	int callno = (long)data;
 	/* Ping only if it's real not if it's bridged */
 	ast_mutex_lock(&iaxsl[callno]);
-	if (iaxs[callno])
+	if (iaxs[callno] && iaxs[callno]->lagid != -1) {
 		send_command(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_LAGRQ, 0, NULL, 0, -1);
+		iaxs[callno]->lagid = ast_sched_add(sched, lagrq_time * 1000, send_lagrq, data);
+	}
 	ast_mutex_unlock(&iaxsl[callno]);
 }
 
 static int send_lagrq(void *data)
 {
-	int callno = (long)data;
-	if (iaxs[callno]) {
 #ifdef SCHED_MULTITHREADED
-		if (schedule_action(__send_lagrq, data))
+	if (schedule_action(__send_lagrq, data))
 #endif		
-			__send_lagrq(data);
-		return 1;
-	} else
-		return 0;
+		__send_lagrq(data);
 	return 0;
 }
 

Modified: team/murf/bug8221-1.4/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221-1.4/channels/chan_sip.c?view=diff&rev=51220&r1=51219&r2=51220
==============================================================================
--- team/murf/bug8221-1.4/channels/chan_sip.c (original)
+++ team/murf/bug8221-1.4/channels/chan_sip.c Thu Jan 18 00:23:43 2007
@@ -3735,11 +3735,11 @@
 		tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, "SIP/%s-%08x", my_name, (int)(long) i);
 
 	}
-	ast_mutex_lock(&i->lock);
 	if (!tmp) {
 		ast_log(LOG_WARNING, "Unable to allocate AST channel structure for SIP channel\n");
 		return NULL;
 	}
+	ast_mutex_lock(&i->lock);
 	tmp->tech = &sip_tech;
 
 	/* Select our native format based on codec preference until we receive

Modified: team/murf/bug8221-1.4/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221-1.4/channels/chan_zap.c?view=diff&rev=51220&r1=51219&r2=51220
==============================================================================
--- team/murf/bug8221-1.4/channels/chan_zap.c (original)
+++ team/murf/bug8221-1.4/channels/chan_zap.c Thu Jan 18 00:23:43 2007
@@ -4774,7 +4774,7 @@
 	p->subs[index].f.samples = READ_SIZE;
 	p->subs[index].f.mallocd = 0;
 	p->subs[index].f.offset = AST_FRIENDLY_OFFSET;
-	p->subs[index].f.data = p->subs[index].buffer + AST_FRIENDLY_OFFSET/2;
+	p->subs[index].f.data = p->subs[index].buffer + AST_FRIENDLY_OFFSET / sizeof(p->subs[index].buffer[0]);
 #if 0
 	ast_log(LOG_DEBUG, "Read %d of voice on %s\n", p->subs[index].f.datalen, ast->name);
 #endif	

Modified: team/murf/bug8221-1.4/contrib/scripts/vmdb.sql
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221-1.4/contrib/scripts/vmdb.sql?view=diff&rev=51220&r1=51219&r2=51220
==============================================================================
--- team/murf/bug8221-1.4/contrib/scripts/vmdb.sql (original)
+++ team/murf/bug8221-1.4/contrib/scripts/vmdb.sql Thu Jan 18 00:23:43 2007
@@ -7,5 +7,7 @@
 email VARCHAR(80) NOT NULL DEFAULT '',
 pager VARCHAR(80) NOT NULL DEFAULT '',
 options VARCHAR(160) NOT NULL DEFAULT '',
+imapuser VARCHAR(80) DEFAULT NULL,
+imappassword VARCHAR(80) DEFAULT NULL,
 PRIMARY KEY (context, mailbox)
 );

Modified: team/murf/bug8221-1.4/funcs/func_odbc.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221-1.4/funcs/func_odbc.c?view=diff&rev=51220&r1=51219&r2=51220
==============================================================================
--- team/murf/bug8221-1.4/funcs/func_odbc.c (original)
+++ team/murf/bug8221-1.4/funcs/func_odbc.c Thu Jan 18 00:23:43 2007
@@ -363,6 +363,8 @@
 	if ((tmp = ast_variable_retrieve(cfg, catg, "dsn"))) {
 		ast_copy_string((*query)->dsn, tmp, sizeof((*query)->dsn));
 	} else {
+		free(*query);
+		*query = NULL;
 		return -1;
 	}
 
@@ -384,6 +386,7 @@
 	(*query)->acf = ast_calloc(1, sizeof(struct ast_custom_function));
 	if (! (*query)->acf) {
 		free(*query);
+		*query = NULL;
 		return -1;
 	}
 
@@ -396,6 +399,7 @@
 	if (!((*query)->acf->name)) {
 		free((*query)->acf);
 		free(*query);
+		*query = NULL;
 		return -1;
 	}
 
@@ -405,6 +409,7 @@
 		free((char *)(*query)->acf->name);
 		free((*query)->acf);
 		free(*query);
+		*query = NULL;
 		return -1;
 	}
 
@@ -440,6 +445,7 @@
 		free((char *)(*query)->acf->name);
 		free((*query)->acf);
 		free(*query);
+		*query = NULL;
 		return -1;
 	}
 
@@ -496,7 +502,6 @@
 		struct acf_odbc_query *query = NULL;
 
 		if (init_acf_query(cfg, catg, &query)) {
-			ast_log(LOG_ERROR, "Out of memory\n");
 			free_acf_query(query);
 		} else {
 			AST_LIST_INSERT_HEAD(&queries, query, list);

Modified: team/murf/bug8221-1.4/main/file.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221-1.4/main/file.c?view=diff&rev=51220&r1=51219&r2=51220
==============================================================================
--- team/murf/bug8221-1.4/main/file.c (original)
+++ team/murf/bug8221-1.4/main/file.c Thu Jan 18 00:23:43 2007
@@ -796,10 +796,9 @@
 			return -1;
 		if (vfs && ast_playstream(vfs))
 			return -1;
-#if 1
 		if (option_verbose > 2)
-			ast_verbose(VERBOSE_PREFIX_3 "Playing '%s' (language '%s')\n", filename, preflang ? preflang : "default");
-#endif
+			ast_verbose(VERBOSE_PREFIX_3 "<%s> Playing '%s' (language '%s')\n", chan->name, filename, preflang ? preflang : "default");
+
 		return 0;
 	}
 	ast_log(LOG_WARNING, "Unable to open %s (format %s): %s\n", filename, ast_getformatname_multiple(fmt, sizeof(fmt), chan->nativeformats), strerror(errno));

Modified: team/murf/bug8221-1.4/main/rtp.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221-1.4/main/rtp.c?view=diff&rev=51220&r1=51219&r2=51220
==============================================================================
--- team/murf/bug8221-1.4/main/rtp.c (original)
+++ team/murf/bug8221-1.4/main/rtp.c Thu Jan 18 00:23:43 2007
@@ -143,7 +143,8 @@
 	unsigned int dtmfduration;
 	/* DTMF Transmission Variables */
 	unsigned int lastdigitts;
-	char send_digit;
+	char sending_digit;	/* boolean - are we sending digits */
+	char send_digit;	/* digit we are sending */
 	int send_payload;
 	int send_duration;
 	int nat;
@@ -1064,11 +1065,11 @@
 				ast_log(LOG_DEBUG, "RTP NAT: Can't write RTP to private address %s:%d, waiting for other end to send audio...\n", ast_inet_ntoa(bridged->them.sin_addr), ntohs(bridged->them.sin_port));
 			ast_set_flag(bridged, FLAG_NAT_INACTIVE_NOWARN);
 		}
-		return -1;
+		return 0;
 	} else if (rtp_debug_test_addr(&bridged->them))
 			ast_verbose("Sent RTP P2P packet to %s:%d (type %-2.2d, len %-6.6u)\n", ast_inet_ntoa(bridged->them.sin_addr), ntohs(bridged->them.sin_port), bridged_payload, len - hdrlen);
 
-	return -1;
+	return 0;
 }
 
 struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
@@ -1091,7 +1092,7 @@
 	struct ast_rtp *bridged = NULL;
 	
 	/* If time is up, kill it */
-	if (rtp->send_digit)
+	if (rtp->sending_digit)
 		ast_rtp_senddigit_continuation(rtp);
 
 	len = sizeof(sin);
@@ -2138,6 +2139,7 @@
 	}
 
 	/* Since we received a begin, we can safely store the digit and disable any compensation */
+	rtp->sending_digit = 1;
 	rtp->send_digit = digit;
 	rtp->send_payload = payload;
 
@@ -2229,6 +2231,7 @@
 				    ast_inet_ntoa(rtp->them.sin_addr),
 				    ntohs(rtp->them.sin_port), rtp->send_payload, rtp->seqno, rtp->lastdigitts, res - hdrlen);
 	}
+	rtp->sending_digit = 0;
 	rtp->send_digit = 0;
 	/* Increment lastdigitts */
 	rtp->lastdigitts += 960;
@@ -2861,7 +2864,7 @@
 			if ((fr->subclass == AST_CONTROL_HOLD) ||
 			    (fr->subclass == AST_CONTROL_UNHOLD) ||
 			    (fr->subclass == AST_CONTROL_VIDUPDATE)) {
-				ast_indicate(other, fr->subclass);
+				ast_indicate_data(other, fr->subclass, fr->data, fr->datalen);
 				ast_frfree(fr);
 			} else {
 				*fo = fr;
@@ -3069,7 +3072,7 @@
 					p0_callback = p2p_callback_enable(c0, p0, &p0_fds[0], &p0_iod[0]);
 					p1_callback = p2p_callback_enable(c1, p1, &p1_fds[0], &p1_iod[0]);
 				}
-				ast_indicate(other, fr->subclass);
+				ast_indicate_data(other, fr->subclass, fr->data, fr->datalen);
 				ast_frfree(fr);
 			} else {
 				*fo = fr;

Modified: team/murf/bug8221-1.4/main/utils.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221-1.4/main/utils.c?view=diff&rev=51220&r1=51219&r2=51220
==============================================================================
--- team/murf/bug8221-1.4/main/utils.c (original)
+++ team/murf/bug8221-1.4/main/utils.c Thu Jan 18 00:23:43 2007
@@ -638,7 +638,7 @@
 	char *q;
 
 	s = ast_strip(s);
-	if ((q = strchr(beg_quotes, *s))) {
+	if ((q = strchr(beg_quotes, *s)) && *q != '\0') {
 		e = s + strlen(s) - 1;
 		if (*e == *(end_quotes + (q - beg_quotes))) {
 			s++;

Modified: team/murf/bug8221-1.4/res/res_features.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221-1.4/res/res_features.c?view=diff&rev=51220&r1=51219&r2=51220
==============================================================================
--- team/murf/bug8221-1.4/res/res_features.c (original)
+++ team/murf/bug8221-1.4/res/res_features.c Thu Jan 18 00:23:43 2007
@@ -2023,6 +2023,8 @@
 		}
 #endif
 		memset(&config, 0, sizeof(struct ast_bridge_config));
+		ast_set_flag(&(config.features_callee), AST_FEATURE_REDIRECT);
+		ast_set_flag(&(config.features_caller), AST_FEATURE_REDIRECT);
 		res = ast_bridge_call(chan, peer, &config);
 
 		/* Simulate the PBX hanging up */



More information about the svn-commits mailing list