[asterisk-commits] bebuild: tag 12.2.0-rc3 r412874 - in /tags/12.2.0-rc3: ./ channels/ channels/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Apr 21 16:02:04 CDT 2014


Author: bebuild
Date: Mon Apr 21 16:02:00 2014
New Revision: 412874

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=412874
Log:
Merge r412823,412747,412330,412698 for ASTERISK-23487,ASTERISK-19465

Modified:
    tags/12.2.0-rc3/   (props changed)
    tags/12.2.0-rc3/CHANGES
    tags/12.2.0-rc3/ChangeLog
    tags/12.2.0-rc3/channels/chan_sip.c
    tags/12.2.0-rc3/channels/sip/include/sip.h
    tags/12.2.0-rc3/configs/sip.conf.sample
    tags/12.2.0-rc3/main/asterisk.c

Propchange: tags/12.2.0-rc3/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 21 16:02:00 2014
@@ -1,1 +1,1 @@
-/branches/12:411668,411687,411804,412074,412088,412306
+/branches/12:411668,411687,411804,412074,412088,412306,412330,412698,412747,412823

Modified: tags/12.2.0-rc3/CHANGES
URL: http://svnview.digium.com/svn/asterisk/tags/12.2.0-rc3/CHANGES?view=diff&rev=412874&r1=412873&r2=412874
==============================================================================
--- tags/12.2.0-rc3/CHANGES (original)
+++ tags/12.2.0-rc3/CHANGES Mon Apr 21 16:02:00 2014
@@ -8,6 +8,8 @@
 ===
 ==============================================================================
 
+
+
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 12.1.0 to Asterisk 12.2.0 ------------
 ------------------------------------------------------------------------------
@@ -50,6 +52,25 @@
 ------------------
  * A new set of Alembic scripts has been added for CDR tables. This will create
    a 'cdr' table with the default schema that Asterisk expects.
+
+chan_sip
+-----------
+ * SIP peers can now specify 'trust_id_outbound' which affects RPID/PAI
+   fields for prohibited callingpres information. Values are legacy, no, and
+   yes. By default, legacy is used.
+   trust_id_outbound=legacy - behavior remains the same as 1.8.26.1. When
+     dealing with prohibited callingpres and sendrpid=pai/rpid, RPID/PAI
+     headers are appended to outbound SIP messages just as they are with
+     allowed callingpres values, but data about the remote party's identity is
+     anonymized.
+     When sendrpid=rpid, only the remote party's domain is anonymized.
+   trust_id_outbound=no - when dealing with prohibited callingpres, RPID/PAI
+     headers are not sent.
+   trust_id_outbound=yes - RPID/PAI headers are applied with the full remote
+     party information in tact even for prohibited callingpres information.
+     In the case of PAI, a Privacy: id header will be appended for prohibited
+     calling information to communicate that the private information should
+     not be relayed to untrusted parties.
 
 res_hep
 ------------------
@@ -1376,8 +1397,8 @@
    a chan_pjsip configuration, but it is expected that configuration beyond
    what the script provides will be needed.
 
-
 ------------------------------------------------------------------------------
+>>>>>>> .merge-right.r412746
 --- Functionality changes from Asterisk 10 to Asterisk 11 --------------------
 ------------------------------------------------------------------------------
 

Modified: tags/12.2.0-rc3/ChangeLog
URL: http://svnview.digium.com/svn/asterisk/tags/12.2.0-rc3/ChangeLog?view=diff&rev=412874&r1=412873&r2=412874
==============================================================================
--- tags/12.2.0-rc3/ChangeLog (original)
+++ tags/12.2.0-rc3/ChangeLog Mon Apr 21 16:02:00 2014
@@ -1,3 +1,28 @@
+2014-04-21  Asterisk Development Team <asteriskteam at digium.com>
+
+	* Asterisk 12.2.0-rc3 Released.
+
+	* chan_sip: Add sendrpid trust options
+
+	  In r411189, some behavior was changed which made sendrpid behavior
+	  act in a more trusting manner by sending full user data for peers
+	  set with private caller presence in P-Asserted-Identity headers.
+	  Since this changed long time expected behaviors, we decided to pull
+	  that patch when that was pointed out by the community. Instead, this
+	  patch provides a trust_id_outbound setting which will expose the data
+	  per RFC-3325 if set to 'yes' and simply not send the PAI/RPID headers
+	  at all if set to 'no'. By default trust_id_outbound will be set to
+	  'legacy' which will preserve the behavior prior to these patches.
+	  Extra special thanks to Walter Doekes for providing advice and
+	  feedback.
+
+	* main/asterisk: Fix startup sequence for realtime features
+
+	  When ASTERISK-23265/ASTERISK-23320 was fixed, it inadvertently led to
+	  realtime features breaking. This was due to features loading prior to
+	  realtime. This patch fixes this by loading features after loading
+	  dynamic modules.
+
 2014-04-14  Asterisk Development Team <asteriskteam at digium.com>
 
 	* Asterisk 12.2.0-rc2 Released.

