[asterisk-commits] dlee: branch dlee/performance r399338 - in /team/dlee/performance: ./ apps/co...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 18 08:59:41 CDT 2013


Author: dlee
Date: Wed Sep 18 08:59:39 2013
New Revision: 399338

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=399338
Log:
Merged revisions 399225-399306 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    team/dlee/performance/   (props changed)
    team/dlee/performance/apps/confbridge/conf_state_multi_marked.c
    team/dlee/performance/include/asterisk/features_config.h
    team/dlee/performance/include/asterisk/res_pjsip.h
    team/dlee/performance/main/asterisk.c
    team/dlee/performance/main/bridge_basic.c
    team/dlee/performance/main/features_config.c
    team/dlee/performance/main/logger.c
    team/dlee/performance/res/res_pjsip/pjsip_configuration.c
    team/dlee/performance/res/res_pjsip_sdp_rtp.c
    team/dlee/performance/res/res_pjsip_t38.c

Propchange: team/dlee/performance/
------------------------------------------------------------------------------
--- branch-11-blocked (original)
+++ branch-11-blocked Wed Sep 18 08:59:39 2013
@@ -1,1 +1,1 @@
-/branches/11:373240,375247,375702,385356,395020,396441,397034,397604
+/branches/11:373240,375247,375702,385356,395020,396441,397034,397604,399305

Propchange: team/dlee/performance/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Propchange: team/dlee/performance/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Sep 18 08:59:39 2013
@@ -1,1 +1,1 @@
-/branches/12:1-399223
+/branches/12:1-399337

