[asterisk-commits] bebuild: tag 12.1.0-rc2 r409153 - in /tags/12.1.0-rc2: ./ configs/ funcs/ mai...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 27 16:15:18 CST 2014


Author: bebuild
Date: Thu Feb 27 16:15:11 2014
New Revision: 409153

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=409153
Log:
Merge changes for -rc2

Merge the following:
 * r407676
 * r407747
 * r407750
 * r407937
 * r408855
 * r409054
 * r409131

Modified:
    tags/12.1.0-rc2/   (props changed)
    tags/12.1.0-rc2/ChangeLog
    tags/12.1.0-rc2/configs/res_fax.conf.sample
    tags/12.1.0-rc2/funcs/func_cdr.c
    tags/12.1.0-rc2/main/asterisk.c
    tags/12.1.0-rc2/main/security_events.c
    tags/12.1.0-rc2/res/ari/resource_channels.c
    tags/12.1.0-rc2/res/res_fax.c
    tags/12.1.0-rc2/res/res_rtp_asterisk.c

Propchange: tags/12.1.0-rc2/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Feb 27 16:15:11 2014
@@ -1,0 +1,1 @@
+/branches/12:407676,407747,407750,407937,408555,408855,409054,409131

Modified: tags/12.1.0-rc2/ChangeLog
URL: http://svnview.digium.com/svn/asterisk/tags/12.1.0-rc2/ChangeLog?view=diff&rev=409153&r1=409152&r2=409153
==============================================================================
--- tags/12.1.0-rc2/ChangeLog (original)
+++ tags/12.1.0-rc2/ChangeLog Thu Feb 27 16:15:11 2014
@@ -1,3 +1,103 @@
+2013-02-27  Asterisk Development Team <asteriskteam at digium.com>
+
+	* Asterisk 12.1.0-rc2 Released.
+
+	* res_rtp_asterisk: Fix checklist creating problems in ICE sessions
+	  
+	  Prior to this patch, local candidate lists including SRFLX would
+	  fail to start properly when building ICE candidate check lists. This
+	  patch fixes that problem by making sure that each SRFLX candidate is
+	  associated with the proper base address so that the check list can
+	  create matches properly.
+
+	  This patch was written by jcolp. The issue will be left open to await
+	  testing by the issue participants.       
+
+	  (issue ASTERISK-23213)
+	  Reported by: Andrea Suisani
+	  Review: https://reviewboard.asterisk.org/r/3256/
+
+	* res_fax: Warn that minrate=2400 is not valid for V.27 instead of
+	  failing load.
+
+	  Change minrate from 2400 to 4800 on config reload in response to
+	  changes from ASTERISK-22790 only.  Any config with minrate of
+	  2400 that would fail before r405693 will still fail.
+
+	  Comment out many settings in res_fax.conf.sample. The defaults are
+	  set in res_fax.c, so setting the same value in sample config does
+	  nothing but make the sample config more fragile.
+
+	  (closes issue ASTERISK-23231)
+	  Reported by: David Brillert
+	  Review: https://reviewboard.asterisk.org/r/3261/
+
+	* main: Initialize dialplan providing core components prior to module
+	  pre-load
+
+	  It is possible to pre-load pbx_config. As a result, pbx_config -
+	  which will load and parse the dialplan - will attempt to use various
+	  dialplan components, such as device state providers and presence
+	  state providers, prior to them being initialized by the core. This
+	  would lead to a crash, as the components had not created their Stasis
+	  cache entries.
+
+	  This patch moves a number of core component initializations before
+	  the module pre-load. This guarantees that if someone does pre-load
+	  pbx_config - or other pbx modules - that the Stasis caches for the
+	  various core components are created.
+
+	  (closes issue ASTERISK-23320)
+	  Reported by: xrobau
+
+	  (closes issue ASTERISK-23265)
+	  Reported by: Andrew Nagy
+	  Tested by: Andrew Nagy, Rusty Newton
+
+	* ari/resource_channels: Add channel variables earlier in the creation
+	  process
+
+	  This patch tweaks the behaviour of POST /channels with channel
+	  variables such that the variables are passed into the pbx.c routines
+	  that perform the origination. This allows the variables to be
+	  assigned to the newly	created	channels immediately upon their
+	  construction, as opposed to be assigned after the originate has
+	  completed.
+
+	  The upshot of this is that the variables are available on the
+	  channels if they execute in the dialplan, as opposed to only being
+	  available once the channels are answered.
+
+	* security_events: Fix assertion failure in dev-mode on optional IE
+	  parsing
+
+	  When formatting an optional IE, the value is, of course, optional. As
+	  such, it is entirely appropriate for ast_json_object_get to return
+	  NULL. If that occurs, we now simply skip the IE that was requested,
+	  as it was not provided by the entity that raised the event.
+
+	  Thanks to George Joseph (gtjoseph) for catching this and reporting it
+	  in #asterisk-dev
+
+	* funcs/func_cdr: Handle empty time values when extracting parsed
+	  values
+
+	  When extracting timestamps that are parsed, time stamp values that
+	  are not set (time values of 0.000000) should not actually result in
+	  a parsed string. The value should be skipped, and the result of the
+	  CDR function should be an empty string.
+
+	  Prior to this patch, the result was fed to the time formatting, which
+	  would result in an output of a date/time in 1969.
+
+	* security_events: Fix error caused by DTD validation error
+
+	  The appdocsxml.dtd specifies that a "required" attribute in a
+	  parameter may have a value of yes, no, true, or false. On some
+	  systems, specifying "False" instead of "false" would cause a
+	  validation error. This patch fixes the casing to explicitly match
+	  the DTD.
+
 2013-02-06  Asterisk Development Team <asteriskteam at digium.com>
 
 	* Asterisk 12.1.0-rc1 Released.