Modified: tags/12.2.0-rc3/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/tags/12.2.0-rc3/channels/chan_sip.c?view=diff&rev=412874&r1=412873&r2=412874
==============================================================================
--- tags/12.2.0-rc3/channels/chan_sip.c (original)
+++ tags/12.2.0-rc3/channels/chan_sip.c Mon Apr 21 16:02:00 2014
@@ -12668,6 +12668,7 @@
 	const char *privacy = NULL;
 	const char *screen = NULL;
 	struct ast_party_id connected_id;
+	const char *anonymous_string = "\"Anonymous\" <sip:anonymous at anonymous.invalid>";
 
 	if (!ast_test_flag(&p->flags[0], SIP_SENDRPID)) {
 		return 0;
@@ -12687,16 +12688,41 @@
 	}
 	lid_pres = ast_party_id_presentation(&connected_id);
 
-	fromdomain = S_OR(p->fromdomain, ast_sockaddr_stringify_host_remote(&p->ourip));
+	if (((lid_pres & AST_PRES_RESTRICTION) != AST_PRES_ALLOWED) &&
+			(ast_test_flag(&p->flags[1], SIP_PAGE2_TRUST_ID_OUTBOUND) == SIP_PAGE2_TRUST_ID_OUTBOUND_NO)) {
+		/* If pres is not allowed and we don't trust the peer, we don't apply an RPID header */
+		return 0;
+	}
+
+	fromdomain = p->fromdomain;
+	if (!fromdomain ||
+			((ast_test_flag(&p->flags[1], SIP_PAGE2_TRUST_ID_OUTBOUND) == SIP_PAGE2_TRUST_ID_OUTBOUND_YES) &&
+			!strcmp("anonymous.invalid", fromdomain))) {
+		/* If the fromdomain is NULL or if it was set to anonymous.invalid due to privacy settings and we trust the peer,
+		 * use the host IP address */
+		fromdomain = ast_sockaddr_stringify_host_remote(&p->ourip);
+	}
 
 	lid_num = ast_uri_encode(lid_num, tmp2, sizeof(tmp2), ast_uri_sip_user);
 
 	if (ast_test_flag(&p->flags[0], SIP_SENDRPID_PAI)) {
-		ast_str_set(&tmp, -1, "\"%s\" <sip:%s@%s>", lid_name, lid_num, fromdomain);
+		if (ast_test_flag(&p->flags[1], SIP_PAGE2_TRUST_ID_OUTBOUND) != SIP_PAGE2_TRUST_ID_OUTBOUND_LEGACY) {
+			/* trust_id_outbound = yes - Always give full information even if it's private, but append a privacy header
+			 * When private data is included */
+			ast_str_set(&tmp, -1, "\"%s\" <sip:%s@%s>", lid_name, lid_num, fromdomain);
+			if ((lid_pres & AST_PRES_RESTRICTION) != AST_PRES_ALLOWED) {
+				add_header(req, "Privacy", "id");
+			}
+		} else {
+			/* trust_id_outbound = legacy - behave in a non RFC-3325 compliant manner and send anonymized data when
+			 * when handling private data. */
+			if ((lid_pres & AST_PRES_RESTRICTION) == AST_PRES_ALLOWED) {
+				ast_str_set(&tmp, -1, "\"%s\" <sip:%s@%s>", lid_name, lid_num, fromdomain);
+			} else {
+				ast_str_set(&tmp, -1, "%s", anonymous_string);
+			}
+		}
 		add_header(req, "P-Asserted-Identity", ast_str_buffer(tmp));
-		if ((lid_pres & AST_PRES_RESTRICTION) != AST_PRES_ALLOWED) {
-			add_header(req, "Privacy", "id");
-		}
 	} else {
 		ast_str_set(&tmp, -1, "\"%s\" <sip:%s@%s>;party=%s", lid_name, lid_num, fromdomain, p->outgoing_call ? "calling" : "called");
 
@@ -19855,6 +19881,18 @@
 static const char *allowoverlap2str(int mode)
 {
 	return map_x_s(allowoverlapstr, mode, "<error>");
+}
+
+static const struct _map_x_s trust_id_outboundstr[] = {
+	{ SIP_PAGE2_TRUST_ID_OUTBOUND_LEGACY,  "Legacy" },
+	{ SIP_PAGE2_TRUST_ID_OUTBOUND_NO,      "No" },
+	{ SIP_PAGE2_TRUST_ID_OUTBOUND_YES,     "Yes" },
+	{ -1,                                  NULL }, /* terminator */
+};
+
+static const char *trust_id_outbound2str(int mode)
+{
+	return map_x_s(trust_id_outboundstr, mode, "<error>");
 }
 
 /*! \brief Destroy disused contexts between reloads
@@ -20532,6 +20570,7 @@
 			}
 			ast_cli(fd, "\n");
 		}
+		ast_cli(fd, "  TrustIDOutbnd: %s\n", trust_id_outbound2str(ast_test_flag(&peer->flags[1], SIP_PAGE2_TRUST_ID_OUTBOUND)));
 		ast_cli(fd, "  Subscriptions: %s\n", AST_CLI_YESNO(ast_test_flag(&peer->flags[1], SIP_PAGE2_ALLOWSUBSCRIBE)));
 		ast_cli(fd, "  Overlap dial : %s\n", allowoverlap2str(ast_test_flag(&peer->flags[1], SIP_PAGE2_ALLOWOVERLAP)));
 		if (peer->outboundproxy)
@@ -30074,6 +30113,19 @@
 	} else if (!strcasecmp(v->name, "rpid_immediate")) {
 		ast_set_flag(&mask[1], SIP_PAGE2_RPID_IMMEDIATE);
 		ast_set2_flag(&flags[1], ast_true(v->value), SIP_PAGE2_RPID_IMMEDIATE);
+	} else if (!strcasecmp(v->name, "trust_id_outbound")) {
+		ast_set_flag(&mask[1], SIP_PAGE2_TRUST_ID_OUTBOUND);
+		ast_clear_flag(&flags[1], SIP_PAGE2_TRUST_ID_OUTBOUND);
+		if (!strcasecmp(v->value, "legacy")) {
+			ast_set_flag(&flags[1], SIP_PAGE2_TRUST_ID_OUTBOUND_LEGACY);
+		} else if (ast_true(v->value)) {
+			ast_set_flag(&flags[1], SIP_PAGE2_TRUST_ID_OUTBOUND_YES);
+		} else if (ast_false(v->value)) {
+			ast_set_flag(&flags[1], SIP_PAGE2_TRUST_ID_OUTBOUND_NO);
+		} else {
+			ast_log(LOG_WARNING, "Unknown trust_id_outbound mode '%s' on line %d, using legacy\n", v->value, v->lineno);
+			ast_set_flag(&flags[1], SIP_PAGE2_TRUST_ID_OUTBOUND_LEGACY);
+		}
 	} else if (!strcasecmp(v->name, "g726nonstandard")) {
 		ast_set_flag(&mask[0], SIP_G726_NONSTANDARD);
 		ast_set2_flag(&flags[0], ast_true(v->value), SIP_G726_NONSTANDARD);

Modified: tags/12.2.0-rc3/channels/sip/include/sip.h
URL: http://svnview.digium.com/svn/asterisk/tags/12.2.0-rc3/channels/sip/include/sip.h?view=diff&rev=412874&r1=412873&r2=412874
==============================================================================
--- tags/12.2.0-rc3/channels/sip/include/sip.h (original)
+++ tags/12.2.0-rc3/channels/sip/include/sip.h Mon Apr 21 16:02:00 2014
@@ -359,13 +359,18 @@
 #define SIP_PAGE2_HAVEPEERCONTEXT           (1 << 28)   /*< Are we associated with a configured peer context? */
 #define SIP_PAGE2_USE_SRTP                  (1 << 29)   /*!< DP: Whether we should offer (only)  SRTP */
 
+#define SIP_PAGE2_TRUST_ID_OUTBOUND         (3 << 30)   /*!< DP: Do we trust the peer with private presence information? */
+#define SIP_PAGE2_TRUST_ID_OUTBOUND_LEGACY  (0 << 30)   /*!< Legacy, Do not provide private presence information, but include PAI/RPID when private */
+#define SIP_PAGE2_TRUST_ID_OUTBOUND_NO      (1 << 30)   /*!< No, Do not provide private presence information, do not include PAI/RPID when private */
+#define SIP_PAGE2_TRUST_ID_OUTBOUND_YES     (2 << 30)   /*!< Yes, provide private presence information in PAI/RPID headers */
+
 #define SIP_PAGE2_FLAGS_TO_COPY \
 	(SIP_PAGE2_ALLOWSUBSCRIBE | SIP_PAGE2_ALLOWOVERLAP | SIP_PAGE2_IGNORESDPVERSION | \
 	SIP_PAGE2_VIDEOSUPPORT | SIP_PAGE2_T38SUPPORT | SIP_PAGE2_RFC2833_COMPENSATE | \
 	SIP_PAGE2_BUGGY_MWI | SIP_PAGE2_TEXTSUPPORT | SIP_PAGE2_FAX_DETECT | \
 	SIP_PAGE2_UDPTL_DESTINATION | SIP_PAGE2_VIDEOSUPPORT_ALWAYS | SIP_PAGE2_PREFERRED_CODEC | \
 	SIP_PAGE2_RPID_IMMEDIATE | SIP_PAGE2_RPID_UPDATE | SIP_PAGE2_SYMMETRICRTP |\
-	SIP_PAGE2_Q850_REASON | SIP_PAGE2_HAVEPEERCONTEXT | SIP_PAGE2_USE_SRTP)
+	SIP_PAGE2_Q850_REASON | SIP_PAGE2_HAVEPEERCONTEXT | SIP_PAGE2_USE_SRTP | SIP_PAGE2_TRUST_ID_OUTBOUND)
 
 
 #define SIP_PAGE3_SNOM_AOC               (1 << 0)  /*!< DPG: Allow snom aoc messages */