Modified: team/dlee/performance/apps/confbridge/conf_state_multi_marked.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/performance/apps/confbridge/conf_state_multi_marked.c?view=diff&rev=399338&r1=399337&r2=399338
==============================================================================
--- team/dlee/performance/apps/confbridge/conf_state_multi_marked.c (original)
+++ team/dlee/performance/apps/confbridge/conf_state_multi_marked.c Wed Sep 18 08:59:39 2013
@@ -93,8 +93,15 @@
 		}
 
 		AST_LIST_TRAVERSE_SAFE_BEGIN(&user->conference->active_list, user_iter, list) {
-			/* Kick ENDMARKED cbu_iters */
+			/* Kick ENDMARKED user_iters */
 			if (ast_test_flag(&user_iter->u_profile, USER_OPT_ENDMARKED)) {
+				if (ast_test_flag(&user_iter->u_profile, USER_OPT_WAITMARKED) &&
+						  !ast_test_flag(&user_iter->u_profile, USER_OPT_MARKEDUSER)) {
+					AST_LIST_REMOVE_CURRENT(list);
+					user_iter->conference->activeusers--;
+					AST_LIST_INSERT_TAIL(&user_iter->conference->waiting_list, user_iter, list);
+					user_iter->conference->waitingusers++;
+				}
 				user_iter->kicked = 1;
 				ast_bridge_remove(user_iter->conference->bridge, user_iter->chan);
 			} else if (ast_test_flag(&user_iter->u_profile, USER_OPT_WAITMARKED) &&

Modified: team/dlee/performance/include/asterisk/features_config.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/performance/include/asterisk/features_config.h?view=diff&rev=399338&r1=399337&r2=399338
==============================================================================
--- team/dlee/performance/include/asterisk/features_config.h (original)
+++ team/dlee/performance/include/asterisk/features_config.h Wed Sep 18 08:59:39 2013
@@ -69,11 +69,11 @@
 		/*! DTMF sequence used to swap which party the transferer is talking to */
 		AST_STRING_FIELD(atxferswap);
 	);
-	/*! Milliseconds allowed between digit presses when dialing transfer destination */
+	/*! Seconds allowed between digit presses when dialing transfer destination */
 	unsigned int transferdigittimeout;
-	/*! Milliseconds to wait for the transfer target to answer a transferred call */
+	/*! Seconds to wait for the transfer target to answer a transferred call */
 	unsigned int atxfernoanswertimeout;
-	/*! Milliseconds to wait before attempting to re-dial the transfer target */
+	/*! Seconds to wait before attempting to re-dial the transfer target */
 	unsigned int atxferloopdelay;
 	/*! Number of times to re-attempt dialing the transfer target */
 	unsigned int atxfercallbackretries;

Modified: team/dlee/performance/include/asterisk/res_pjsip.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/performance/include/asterisk/res_pjsip.h?view=diff&rev=399338&r1=399337&r2=399338
==============================================================================
--- team/dlee/performance/include/asterisk/res_pjsip.h (original)
+++ team/dlee/performance/include/asterisk/res_pjsip.h Wed Sep 18 08:59:39 2013
@@ -490,8 +490,8 @@
  */
 struct ast_sip_endpoint_media_configuration {
 	AST_DECLARE_STRING_FIELDS(
-		/*! Optional external media address to use in SDP */
-		AST_STRING_FIELD(external_address);
+		/*! Optional media address to use in SDP */
+		AST_STRING_FIELD(address);
 		/*! SDP origin username */
 		AST_STRING_FIELD(sdpowner);
 		/*! SDP session name */

Modified: team/dlee/performance/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/performance/main/asterisk.c?view=diff&rev=399338&r1=399337&r2=399338
==============================================================================
--- team/dlee/performance/main/asterisk.c (original)
+++ team/dlee/performance/main/asterisk.c Wed Sep 18 08:59:39 2013
@@ -2056,14 +2056,12 @@
 }
 
 struct console_state_data {
-	int newline;
 	char verbose_line_level;
 };
 
 static int console_state_init(void *ptr)
 {
 	struct console_state_data *state = ptr;
-	state->newline = 1;
 	state->verbose_line_level = 0;
 	return 0;
 }
@@ -2076,42 +2074,40 @@
 #define VERBOSE_MAGIC2LEVEL(x) (((char) -*(signed char *) (x)) - 1)
 #define VERBOSE_HASMAGIC(x)	(*(signed char *) (x) < 0)
 
-static int console_log_verbose(const char *s)
-{
-	/* verbose level of 0 evaluates to a magic of -1, 1 to -2, etc...
-	   search up to -7 (level = 6) as this is currently the largest
-	   level used */
-	static const char find_set[9] = { -1, -2, -3, -4, -5, -6, -7, '\n'};
-
+static int console_print(const char *s, int local)
+{
 	struct console_state_data *state =
 		ast_threadstorage_get(&console_state, sizeof(*state));
 
 	char prefix[80];
-	const char *c = s;
+	const char *c;
 	int num, res = 0;
+	unsigned int newline;
 
 	do {
 		if (VERBOSE_HASMAGIC(s)) {
-			/* if it has one always use the given line's level,
-			   otherwise we'll use the last line's level */
+			/* always use the given line's level, otherwise
+			   we'll use the last line's level */
 			state->verbose_line_level = VERBOSE_MAGIC2LEVEL(s);
 			/* move past magic */
 			s++;
-		}
-
-		c = fix_header(prefix, sizeof(prefix), s,
-			       state->verbose_line_level);
-
-		if (!state->newline) {
-			/* don't use the prefix if line continuation */
+
+			if (local) {
+				s = fix_header(prefix, sizeof(prefix), s,
+					       state->verbose_line_level);
+			}
+		} else {
 			*prefix = '\0';
 		}
-
-		/* for a given line separate on verbose magic and newlines */
-		if (!(s = strpbrk(c, find_set))) {
+		c = s;
+
+		/* for a given line separate on verbose magic, newline, and eol */
+		if ((s = strchr(c, '\n'))) {
+			++s;
+			newline = 1;
+		} else {
 			s = strchr(c, '\0');
-		} else if (*s == '\n') {
-			++s;
+			newline = 0;
 		}
 
 		/* check if we should write this line after calculating begin/end
@@ -2121,8 +2117,7 @@
 			continue;
 		}
 
-		state->newline = *(s - 1) == '\n';
-		if (!ast_strlen_zero(prefix)) {
+		if (local && !ast_strlen_zero(prefix)) {
 			fputs(prefix, stdout);
 		}
 
@@ -2136,8 +2131,13 @@
 			   we'll want to return true */
 			res = 1;
 		}
-		c = s;
 	} while (*s);
+
+	if (newline) {
+		/* if ending on a newline then reset last level to zero
+		    since what follows may be not be logging output */
+		state->verbose_line_level = 0;
+	}
 
 	if (res) {
 		fflush(stdout);
@@ -2148,7 +2148,7 @@
 
 static void console_verboser(const char *s)
 {
-	if (!console_log_verbose(s)) {
+	if (!console_print(s, 1)) {
 		return;
 	}
 
@@ -2635,7 +2635,7 @@
 				}
 			}
 
-			console_log_verbose(buf);
+			console_print(buf, 0);
 
 			if ((res < EL_BUF_SIZE - 1) && ((buf[res-1] == '\n') || (buf[res-2] == '\n'))) {
 				*cp = CC_REFRESH;

Modified: team/dlee/performance/main/bridge_basic.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/performance/main/bridge_basic.c?view=diff&rev=399338&r1=399337&r2=399338
==============================================================================
--- team/dlee/performance/main/bridge_basic.c (original)
+++ team/dlee/performance/main/bridge_basic.c Wed Sep 18 08:59:39 2013
@@ -2721,7 +2721,7 @@
 		if (!(state_properties[props->state].flags & TRANSFER_STATE_FLAG_TIMED)) {
 			ast_cond_wait(&props->cond, lock);
 		} else {
-			struct timeval relative_timeout;
+			struct timeval relative_timeout = { 0, };
 			struct timeval absolute_timeout;
 			struct timespec timeout_arg;
 
@@ -2730,10 +2730,10 @@
 			}
 
 			if (state_properties[props->state].flags & TRANSFER_STATE_FLAG_TIMER_LOOP_DELAY) {
-				relative_timeout = ast_samp2tv(props->atxferloopdelay, 1000);
+				relative_timeout.tv_sec = props->atxferloopdelay;
 			} else {
 				/* Implied TRANSFER_STATE_FLAG_TIMER_ATXFER_NO_ANSWER */
-				relative_timeout = ast_samp2tv(props->atxfernoanswertimeout, 1000);
+				relative_timeout.tv_sec = props->atxfernoanswertimeout;
 			}
 
 			absolute_timeout = ast_tvadd(props->start, relative_timeout);
@@ -2866,7 +2866,7 @@
 		ast_channel_unlock(chan);
 		return -1;
 	}
-	digit_timeout = xfer_cfg->transferdigittimeout;
+	digit_timeout = xfer_cfg->transferdigittimeout * 1000;
 	ast_channel_unlock(chan);
 
 	/* Play the simple "transfer" prompt out and wait */

Modified: team/dlee/performance/main/features_config.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/performance/main/features_config.c?view=diff&rev=399338&r1=399337&r2=399338
==============================================================================
--- team/dlee/performance/main/features_config.c (original)
+++ team/dlee/performance/main/features_config.c Wed Sep 18 08:59:39 2013
@@ -42,11 +42,11 @@
 				<configOption name="recordingfailsound">
 					<synopsis>Sound to play when automon or automixmon is attempted but fails to start</synopsis>
 				</configOption>
-				<configOption name="transferdigittimeout" default="3000">
-					<synopsis>Milliseconds allowed between digit presses when dialing a transfer destination</synopsis>
-				</configOption>
-				<configOption name="atxfernoanswertimeout" default="15000">
-					<synopsis>Milliseconds to wait for attended transfer destination to answer</synopsis>
+				<configOption name="transferdigittimeout" default="3">
+					<synopsis>Seconds allowed between digit presses when dialing a transfer destination</synopsis>
+				</configOption>
+				<configOption name="atxfernoanswertimeout" default="15">
+					<synopsis>Seconds to wait for attended transfer destination to answer</synopsis>
 				</configOption>
 				<configOption name="atxferdropcall" default="no">
 					<synopsis>Hang up the call entirely if the attended transfer fails</synopsis>
@@ -62,8 +62,8 @@
 						hang up all channels involved in the transfer.</para>
 					</description>
 				</configOption>
-				<configOption name="atxferloopdelay" default="10000">
-					<synopsis>Milliseconds to wait between attempts to re-dial transfer destination</synopsis>
+				<configOption name="atxferloopdelay" default="10">
+					<synopsis>Seconds to wait between attempts to re-dial transfer destination</synopsis>
 					<see-also><ref type="configOption">atxferdropcall</ref></see-also>
 				</configOption>
 				<configOption name="atxfercallbackretries" default="2">
@@ -355,10 +355,10 @@
 #define DEFAULT_RECORDING_FAIL_SOUND                ""
 
 /*! Default xfer options */
-#define DEFAULT_TRANSFER_DIGIT_TIMEOUT              3000
-#define DEFAULT_NOANSWER_TIMEOUT_ATTENDED_TRANSFER  15000
+#define DEFAULT_TRANSFER_DIGIT_TIMEOUT              3
+#define DEFAULT_NOANSWER_TIMEOUT_ATTENDED_TRANSFER  15
 #define DEFAULT_ATXFER_DROP_CALL                    0
-#define DEFAULT_ATXFER_LOOP_DELAY                   10000
+#define DEFAULT_ATXFER_LOOP_DELAY                   10
 #define DEFAULT_ATXFER_CALLBACK_RETRIES             2
 #define DEFAULT_XFERSOUND                           "beep"
 #define DEFAULT_XFERFAILSOUND                       "beeperr"
@@ -1346,6 +1346,11 @@
 	slash = strchr(args.activate_on, '/');
 	if (slash) {
 		*slash = '\0';
+	}
+
+	/* Some applications do not require arguments. */
+	if (!args.app_data) {
+		args.app_data = "";
 	}
 
 	/* Two syntaxes allowed for applicationmap:

Modified: team/dlee/performance/main/logger.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/performance/main/logger.c?view=diff&rev=399338&r1=399337&r2=399338
==============================================================================
--- team/dlee/performance/main/logger.c (original)
+++ team/dlee/performance/main/logger.c Wed Sep 18 08:59:39 2013
@@ -1603,10 +1603,11 @@
 
 void __ast_verbose_ap(const char *file, int line, const char *func, int level, struct ast_callid *callid, const char *fmt, va_list ap)
 {
-	struct ast_str *buf = NULL;
+	const char *p;
+	struct ast_str *prefixed, *buf = NULL;
 	int res = 0;
 	const char *prefix = level >= 4 ? VERBOSE_PREFIX_4 : level == 3 ? VERBOSE_PREFIX_3 : level == 2 ? VERBOSE_PREFIX_2 : level == 1 ? VERBOSE_PREFIX_1 : "";
-	signed char magic = level > 127 ? -128 : -level - 1; /* 0 => -1, 1 => -2, etc.  Can't pass NUL, as it is EOS-delimiter */
+	signed char magic = level > 9 ? -10 : -level - 1; /* 0 => -1, 1 => -2, etc.  Can't pass NUL, as it is EOS-delimiter */
 
 	/* For compatibility with modules still calling ast_verbose() directly instead of using ast_verb() */
 	if (level < 0) {
@@ -1623,37 +1624,41 @@
 		}
 	}
 
-	if (!(buf = ast_str_thread_get(&verbose_buf, VERBOSE_BUF_INIT_SIZE))) {
+	if (!(prefixed = ast_str_thread_get(&verbose_buf, VERBOSE_BUF_INIT_SIZE)) ||
+	    !(buf = ast_str_create(VERBOSE_BUF_INIT_SIZE))) {
 		return;
 	}
 
-	if (ast_opt_timestamp) {
-		struct timeval now;
-		struct ast_tm tm;
-		char date[40];
-		char *datefmt;
-
-		now = ast_tvnow();
-		ast_localtime(&now, &tm, NULL);
-		ast_strftime(date, sizeof(date), dateformat, &tm);
-		datefmt = ast_alloca(strlen(date) + 3 + strlen(prefix) + strlen(fmt) + 1);
-		sprintf(datefmt, "%c[%s] %s%s", (char) magic, date, prefix, fmt);
-		fmt = datefmt;
-	} else {
-		char *tmp = ast_alloca(strlen(prefix) + strlen(fmt) + 2);
-		sprintf(tmp, "%c%s%s", (char) magic, prefix, fmt);
-		fmt = tmp;
-	}
-
-	/* Build string */
 	res = ast_str_set_va(&buf, 0, fmt, ap);
-
 	/* If the build failed then we can drop this allocated message */
 	if (res == AST_DYNSTR_BUILD_FAILED) {
 		return;
 	}
 
-	ast_log_callid(__LOG_VERBOSE, file, line, func, callid, "%s", ast_str_buffer(buf));
+	ast_str_reset(prefixed);
+	/* for every newline found in the buffer add verbose prefix data */
+	fmt = ast_str_buffer(buf);
+	do {
+		if (!(p = strchr(fmt, '\n'))) {
+			p = strchr(fmt, '\0') - 1;
+		}
+		++p;
+
+		if (ast_opt_timestamp) {
+			struct ast_tm tm;
+			char date[40];
+			struct timeval now = ast_tvnow();
+			ast_localtime(&now, &tm, NULL);
+			ast_strftime(date, sizeof(date), dateformat, &tm);
+			ast_str_append(&prefixed, 0, "%c[%s] %s", (char) magic, date, prefix);
+		} else {
+			ast_str_append(&prefixed, 0, "%c%s", (char) magic, prefix);
+		}
+		ast_str_append_substr(&prefixed, 0, fmt, p - fmt);
+		fmt = p;
+	} while (p && *p);
+
+	ast_log_callid(__LOG_VERBOSE, file, line, func, callid, "%s", ast_str_buffer(prefixed));
 }
 
 void __ast_verbose(const char *file, int line, const char *func, int level, const char *fmt, ...)

Modified: team/dlee/performance/res/res_pjsip/pjsip_configuration.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/performance/res/res_pjsip/pjsip_configuration.c?view=diff&rev=399338&r1=399337&r2=399338
==============================================================================
--- team/dlee/performance/res/res_pjsip/pjsip_configuration.c (original)
+++ team/dlee/performance/res/res_pjsip/pjsip_configuration.c Wed Sep 18 08:59:39 2013
@@ -656,7 +656,7 @@
 	ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "auth", "", inbound_auth_handler, NULL, 0, 0);
 	ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "outbound_auth", "", outbound_auth_handler, NULL, 0, 0);
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "aors", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, aors));
-	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "external_media_address", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, media.external_address));
+	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "media_address", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, media.address));
 	ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "identify_by", "username", ident_handler, NULL, 0, 0);
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "direct_media", "yes", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, media.direct_media.enabled));
 	ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "direct_media_method", "invite", direct_media_method_handler, NULL, 0, 0);