Modified: tags/12.1.0-rc2/configs/res_fax.conf.sample
URL: http://svnview.digium.com/svn/asterisk/tags/12.1.0-rc2/configs/res_fax.conf.sample?view=diff&rev=409153&r1=409152&r2=409153
==============================================================================
--- tags/12.1.0-rc2/configs/res_fax.conf.sample (original)
+++ tags/12.1.0-rc2/configs/res_fax.conf.sample Thu Feb 27 16:15:11 2014
@@ -4,12 +4,12 @@
 ; Maximum Transmission Rate
 ; Possible values are { 2400 | 4800 | 7200 | 9600 | 12000 | 14400 }
 ; Set this value to the maximum desired transfer rate.  Default: 14400
-maxrate=14400
+;maxrate=14400
 
 ; Minimum Transmission Rate
 ; Possible values are { 2400 | 4800 | 7200 | 9600 | 12000 | 14400 }
 ; Set this value to the minimum desired transfer rate.  Default: 4800
-minrate=4800
+;minrate=4800
 
 ; Send Progress/Status events to manager session
 ; Manager events with 'call' class permissions will receive events indicating the
@@ -21,8 +21,8 @@
 ; modem capabilities
 ; Possible values are { v17 | v27 | v29 }
 ; Set this value to modify the default modem options.  Default: v17,v27,v29
-modems=v17,v27,v29
+;modems=v17,v27,v29
 
 ; Enable/disable T.30 ECM (error correction mode) by default.
 ; Default: Enabled
-ecm=yes
+;ecm=yes

Modified: tags/12.1.0-rc2/funcs/func_cdr.c
URL: http://svnview.digium.com/svn/asterisk/tags/12.1.0-rc2/funcs/func_cdr.c?view=diff&rev=409153&r1=409152&r2=409153
==============================================================================
--- tags/12.1.0-rc2/funcs/func_cdr.c (original)
+++ tags/12.1.0-rc2/funcs/func_cdr.c Thu Feb 27 16:15:11 2014
@@ -291,9 +291,13 @@
 					args.variable, tempbuf, ast_channel_name(payload->chan));
 				return;
 			}
