[asterisk-commits] murf: branch murf/bug8173-1.2 r48297 - in /team/murf/bug8173-1.2: ./ apps/ ch...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Dec 6 00:04:20 MST 2006


Author: murf
Date: Wed Dec  6 01:04:19 2006
New Revision: 48297

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48297
Log:
Merged revisions 48087,48106,48127,48142,48146,48151,48154,48157,48161,48165,48183,48192,48233,48236,48246,48251,48272 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48087 | file | 2006-11-28 09:56:01 -0700 (Tue, 28 Nov 2006) | 2 lines

According to the research I have done we never needed to include compiler.h in the first place so let's not! (issue #8430 reported by edguy3)

........
r48106 | file | 2006-11-29 09:47:10 -0700 (Wed, 29 Nov 2006) | 2 lines

If the frame was duplicated before writing out then we need to free it. (issue #8429 reported by edguy3)

........
r48127 | oej | 2006-11-30 02:05:07 -0700 (Thu, 30 Nov 2006) | 2 lines

Do proper test and don't leave dialogs hanging...

........
r48142 | file | 2006-11-30 10:55:23 -0700 (Thu, 30 Nov 2006) | 2 lines

Document 'port' for SIP peers, came up because of the current mailing list thread. (issue #8450 reported by blitzrage)

........
r48146 | file | 2006-11-30 11:17:54 -0700 (Thu, 30 Nov 2006) | 2 lines

Remember the pointer to the allocated block of memory so that we can free it and not cause a memory leak. (issue #8449 reported by arkadia)

........
r48151 | file | 2006-11-30 11:42:45 -0700 (Thu, 30 Nov 2006) | 2 lines

Print certain CDR messages out at the NOTICE level versus WARNING since they can occur when used with the CDR applications and are perfectly fine. (issue #8367 reported by dartvader)

........
r48154 | file | 2006-11-30 12:04:11 -0700 (Thu, 30 Nov 2006) | 2 lines

Do not listen for DTMF on the bridge that comes into existence when ParkedCall is executed. This means native bridging can now occur for this. (issue #8406 reported by kebl0155)

........
r48157 | file | 2006-11-30 13:06:43 -0700 (Thu, 30 Nov 2006) | 2 lines

Only print out debug message if bridged channel is not NULL. (issue #8412 reported by jubilex)

........
r48161 | file | 2006-11-30 13:27:29 -0700 (Thu, 30 Nov 2006) | 2 lines

Don't write AST_FRAME_NULL or AST_FRAME_IAX frames out to the channel driver. (issue #8390 reported by hselasky)

........
r48165 | oej | 2006-11-30 13:47:53 -0700 (Thu, 30 Nov 2006) | 2 lines

Issue 8319 - noriyuki - nonce-count updated *after* use

........
r48183 | qwell | 2006-12-01 13:19:10 -0700 (Fri, 01 Dec 2006) | 2 lines

Fix a small typo - issue 8848, reported by pabelanger

........
r48192 | kpfleming | 2006-12-01 16:30:59 -0700 (Fri, 01 Dec 2006) | 2 lines

if Dial() is going to send music-on-hold to the calling party, it has to send PROGRESS first to ensure that the reverse audio path has been setup first (BE-106)

........
r48233 | file | 2006-12-04 11:14:46 -0700 (Mon, 04 Dec 2006) | 2 lines

If the generic bridge tells us not to retry, and we have a frame to spit out then break the bridge. Props to markit in #asterisk-bugs for bringing this up.

........
r48236 | qwell | 2006-12-04 12:06:26 -0700 (Mon, 04 Dec 2006) | 4 lines

Fix an issue where a message isn't saved correctly when using ODBC storage and reviewing a message.

Issue 8016 - patch by sokhapkin.

........
r48246 | qwell | 2006-12-04 14:20:34 -0700 (Mon, 04 Dec 2006) | 7 lines

Revert change from 8016 - this breaks other stuff...  Needs further review.

Tip: When you've reported a bug about something and somebody has put up a
patch for it..  It's not a good idea to open a completely new bug and say that
something is broken because of the patch in the other bug - PLEASE mention
something in the bug where the patch was actually created.

........
r48251 | tilghman | 2006-12-04 18:26:08 -0700 (Mon, 04 Dec 2006) | 6 lines

If the recording in the database is too large, it will fail to retrieve with
an mmap error.  Not too sure why this doesn't happen when we put it in the
database, also, but since that doesn't seem to be broken, I'm not going to fix
it (at least until someone reports it).  Solution is to ask for the file in
smaller chunks.  (Bug 8385)

........
r48272 | oej | 2006-12-05 10:59:15 -0700 (Tue, 05 Dec 2006) | 2 lines

Only set the ALREADYGONE flag once in handle_response()

........

Modified:
    team/murf/bug8173-1.2/   (props changed)
    team/murf/bug8173-1.2/apps/app_dial.c
    team/murf/bug8173-1.2/apps/app_voicemail.c
    team/murf/bug8173-1.2/cdr.c
    team/murf/bug8173-1.2/channel.c
    team/murf/bug8173-1.2/channels/chan_iax2.c
    team/murf/bug8173-1.2/channels/chan_phone.c
    team/murf/bug8173-1.2/channels/chan_sip.c
    team/murf/bug8173-1.2/configs/extensions.conf.sample
    team/murf/bug8173-1.2/configs/sip.conf.sample
    team/murf/bug8173-1.2/res/res_features.c
    team/murf/bug8173-1.2/rtp.c

Propchange: team/murf/bug8173-1.2/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Dec  6 01:04:19 2006
@@ -1,1 +1,1 @@
-/branches/1.2:1-48060
+/branches/1.2:1-48296

Modified: team/murf/bug8173-1.2/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8173-1.2/apps/app_dial.c?view=diff&rev=48297&r1=48296&r2=48297
==============================================================================
--- team/murf/bug8173-1.2/apps/app_dial.c (original)
+++ team/murf/bug8173-1.2/apps/app_dial.c Wed Dec  6 01:04:19 2006
@@ -1197,6 +1197,7 @@
 		strcpy(status, "NOANSWER");
 		if (ast_test_flag(outgoing, OPT_MUSICBACK)) {
 			moh=1;
+			ast_indicate(chan, AST_CONTROL_PROGRESS);
 			ast_moh_start(chan, opt_args[OPT_ARG_MUSICBACK]);
 		} else if (ast_test_flag(outgoing, OPT_RINGBACK)) {
 			ast_indicate(chan, AST_CONTROL_RINGING);

Modified: team/murf/bug8173-1.2/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8173-1.2/apps/app_voicemail.c?view=diff&rev=48297&r1=48296&r2=48297
==============================================================================
--- team/murf/bug8173-1.2/apps/app_voicemail.c (original)
+++ team/murf/bug8173-1.2/apps/app_voicemail.c Wed Dec  6 01:04:19 2006
@@ -77,6 +77,7 @@
 #define COMMAND_TIMEOUT 5000
 #define	VOICEMAIL_DIR_MODE	0700
 #define	VOICEMAIL_FILE_MODE	0600
+#define	CHUNKSIZE	65536
 
 #define VOICEMAIL_CONFIG "voicemail.conf"
 #define ASTERISK_USERNAME "asterisk"
@@ -925,6 +926,7 @@
 				goto yuck;
 			}
 			if (!strcasecmp(coltitle, "recording")) {
+				off_t offset;
 				res = SQLGetData(stmt, x + 1, SQL_BINARY, NULL, 0, &colsize);
 				fdlen = colsize;
 				if (fd > -1) {
@@ -935,22 +937,25 @@
 						fd = -1;
 						continue;
 					}
-					if (fd > -1) {
-						if ((fdm = mmap(NULL, fdlen, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == -1) {
+					/* Read out in small chunks */
+					for (offset = 0; offset < colsize; offset += CHUNKSIZE) {
+						/* +1 because SQLGetData likes null-terminating binary data */
+						if ((fdm = mmap(NULL, CHUNKSIZE + 1, PROT_READ | PROT_WRITE, MAP_SHARED, fd, offset)) == -1) {
 							ast_log(LOG_WARNING, "Could not mmap the output file: %s (%d)\n", strerror(errno), errno);
 							SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 							goto yuck;
+						} else {
+							res = SQLGetData(stmt, x + 1, SQL_BINARY, fdm, CHUNKSIZE + 1, NULL);
+							munmap(fdm, 0);
+							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);
+								SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+								goto yuck;
+							}
 						}
 					}
-				}
-				if (fdm) {
-					memset(fdm, 0, fdlen);
-					res = SQLGetData(stmt, x + 1, SQL_BINARY, fdm, fdlen, &colsize);
-					if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
-						ast_log(LOG_WARNING, "SQL Get Data error!\n[%s]\n\n", sql);
-						SQLFreeHandle (SQL_HANDLE_STMT, stmt);
-						goto yuck;
-					}
+					truncate(full_fn, fdlen);
 				}
 			} else {
 				res = SQLGetData(stmt, x + 1, SQL_CHAR, rowdata, sizeof(rowdata), NULL);
@@ -969,8 +974,6 @@
 yuck:	
 	if (f)
 		fclose(f);
-	if (fdm)
-		munmap(fdm, fdlen);
 	if (fd > -1)
 		close(fd);
 	return x - 1;

Modified: team/murf/bug8173-1.2/cdr.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8173-1.2/cdr.c?view=diff&rev=48297&r1=48296&r2=48297
==============================================================================
--- team/murf/bug8173-1.2/cdr.c (original)
+++ team/murf/bug8173-1.2/cdr.c Wed Dec  6 01:04:19 2006
@@ -440,11 +440,11 @@
 		next = cdr->next;
 		chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
 		if (!ast_test_flag(cdr, AST_CDR_FLAG_POSTED) && !ast_test_flag(cdr, AST_CDR_FLAG_POST_DISABLED))
-			ast_log(LOG_WARNING, "CDR on channel '%s' not posted\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' not posted\n", chan);
 		if (ast_tvzero(cdr->end))
-			ast_log(LOG_WARNING, "CDR on channel '%s' lacks end\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' lacks end\n", chan);
 		if (ast_tvzero(cdr->start))
-			ast_log(LOG_WARNING, "CDR on channel '%s' lacks start\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' lacks start\n", chan);
 
 		ast_cdr_free_vars(cdr, 0);
 		free(cdr);
@@ -806,11 +806,11 @@
 	while (cdr) {
 		chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
 		if (ast_test_flag(cdr, AST_CDR_FLAG_POSTED))
-			ast_log(LOG_WARNING, "CDR on channel '%s' already posted\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' already posted\n", chan);
 		if (ast_tvzero(cdr->end))
-			ast_log(LOG_WARNING, "CDR on channel '%s' lacks end\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' lacks end\n", chan);
 		if (ast_tvzero(cdr->start)) {
-			ast_log(LOG_WARNING, "CDR on channel '%s' lacks start\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' lacks start\n", chan);
 			cdr->disposition = AST_CDR_FAILED;
 		} else
 			cdr->duration = cdr->end.tv_sec - cdr->start.tv_sec;

Modified: team/murf/bug8173-1.2/channel.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8173-1.2/channel.c?view=diff&rev=48297&r1=48296&r2=48297
==============================================================================
--- team/murf/bug8173-1.2/channel.c (original)
+++ team/murf/bug8173-1.2/channel.c Wed Dec  6 01:04:19 2006
@@ -2295,6 +2295,11 @@
 			res = chan->tech->write_video(chan, fr);
 		else
 			res = 0;
+		break;
+	case AST_FRAME_NULL:
+	case AST_FRAME_IAX:
+		/* Ignore these */
+		res = 0;
 		break;
 	default:
 		if (chan->tech->write) {
@@ -3643,6 +3648,8 @@
 			o1nativeformats = c1->nativeformats;
 		}
 		res = ast_generic_bridge(c0, c1, config, fo, rc, nexteventts);
+		if (res != AST_BRIDGE_RETRY && fo)
+			break;
 	}
 
 	c0->_bridge = NULL;

Modified: team/murf/bug8173-1.2/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8173-1.2/channels/chan_iax2.c?view=diff&rev=48297&r1=48296&r2=48297
==============================================================================
--- team/murf/bug8173-1.2/channels/chan_iax2.c (original)
+++ team/murf/bug8173-1.2/channels/chan_iax2.c Wed Dec  6 01:04:19 2006
@@ -7110,7 +7110,7 @@
 					if (!strcmp(ies.called_number, ast_parking_ext())) {
 						if (iax_park(ast_bridged_channel(iaxs[fr->callno]->owner), iaxs[fr->callno]->owner)) {
 							ast_log(LOG_WARNING, "Failed to park call on '%s'\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name);
-						} else
+						} else if (ast_bridged_channel(iaxs[fr->callno]->owner))
 							ast_log(LOG_DEBUG, "Parked call on '%s'\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name);
 					} else {
 						if (ast_async_goto(ast_bridged_channel(iaxs[fr->callno]->owner), iaxs[fr->callno]->context, ies.called_number, 1))

Modified: team/murf/bug8173-1.2/channels/chan_phone.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8173-1.2/channels/chan_phone.c?view=diff&rev=48297&r1=48296&r2=48297
==============================================================================
--- team/murf/bug8173-1.2/channels/chan_phone.c (original)
+++ team/murf/bug8173-1.2/channels/chan_phone.c Wed Dec  6 01:04:19 2006
@@ -37,11 +37,6 @@
 #include <linux/telephony.h>
 /* Still use some IXJ specific stuff */
 #include <linux/version.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
-# include <linux/compiler.h>
-#endif
-#endif
 #include <linux/ixjuser.h>
 
 #include "asterisk.h"

Modified: team/murf/bug8173-1.2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8173-1.2/channels/chan_sip.c?view=diff&rev=48297&r1=48296&r2=48297
==============================================================================
--- team/murf/bug8173-1.2/channels/chan_sip.c (original)
+++ team/murf/bug8173-1.2/channels/chan_sip.c Wed Dec  6 01:04:19 2006
@@ -5661,7 +5661,8 @@
 		ast_copy_string(p->domain, r->domain, sizeof(p->domain));
 		ast_copy_string(p->opaque, r->opaque, sizeof(p->opaque));
 		ast_copy_string(p->qop, r->qop, sizeof(p->qop));
-		p->noncecount = r->noncecount++;
+		r->noncecount++;
+		p->noncecount = r->noncecount;
 
 		memset(digest,0,sizeof(digest));
 		if(!build_reply_digest(p, sipmethod, digest, sizeof(digest)))
@@ -10152,7 +10153,6 @@
 			if ((resp >= 300) && (resp < 700)) {
 				if ((option_verbose > 2) && (resp != 487))
 					ast_verbose(VERBOSE_PREFIX_3 "Got SIP response %d \"%s\" back from %s\n", resp, rest, ast_inet_ntoa(iabuf, sizeof(iabuf), p->sa.sin_addr));
-				ast_set_flag(p, SIP_ALREADYGONE);	
 				if (p->rtp) {
 					/* Immediately stop RTP */
 					ast_rtp_stop(p->rtp);
@@ -11207,7 +11207,7 @@
 		error = 1;
 	}
 	if (error) {
-		if (!p->initreq.header)	/* New call */
+		if (!p->initreq.headers)	/* New call */
 			ast_set_flag(p, SIP_NEEDDESTROY);	/* Make sure we destroy this dialog */
 		return -1;
 	}
@@ -11438,7 +11438,7 @@
 				goto retrylock;
 		}
 		if (!lockretry) {
-			ast_log(LOG_ERROR, "We could NOT get the channel lock for %s! \n", p->owner->name);
+			ast_log(LOG_ERROR, "We could NOT get the channel lock for %s - Call ID %s! \n", p->owner->name, p->callid);
 			ast_log(LOG_ERROR, "SIP MESSAGE JUST IGNORED: %s \n", req.data);
 			ast_log(LOG_ERROR, "BAD! BAD! BAD!\n");
 			return 1;

Modified: team/murf/bug8173-1.2/configs/extensions.conf.sample
URL: http://svn.digium.com/view/asterisk/team/murf/bug8173-1.2/configs/extensions.conf.sample?view=diff&rev=48297&r1=48296&r2=48297
==============================================================================
--- team/murf/bug8173-1.2/configs/extensions.conf.sample (original)
+++ team/murf/bug8173-1.2/configs/extensions.conf.sample Wed Dec  6 01:04:19 2006
@@ -154,7 +154,7 @@
 ;
 ; List canonical entries here
 ;
-;exten => 12564286000,1,Macro(std-exten,6000,IAX2/foo)
+;exten => 12564286000,1,Macro(stdexten,6000,IAX2/foo)
 ;exten => _125642860XX,1,Dial(IAX2/otherbox/${EXTEN:7})
 
 [dundi-e164-customers]

Modified: team/murf/bug8173-1.2/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/team/murf/bug8173-1.2/configs/sip.conf.sample?view=diff&rev=48297&r1=48296&r2=48297
==============================================================================
--- team/murf/bug8173-1.2/configs/sip.conf.sample (original)
+++ team/murf/bug8173-1.2/configs/sip.conf.sample Wed Dec  6 01:04:19 2006
@@ -32,6 +32,7 @@
 				; Realms MUST be globally unique according to RFC 3261
 				; Set this to your host name or domain name
 bindport=5060			; UDP Port to bind to (SIP standard port is 5060)
+				; bindport is the local UDP port that Asterisk will listen on
 bindaddr=0.0.0.0		; IP address to bind to (0.0.0.0 binds to all)
 srvlookup=yes			; Enable DNS SRV lookups on outbound calls
 				; Note: Asterisk only uses the first host 
@@ -327,6 +328,7 @@
 ;usereqphone=yes			; This provider requires ";user=phone" on URI
 ;call-limit=5				; permit only 5 simultaneous outgoing calls to this peer
 ;outboundproxy=proxy.provider.domain	; send outbound signaling to this proxy, not directly to the peer
+;port=80				; The port number we want to connect to on the remote side
 
 ;------------------------------------------------------------------------------
 ; Definitions of locally connected SIP phones

Modified: team/murf/bug8173-1.2/res/res_features.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8173-1.2/res/res_features.c?view=diff&rev=48297&r1=48296&r2=48297
==============================================================================
--- team/murf/bug8173-1.2/res/res_features.c (original)
+++ team/murf/bug8173-1.2/res/res_features.c Wed Dec  6 01:04:19 2006
@@ -1774,12 +1774,6 @@
 			ast_verbose(VERBOSE_PREFIX_3 "Channel %s connected to parked call %d\n", chan->name, park);
 
 		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);
-		config.timelimit = 0;
-		config.play_warning = 0;
-		config.warning_freq = 0;
-		config.warning_sound=NULL;
 		res = ast_bridge_call(chan, peer, &config);
 
 		/* Simulate the PBX hanging up */
@@ -2058,7 +2052,8 @@
 		ast_unregister_features();
 		var = ast_variable_browse(cfg, "applicationmap");
 		while(var) {
-			char *tmp_val=strdup(var->value);
+			char *tmp_val_orig=strdup(var->value);
+			char *tmp_val = tmp_val_orig;
 			char *exten, *party=NULL, *app=NULL, *app_args=NULL; 
 
 			if (!tmp_val) { 
@@ -2075,7 +2070,7 @@
 
 			if (!(app && strlen(app)) || !(exten && strlen(exten)) || !(party && strlen(party)) || !(var->name && strlen(var->name))) {
 				ast_log(LOG_NOTICE, "Please check the feature Mapping Syntax, either extension, name, or app aren't provided %s %s %s %s\n",app,exten,party,var->name);
-				free(tmp_val);
+				free(tmp_val_orig);
 				var = var->next;
 				continue;
 			}
@@ -2090,7 +2085,7 @@
 				}
 				if (!feature) {
 					ast_log(LOG_NOTICE, "Malloc failed at feature mapping\n");
-					free(tmp_val);
+					free(tmp_val_orig);
 					var = var->next;
 					continue;
 				}
@@ -2099,7 +2094,6 @@
 				ast_copy_string(feature->sname,var->name,FEATURE_SNAME_LEN);
 				ast_copy_string(feature->app,app,FEATURE_APP_LEN);
 				ast_copy_string(feature->exten, exten,FEATURE_EXTEN_LEN);
-				free(tmp_val);
 				
 				if (app_args) 
 					ast_copy_string(feature->app_args,app_args,FEATURE_APP_ARGS_LEN);
@@ -2114,6 +2108,7 @@
 					ast_set_flag(feature,AST_FEATURE_FLAG_CALLEE);
 				else {
 					ast_log(LOG_NOTICE, "Invalid party specification for feature '%s', must be caller, or callee\n", var->name);
+					free(tmp_val_orig);
 					var = var->next;
 					continue;
 				}
@@ -2121,6 +2116,7 @@
 				ast_register_feature(feature);
 				
 				if (option_verbose >=1) ast_verbose(VERBOSE_PREFIX_2 "Mapping Feature '%s' to app '%s' with code '%s'\n", var->name, app, exten);  
+				free(tmp_val_orig);
 			}
 			var = var->next;
 		}	 

Modified: team/murf/bug8173-1.2/rtp.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8173-1.2/rtp.c?view=diff&rev=48297&r1=48296&r2=48297
==============================================================================
--- team/murf/bug8173-1.2/rtp.c (original)
+++ team/murf/bug8173-1.2/rtp.c Wed Dec  6 01:04:19 2006
@@ -1463,6 +1463,8 @@
 			f = _f;
 		}
 		ast_rtp_raw_write(rtp, f, codec);
+		if (f != _f)
+			ast_frfree(f);
 	}
 		
 	return 0;



More information about the asterisk-commits mailing list