Modified: team/dlee/performance/res/res_pjsip_sdp_rtp.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/performance/res/res_pjsip_sdp_rtp.c?view=diff&rev=399338&r1=399337&r2=399338
==============================================================================
--- team/dlee/performance/res/res_pjsip_sdp_rtp.c (original)
+++ team/dlee/performance/res/res_pjsip_sdp_rtp.c Wed Sep 18 08:59:39 2013
@@ -889,7 +889,7 @@
 	/* Add connection level details */
 	if (direct_media_enabled) {
 		ast_copy_string(hostip, ast_sockaddr_stringify_fmt(&session_media->direct_media_addr, AST_SOCKADDR_STR_ADDR), sizeof(hostip));
-	} else if (ast_strlen_zero(session->endpoint->media.external_address)) {
+	} else if (ast_strlen_zero(session->endpoint->media.address)) {
 		pj_sockaddr localaddr;
 
 		if (pj_gethostip(session->endpoint->media.rtp.ipv6 ? pj_AF_INET6() : pj_AF_INET(), &localaddr)) {
@@ -897,7 +897,7 @@
 		}
 		pj_sockaddr_print(&localaddr, hostip, sizeof(hostip), 2);
 	} else {
-		ast_copy_string(hostip, session->endpoint->media.external_address, sizeof(hostip));
+		ast_copy_string(hostip, session->endpoint->media.address, sizeof(hostip));
 	}
 
 	media->conn->net_type = STR_IN;