-			fmt_time.tv_usec = tv_usec;
-			ast_localtime(&fmt_time, &tm, NULL);
-			ast_strftime(tempbuf, sizeof(tempbuf), "%Y-%m-%d %T", &tm);
+			if (fmt_time.tv_sec) {
+				fmt_time.tv_usec = tv_usec;
+				ast_localtime(&fmt_time, &tm, NULL);
+				ast_strftime(tempbuf, sizeof(tempbuf), "%Y-%m-%d %T", &tm);
+			} else {
+				tempbuf[0] = '\0';
+			}
 		} else if (!strcasecmp("disposition", args.variable)) {
 			int disposition;
 

Modified: tags/12.1.0-rc2/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/tags/12.1.0-rc2/main/asterisk.c?view=diff&rev=409153&r1=409152&r2=409153
==============================================================================
--- tags/12.1.0-rc2/main/asterisk.c (original)
+++ tags/12.1.0-rc2/main/asterisk.c Thu Feb 27 16:15:11 2014
@@ -4427,6 +4427,36 @@
 		exit(1);
 	}
 
+	if (ast_features_init()) {
+		printf("%s", term_quit());
+		exit(1);
+	}
+
+	if (ast_pickup_init()) {
+		printf("%s", term_quit());
+		exit(1);
+	}
+
+	if (ast_bridging_init()) {
+		printf("%s", term_quit());
+		exit(1);
+	}
+
+	if (ast_parking_stasis_init()) {
+		printf("%s", term_quit());
+		exit(1);
+	}
+
+	if (ast_device_state_engine_init()) {
+		printf("%s", term_quit());
+		exit(1);
+	}
+
+	if (ast_presence_state_engine_init()) {
+		printf("%s", term_quit());
+		exit(1);
+	}
+
 	if ((moduleresult = load_modules(1))) {		/* Load modules, pre-load only */
 		printf("%s", term_quit());
 		exit(moduleresult == -2 ? 2 : 1);
@@ -4454,37 +4484,7 @@
 		exit(1);
 	}
 
-	if (ast_features_init()) {
-		printf("%s", term_quit());
-		exit(1);
-	}
-
-	if (ast_pickup_init()) {
-		printf("%s", term_quit());
-		exit(1);
-	}
-
-	if (ast_bridging_init()) {
-		printf("%s", term_quit());
-		exit(1);
-	}
-
-	if (ast_parking_stasis_init()) {
-		printf("%s", term_quit());
-		exit(1);
-	}
-
 	if (ast_cdr_engine_init()) {
-		printf("%s", term_quit());
-		exit(1);
-	}
-
-	if (ast_device_state_engine_init()) {
-		printf("%s", term_quit());
-		exit(1);
-	}
-
-	if (ast_presence_state_engine_init()) {
 		printf("%s", term_quit());
 		exit(1);
 	}

Modified: tags/12.1.0-rc2/main/security_events.c
URL: http://svnview.digium.com/svn/asterisk/tags/12.1.0-rc2/main/security_events.c?view=diff&rev=409153&r1=409152&r2=409153
==============================================================================
--- tags/12.1.0-rc2/main/security_events.c (original)
+++ tags/12.1.0-rc2/main/security_events.c Thu Feb 27 16:15:11 2014
@@ -65,13 +65,13 @@
 					<para>The remote address of the entity that caused the
 					security event to be raised.</para>
 				</parameter>
-				<parameter name="Module" required="False">
+				<parameter name="Module" required="false">
 					<para>If available, the name of the module that raised the event.</para>
 				</parameter>
-				<parameter name="ACLName" required="False">
+				<parameter name="ACLName" required="false">
 					<para>If available, the name of the ACL that failed.</para>
 				</parameter>
