[asterisk-commits] rmudgett: trunk r360311 - in /trunk: ./ channels/sig_pri.c main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 23 19:40:55 CDT 2012


Author: rmudgett
Date: Fri Mar 23 19:40:51 2012
New Revision: 360311

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=360311
Log:
Make number not available presentation also set screening to network provided.

Q.951 indicates that when the presentation indicator is "Number not
available due to interworking" for a number then the screening indicator
field should be "Network provided".

* Made ast_party_id_presentation() return AST_PRES_NUMBER_NOT_AVAILABLE
when the presentation is "Number not available due to interworking".  This
fix makes Asterisk consistent and it also makes it consistent with earlier
branches as far as this presentation value is concerned.

* Made pri_to_ast_presentation() and ast_to_pri_presentation() conversions
handle the "Number not available due to interworking" case better in
sig_pri.c.  This change is possible because the minimum required libpri
version (v1.4.11) has the necessary defines in libpri.h.
........

Merged revisions 360309 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 360310 from http://svn.asterisk.org/svn/asterisk/branches/10

Modified:
    trunk/   (props changed)
    trunk/channels/sig_pri.c
    trunk/main/channel.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: trunk/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/sig_pri.c?view=diff&rev=360311&r1=360310&r2=360311
==============================================================================
--- trunk/channels/sig_pri.c (original)
+++ trunk/channels/sig_pri.c Fri Mar 23 19:40:51 2012
@@ -447,35 +447,41 @@
 	int ast_presentation;
 
 	switch (pri_presentation) {
-	case PRES_ALLOWED_USER_NUMBER_NOT_SCREENED:
-		ast_presentation = AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED;
-		break;
-	case PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN:
-		ast_presentation = AST_PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN;
-		break;
-	case PRES_ALLOWED_USER_NUMBER_FAILED_SCREEN:
-		ast_presentation = AST_PRES_ALLOWED_USER_NUMBER_FAILED_SCREEN;
-		break;
-	case PRES_ALLOWED_NETWORK_NUMBER:
-		ast_presentation = AST_PRES_ALLOWED_NETWORK_NUMBER;
-		break;
-	case PRES_PROHIB_USER_NUMBER_NOT_SCREENED:
-		ast_presentation = AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED;
-		break;
-	case PRES_PROHIB_USER_NUMBER_PASSED_SCREEN:
-		ast_presentation = AST_PRES_PROHIB_USER_NUMBER_PASSED_SCREEN;
-		break;
-	case PRES_PROHIB_USER_NUMBER_FAILED_SCREEN:
-		ast_presentation = AST_PRES_PROHIB_USER_NUMBER_FAILED_SCREEN;
-		break;
-	case PRES_PROHIB_NETWORK_NUMBER:
-		ast_presentation = AST_PRES_PROHIB_NETWORK_NUMBER;
-		break;
-	case PRES_NUMBER_NOT_AVAILABLE:
+	case PRI_PRES_ALLOWED | PRI_PRES_USER_NUMBER_UNSCREENED:
+		ast_presentation = AST_PRES_ALLOWED | AST_PRES_USER_NUMBER_UNSCREENED;
+		break;
+	case PRI_PRES_ALLOWED | PRI_PRES_USER_NUMBER_PASSED_SCREEN:
+		ast_presentation = AST_PRES_ALLOWED | AST_PRES_USER_NUMBER_PASSED_SCREEN;
+		break;
+	case PRI_PRES_ALLOWED | PRI_PRES_USER_NUMBER_FAILED_SCREEN:
+		ast_presentation = AST_PRES_ALLOWED | AST_PRES_USER_NUMBER_FAILED_SCREEN;
+		break;
+	case PRI_PRES_ALLOWED | PRI_PRES_NETWORK_NUMBER:
+		ast_presentation = AST_PRES_ALLOWED | AST_PRES_NETWORK_NUMBER;
+		break;
+
+	case PRI_PRES_RESTRICTED | PRI_PRES_USER_NUMBER_UNSCREENED:
+		ast_presentation = AST_PRES_RESTRICTED | AST_PRES_USER_NUMBER_UNSCREENED;
+		break;
+	case PRI_PRES_RESTRICTED | PRI_PRES_USER_NUMBER_PASSED_SCREEN:
+		ast_presentation = AST_PRES_RESTRICTED | AST_PRES_USER_NUMBER_PASSED_SCREEN;
+		break;
+	case PRI_PRES_RESTRICTED | PRI_PRES_USER_NUMBER_FAILED_SCREEN:
+		ast_presentation = AST_PRES_RESTRICTED | AST_PRES_USER_NUMBER_FAILED_SCREEN;
+		break;
+	case PRI_PRES_RESTRICTED | PRI_PRES_NETWORK_NUMBER:
+		ast_presentation = AST_PRES_RESTRICTED | AST_PRES_NETWORK_NUMBER;
+		break;
+
+	case PRI_PRES_UNAVAILABLE | PRI_PRES_USER_NUMBER_UNSCREENED:
+	case PRI_PRES_UNAVAILABLE | PRI_PRES_USER_NUMBER_PASSED_SCREEN:
+	case PRI_PRES_UNAVAILABLE | PRI_PRES_USER_NUMBER_FAILED_SCREEN:
+	case PRI_PRES_UNAVAILABLE | PRI_PRES_NETWORK_NUMBER:
 		ast_presentation = AST_PRES_NUMBER_NOT_AVAILABLE;
 		break;
+
 	default:
-		ast_presentation = AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED;
+		ast_presentation = AST_PRES_RESTRICTED | AST_PRES_USER_NUMBER_UNSCREENED;
 		break;
 	}
 
