[asterisk-commits] oej: branch oej/statechange-7816 r48265 - in /team/oej/statechange-7816: ./ a...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Dec 5 06:14:11 MST 2006


Author: oej
Date: Tue Dec  5 07:14:10 2006
New Revision: 48265

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48265
Log:
Update

Modified:
    team/oej/statechange-7816/   (props changed)
    team/oej/statechange-7816/apps/app_dial.c
    team/oej/statechange-7816/apps/app_voicemail.c
    team/oej/statechange-7816/cdr.c
    team/oej/statechange-7816/channel.c
    team/oej/statechange-7816/channels/chan_iax2.c
    team/oej/statechange-7816/channels/chan_sip.c
    team/oej/statechange-7816/configs/extensions.conf.sample
    team/oej/statechange-7816/configs/sip.conf.sample
    team/oej/statechange-7816/res/res_features.c

Propchange: team/oej/statechange-7816/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Dec  5 07:14:10 2006
@@ -1,1 +1,1 @@
-/branches/1.2:1-48136
+/branches/1.2:1-48263

Modified: team/oej/statechange-7816/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/statechange-7816/apps/app_dial.c?view=diff&rev=48265&r1=48264&r2=48265
==============================================================================
--- team/oej/statechange-7816/apps/app_dial.c (original)
+++ team/oej/statechange-7816/apps/app_dial.c Tue Dec  5 07:14:10 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/oej/statechange-7816/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/statechange-7816/apps/app_voicemail.c?view=diff&rev=48265&r1=48264&r2=48265
==============================================================================
--- team/oej/statechange-7816/apps/app_voicemail.c (original)
+++ team/oej/statechange-7816/apps/app_voicemail.c Tue Dec  5 07:14:10 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/oej/statechange-7816/cdr.c
URL: http://svn.digium.com/view/asterisk/team/oej/statechange-7816/cdr.c?view=diff&rev=48265&r1=48264&r2=48265
==============================================================================
--- team/oej/statechange-7816/cdr.c (original)
+++ team/oej/statechange-7816/cdr.c Tue Dec  5 07:14:10 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/oej/statechange-7816/channel.c
URL: http://svn.digium.com/view/asterisk/team/oej/statechange-7816/channel.c?view=diff&rev=48265&r1=48264&r2=48265
==============================================================================
--- team/oej/statechange-7816/channel.c (original)
+++ team/oej/statechange-7816/channel.c Tue Dec  5 07:14:10 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/oej/statechange-7816/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/statechange-7816/channels/chan_iax2.c?view=diff&rev=48265&r1=48264&r2=48265
==============================================================================
--- team/oej/statechange-7816/channels/chan_iax2.c (original)
+++ team/oej/statechange-7816/channels/chan_iax2.c Tue Dec  5 07:14:10 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/oej/statechange-7816/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/statechange-7816/channels/chan_sip.c?view=diff&rev=48265&r1=48264&r2=48265
==============================================================================
--- team/oej/statechange-7816/channels/chan_sip.c (original)
+++ team/oej/statechange-7816/channels/chan_sip.c Tue Dec  5 07:14:10 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)))

Modified: team/oej/statechange-7816/configs/extensions.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/statechange-7816/configs/extensions.conf.sample?view=diff&rev=48265&r1=48264&r2=48265
==============================================================================
--- team/oej/statechange-7816/configs/extensions.conf.sample (original)
+++ team/oej/statechange-7816/configs/extensions.conf.sample Tue Dec  5 07:14:10 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/oej/statechange-7816/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/statechange-7816/configs/sip.conf.sample?view=diff&rev=48265&r1=48264&r2=48265
==============================================================================
--- team/oej/statechange-7816/configs/sip.conf.sample (original)
+++ team/oej/statechange-7816/configs/sip.conf.sample Tue Dec  5 07:14:10 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/oej/statechange-7816/res/res_features.c
URL: http://svn.digium.com/view/asterisk/team/oej/statechange-7816/res/res_features.c?view=diff&rev=48265&r1=48264&r2=48265
==============================================================================
--- team/oej/statechange-7816/res/res_features.c (original)
+++ team/oej/statechange-7816/res/res_features.c Tue Dec  5 07:14:10 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;
 		}	 



More information about the asterisk-commits mailing list