-				<parameter name="SessionTV" required="False">
+				<parameter name="SessionTV" required="false">
 					<para>The timestamp reported by the session.</para>
 				</parameter>
 			</syntax>
@@ -180,7 +180,7 @@
 				<xi:include xpointer="xpointer(/docs/managerEvent[@name='RequestNotSupported']/managerEventInstance/syntax/parameter[@name='RequestType'])" />
 				<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Module'])" />
 				<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionTV'])" />
-				<parameter name="RequestParams" required="False">
+				<parameter name="RequestParams" required="false">
 					<para>Parameters provided to the rejected request.</para>
 				</parameter>
 			</syntax>
@@ -221,7 +221,7 @@
 				<xi:include xpointer="xpointer(/docs/managerEvent[@name='RequestNotSupported']/managerEventInstance/syntax/parameter[@name='RequestType'])" />
 				<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Module'])" />
 				<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionTV'])" />
-				<parameter name="AccountID" required="False">
+				<parameter name="AccountID" required="false">
 					<para>The account ID associated with the rejected request.</para>
 				</parameter>
 				<xi:include xpointer="xpointer(/docs/managerEvent[@name='RequestNotAllowed']/managerEventInstance/syntax/parameter[@name='RequestParams'])" />
@@ -308,13 +308,13 @@
 				<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='RemoteAddress'])" />
 				<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='Module'])" />
 				<xi:include xpointer="xpointer(/docs/managerEvent[@name='FailedACL']/managerEventInstance/syntax/parameter[@name='SessionTV'])" />
-				<parameter name="Challenge" required="False">
+				<parameter name="Challenge" required="false">
 					<para>The challenge that was sent.</para>
 				</parameter>
-				<parameter name="ReceivedChallenge" required="False">
+				<parameter name="ReceivedChallenge" required="false">
 					<para>The challenge that was received.</para>
 				</parameter>
-				<parameter name="RecievedHash" required="False">
+				<parameter name="RecievedHash" required="false">
 					<para>The hash that was received.</para>
 				</parameter>
 			</syntax>
@@ -390,7 +390,9 @@
 	const char *ie_type_key = ast_event_get_ie_type_name(ie_type);
 	struct ast_json *json_string = ast_json_object_get(json, ie_type_key);
 
-	ast_assert(json_string != NULL);
+	if (!json_string) {
+		return 0;
+	}
 
 	if (ast_str_append(str, 0, "%s: %s\r\n", ie_type_key, S_OR(ast_json_string_get(json_string), "")) == -1) {
 		return -1;

Modified: tags/12.1.0-rc2/res/ari/resource_channels.c
URL: http://svnview.digium.com/svn/asterisk/tags/12.1.0-rc2/res/ari/resource_channels.c?view=diff&rev=409153&r1=409152&r2=409153
==============================================================================
--- tags/12.1.0-rc2/res/ari/resource_channels.c (original)
+++ tags/12.1.0-rc2/res/ari/resource_channels.c Thu Feb 27 16:15:11 2014
@@ -687,37 +687,30 @@
 	ast_ari_response_ok(response, ast_json_ref(json));
 }
 