Modified: tags/12.2.0-rc3/configs/sip.conf.sample
URL: http://svnview.digium.com/svn/asterisk/tags/12.2.0-rc3/configs/sip.conf.sample?view=diff&rev=412874&r1=412873&r2=412874
==============================================================================
--- tags/12.2.0-rc3/configs/sip.conf.sample (original)
+++ tags/12.2.0-rc3/configs/sip.conf.sample Mon Apr 21 16:02:00 2014
@@ -350,6 +350,17 @@
                                 ; transmit such UPDATE messages to it, then you must enable this option.
                                 ; Otherwise, we will have to wait until we can send a reinvite to
                                 ; transmit the information.
+;trust_id_outbound = no         ; Controls whether or not we trust this peer with private identity
+                                ; information (when the remote party has callingpres=prohib or equivalent).
+                                ; no - RPID/PAI headers will not be included for private peer information
+                                ; yes - RPID/PAI headers will include the private peer information. Privacy
+                                ;       requirements will be indicated in a Privacy header for sendrpid=pai
+                                ; legacy - RPID/PAI will be included for private peer information. In the
+                                ;       case of sendrpid=pai, private data that would be included in them
+                                ;       will be anonymized. For sendrpid=rpid, private data may be included
+                                ;       but the remote party's domain will be anonymized. The way legacy
+                                ;       behaves may violate RFC-3325, but it follows historic behavior.
+                                ; This option is set to 'legacy' by default
 ;prematuremedia=no              ; Some ISDN links send empty media frames before 
                                 ; the call is in ringing or progress state. The SIP 
                                 ; channel will then send 183 indicating early media
@@ -1219,6 +1230,7 @@
 ; autoframing
 ; insecure
 ; trustrpid
+; trust_id_outbound
 ; progressinband
 ; promiscredir
 ; useclientcode

Modified: tags/12.2.0-rc3/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/tags/12.2.0-rc3/main/asterisk.c?view=diff&rev=412874&r1=412873&r2=412874
==============================================================================
--- tags/12.2.0-rc3/main/asterisk.c (original)
+++ tags/12.2.0-rc3/main/asterisk.c Mon Apr 21 16:02:00 2014
@@ -4427,39 +4427,39 @@
 		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);
+	}
+
 	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);
 	}
 
 	if (dnsmgr_init()) {		/* Initialize the DNS manager */




More information about the asterisk-commits mailing list