@@ -496,35 +502,41 @@
 	int pri_presentation;
 
 	switch (ast_presentation) {
-	case AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED:
-		pri_presentation = PRES_ALLOWED_USER_NUMBER_NOT_SCREENED;
-		break;
-	case AST_PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN:
-		pri_presentation = PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN;
-		break;
-	case AST_PRES_ALLOWED_USER_NUMBER_FAILED_SCREEN:
-		pri_presentation = PRES_ALLOWED_USER_NUMBER_FAILED_SCREEN;
-		break;
-	case AST_PRES_ALLOWED_NETWORK_NUMBER:
-		pri_presentation = PRES_ALLOWED_NETWORK_NUMBER;
-		break;
-	case AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED:
-		pri_presentation = PRES_PROHIB_USER_NUMBER_NOT_SCREENED;
-		break;
-	case AST_PRES_PROHIB_USER_NUMBER_PASSED_SCREEN:
-		pri_presentation = PRES_PROHIB_USER_NUMBER_PASSED_SCREEN;
-		break;
-	case AST_PRES_PROHIB_USER_NUMBER_FAILED_SCREEN:
-		pri_presentation = PRES_PROHIB_USER_NUMBER_FAILED_SCREEN;
-		break;
-	case AST_PRES_PROHIB_NETWORK_NUMBER:
-		pri_presentation = PRES_PROHIB_NETWORK_NUMBER;
-		break;
-	case AST_PRES_NUMBER_NOT_AVAILABLE:
+	case AST_PRES_ALLOWED | AST_PRES_USER_NUMBER_UNSCREENED:
+		pri_presentation = PRI_PRES_ALLOWED | PRI_PRES_USER_NUMBER_UNSCREENED;
+		break;
+	case AST_PRES_ALLOWED | AST_PRES_USER_NUMBER_PASSED_SCREEN:
+		pri_presentation = PRI_PRES_ALLOWED | PRI_PRES_USER_NUMBER_PASSED_SCREEN;
+		break;
+	case AST_PRES_ALLOWED | AST_PRES_USER_NUMBER_FAILED_SCREEN:
+		pri_presentation = PRI_PRES_ALLOWED | PRI_PRES_USER_NUMBER_FAILED_SCREEN;
+		break;
+	case AST_PRES_ALLOWED | AST_PRES_NETWORK_NUMBER:
+		pri_presentation = PRI_PRES_ALLOWED | PRI_PRES_NETWORK_NUMBER;
+		break;
+
+	case AST_PRES_RESTRICTED | AST_PRES_USER_NUMBER_UNSCREENED:
+		pri_presentation = PRI_PRES_RESTRICTED | PRI_PRES_USER_NUMBER_UNSCREENED;
+		break;
+	case AST_PRES_RESTRICTED | AST_PRES_USER_NUMBER_PASSED_SCREEN:
+		pri_presentation = PRI_PRES_RESTRICTED | PRI_PRES_USER_NUMBER_PASSED_SCREEN;
+		break;
+	case AST_PRES_RESTRICTED | AST_PRES_USER_NUMBER_FAILED_SCREEN:
+		pri_presentation = PRI_PRES_RESTRICTED | PRI_PRES_USER_NUMBER_FAILED_SCREEN;
+		break;
+	case AST_PRES_RESTRICTED | AST_PRES_NETWORK_NUMBER:
+		pri_presentation = PRI_PRES_RESTRICTED | PRI_PRES_NETWORK_NUMBER;
+		break;
+
+	case AST_PRES_UNAVAILABLE | AST_PRES_USER_NUMBER_UNSCREENED:
+	case AST_PRES_UNAVAILABLE | AST_PRES_USER_NUMBER_PASSED_SCREEN:
+	case AST_PRES_UNAVAILABLE | AST_PRES_USER_NUMBER_FAILED_SCREEN:
+	case AST_PRES_UNAVAILABLE | AST_PRES_NETWORK_NUMBER:
 		pri_presentation = PRES_NUMBER_NOT_AVAILABLE;
 		break;
+
 	default:
-		pri_presentation = PRES_PROHIB_USER_NUMBER_NOT_SCREENED;
+		pri_presentation = PRI_PRES_RESTRICTED | PRI_PRES_USER_NUMBER_UNSCREENED;
 		break;
 	}
 

Modified: trunk/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/channel.c?view=diff&rev=360311&r1=360310&r2=360311
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Fri Mar 23 19:40:51 2012
@@ -1948,6 +1948,9 @@
 	/* Select the wining presentation value. */
 	if (name_priority < number_priority) {
 		number_value = name_value;
+	}
+	if (number_value == AST_PRES_UNAVAILABLE) {
+		return AST_PRES_NUMBER_NOT_AVAILABLE;
 	}
 
 	return number_value | number_screening;




More information about the asterisk-commits mailing list