-static int ari_channels_set_channel_var(struct ast_channel *chan,
-	const char *variable, const char *value, struct ast_ari_response *response)
-{
-	if (pbx_builtin_setvar_helper(chan, variable, value)) {
-		ast_ari_response_error(
-			response, 400, "Bad Request",
-			"Unable to set channel variable %s=%s", variable, value);
-		return -1;
-	}
-
-	return 0;
-}
-
-static int ari_channels_set_channel_vars(struct ast_channel *chan,
-	struct ast_json *variables, struct ast_ari_response *response)
-{
-	struct ast_json_iter *i;
-
-	if (!variables) {
-		/* nothing to do */
-		return 0;
-	}
-
-	for (i = ast_json_object_iter(variables); i;
-	     i = ast_json_object_iter_next(variables, i)) {
-		if (ari_channels_set_channel_var(
-			chan, ast_json_object_iter_key(i),
-			ast_json_string_get(ast_json_object_iter_value(i)),
-			response)) {
-			/* response filled in by called function */
-			return -1;
+static int json_to_ast_variables(struct ast_json *json_variables, struct ast_variable **variables)
+{
+	struct ast_variable *current = NULL;
+	struct ast_json_iter *it_json_var;
+
+	for (it_json_var = ast_json_object_iter(json_variables); it_json_var;
+		 it_json_var = ast_json_object_iter_next(json_variables, it_json_var)) {
+		struct ast_variable *new_var;
+
+		new_var = ast_variable_new(ast_json_object_iter_key(it_json_var),
+		                           ast_json_string_get(ast_json_object_iter_value(it_json_var)),
+		                           "");
+		if (!new_var) {
+			ast_variables_destroy(*variables);
+			*variables = NULL;
+			return 1;
+		}
+
+		if (!current) {
+			*variables = new_var;
+			current = *variables;
+		} else {
+			current->next = new_var;
+			current = new_var;
 		}
 	}
 
@@ -737,11 +730,10 @@
 	RAII_VAR(struct ast_format_cap *, cap,
 		ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_NOLOCK), ast_format_cap_destroy);
 	struct ast_format tmp_fmt;
-
+	RAII_VAR(struct ast_variable *, variables, NULL, ast_variables_destroy);
 	char *stuff;
 	struct ast_channel *chan;
 	RAII_VAR(struct ast_channel_snapshot *, snapshot, NULL, ao2_cleanup);
-	struct ast_json *variable_list = NULL;
 
 	if (!cap) {
 		ast_ari_response_alloc_failed(response);
@@ -751,8 +743,17 @@
 
 	/* Parse any query parameters out of the body parameter */
 	if (args->variables) {
+		struct ast_json *json_variables;
+
 		ast_ari_channels_originate_parse_body(args->variables, args);
-		variable_list = ast_json_object_get(args->variables, "variables");
+		json_variables = ast_json_object_get(args->variables, "variables");
+		if (json_variables) {
+			if (json_to_ast_variables(json_variables, &variables)) {
+				ast_log(AST_LOG_ERROR, "Unable to convert 'variables' in JSON body to channel variables\n");
+				ast_ari_response_alloc_failed(response);
+				return;
+			}
+		}
 	}
 
 	if (ast_strlen_zero(args->endpoint)) {
@@ -804,24 +805,19 @@
 		}
 
 		/* originate a channel, putting it into an application */
-		if (ast_pbx_outgoing_app(dialtech, cap, dialdevice, timeout, app, ast_str_buffer(appdata), NULL, 0, cid_num, cid_name, NULL, NULL, &chan)) {
+		if (ast_pbx_outgoing_app(dialtech, cap, dialdevice, timeout, app, ast_str_buffer(appdata), NULL, 0, cid_num, cid_name, variables, NULL, &chan)) {
 			ast_ari_response_alloc_failed(response);
 			return;
 		}
 	} else if (!ast_strlen_zero(args->extension)) {
 		/* originate a channel, sending it to an extension */
-		if (ast_pbx_outgoing_exten(dialtech, cap, dialdevice, timeout, S_OR(args->context, "default"), args->extension, args->priority ? args->priority : 1, NULL, 0, cid_num, cid_name, NULL, NULL, &chan, 0)) {
+		if (ast_pbx_outgoing_exten(dialtech, cap, dialdevice, timeout, S_OR(args->context, "default"), args->extension, args->priority ? args->priority : 1, NULL, 0, cid_num, cid_name, variables, NULL, &chan, 0)) {
 			ast_ari_response_alloc_failed(response);
 			return;
 		}
 	} else {
 		ast_ari_response_error(response, 400, "Bad Request",
 			"Application or extension must be specified");
-		return;
-	}
-
-	if (ari_channels_set_channel_vars(chan, variable_list, response)) {
-		/* response filled in by called function */
 		return;
 	}
 

Modified: tags/12.1.0-rc2/res/res_fax.c
URL: http://svnview.digium.com/svn/asterisk/tags/12.1.0-rc2/res/res_fax.c?view=diff&rev=409153&r1=409152&r2=409153
==============================================================================
--- tags/12.1.0-rc2/res/res_fax.c (original)
+++ tags/12.1.0-rc2/res/res_fax.c Thu Feb 27 16:15:11 2014
@@ -3952,6 +3952,13 @@
 		goto end;
 	}
 
+	if (options.minrate == 2400 && (options.modems & AST_FAX_MODEM_V27) && !(options.modems & (AST_FAX_MODEM_V34))) {
+		ast_fax_modem_to_str(options.modems, modems, sizeof(modems));
+		ast_log(LOG_WARNING, "'modems' setting '%s' is no longer accepted with 'minrate' setting %d\n", modems, options.minrate);
+		ast_log(LOG_WARNING, "'minrate' has been reset to 4800, please update res_fax.conf.\n");
+		options.minrate = 4800;
+	}
+
 	if (check_modem_rate(options.modems, options.minrate)) {
 		ast_fax_modem_to_str(options.modems, modems, sizeof(modems));
 		ast_log(LOG_ERROR, "'modems' setting '%s' is incompatible with 'minrate' setting %d\n", modems, options.minrate);

Modified: tags/12.1.0-rc2/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/tags/12.1.0-rc2/res/res_rtp_asterisk.c?view=diff&rev=409153&r1=409152&r2=409153
==============================================================================
--- tags/12.1.0-rc2/res/res_rtp_asterisk.c (original)
+++ tags/12.1.0-rc2/res/res_rtp_asterisk.c Thu Feb 27 16:15:11 2014
@@ -679,7 +679,7 @@
 		return;
 	}
 
-	if (pj_ice_sess_add_cand(rtp->ice, comp_id, transport_id, type, local_pref, &foundation, addr, addr, rel_addr, addr_len, NULL) != PJ_SUCCESS) {
+	if (pj_ice_sess_add_cand(rtp->ice, comp_id, transport_id, type, local_pref, &foundation, addr, base_addr, rel_addr, addr_len, NULL) != PJ_SUCCESS) {
 		ao2_ref(candidate, -1);
 		return;
 	}
@@ -1684,15 +1684,19 @@
 	}
 
 	/* If configured to use a STUN server to get our external mapped address do so */
-	if (stunaddr.sin_addr.s_addr && ast_sockaddr_is_ipv4(addr)) {
+	if (stunaddr.sin_addr.s_addr && ast_sockaddr_is_ipv4(addr) && count) {
 		struct sockaddr_in answer;
 
-		if (!ast_stun_request(rtp->s, &stunaddr, NULL, &answer)) {
+		if (!ast_stun_request(component == AST_RTP_ICE_COMPONENT_RTCP ? rtp->rtcp->s : rtp->s, &stunaddr, NULL, &answer)) {
+			pj_sockaddr base;
 			pj_str_t mapped = pj_str(ast_strdupa(ast_inet_ntoa(answer.sin_addr)));
 
+			/* Use the first local host candidate as the base */
+			pj_sockaddr_cp(&base, &address[0]);
+
 			pj_sockaddr_init(pj_AF_INET(), &address[0], &mapped, ntohs(answer.sin_port));
 
-			ast_rtp_ice_add_cand(rtp, component, transport, PJ_ICE_CAND_TYPE_SRFLX, 65535, &address[0], &address[0],
+			ast_rtp_ice_add_cand(rtp, component, transport, PJ_ICE_CAND_TYPE_SRFLX, 65535, &address[0], &base,
 					     NULL, pj_sockaddr_get_len(&address[0]));
 		}
 	}




More information about the asterisk-commits mailing list