Modified: team/dlee/performance/res/res_pjsip_t38.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/performance/res/res_pjsip_t38.c?view=diff&rev=399338&r1=399337&r2=399338
==============================================================================
--- team/dlee/performance/res/res_pjsip_t38.c (original)
+++ team/dlee/performance/res/res_pjsip_t38.c Wed Sep 18 08:59:39 2013
@@ -671,7 +671,7 @@
 	media->desc.media = pj_str(session_media->stream_type);
 	media->desc.transport = STR_UDPTL;
 
-	if (ast_strlen_zero(session->endpoint->media.external_address)) {
+	if (ast_strlen_zero(session->endpoint->media.address)) {
 		pj_sockaddr localaddr;
 
 		if (pj_gethostip(session->endpoint->media.t38.ipv6 ? pj_AF_INET6() : pj_AF_INET(), &localaddr)) {
@@ -679,7 +679,7 @@
 		}
 		pj_sockaddr_print(&localaddr, hostip, sizeof(hostip), 2);
 	} else {
-		ast_copy_string(hostip, session->endpoint->media.external_address, sizeof(hostip));
+		ast_copy_string(hostip, session->endpoint->media.address, sizeof(hostip));
 	}
 
 	media->conn->net_type = STR_IN;




More information about the asterisk-commits mailing list