[svn-commits] rmudgett: trunk r202755 - /trunk/channels/chan_misdn.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jun 23 16:38:24 CDT 2009


Author: rmudgett
Date: Tue Jun 23 16:38:21 2009
New Revision: 202755

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=202755
Log:
Make outgoing_colp=2 misdn.conf port parameter not send redirecting or transfer messages.

If the outgoing_colp parameter is set to not send COLP information, then
it does not make sense to send redirecting or transfer messages announcing
new COLP information that is blocked.  The service provider may supply the
listed number for that line when it passes the messages to the next hop.
Why tell the switch that these events happened when the information is
otherwise suppressed?

Also blocked the number of previous redirects that may have occurred to
calls going out the port when outgoing_colp is 2.

Follow on to JIRA ABE-1853.

Modified:
    trunk/channels/chan_misdn.c

Modified: trunk/channels/chan_misdn.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_misdn.c?view=diff&rev=202755&r1=202754&r2=202755
==============================================================================
--- trunk/channels/chan_misdn.c (original)
+++ trunk/channels/chan_misdn.c Tue Jun 23 16:38:21 2009
@@ -6052,9 +6052,11 @@
 	}
 	switch (bc->outgoing_colp) {
 	case 1:/* restricted */
+		bc->redirecting.to.presentation = 1;/* restricted */
+		break;
 	case 2:/* blocked */
-		bc->redirecting.to.presentation = 1;/* restricted */
-		break;
+		/* Don't tell the remote party that the call was transferred. */
+		return;
 	default:
 		break;
 	}
@@ -6079,14 +6081,6 @@
 			bc->fac_out.u.EctInform.RedirectionPresent = 1;/* Must be present when status is active */
 			misdn_PresentedNumberUnscreened_fill(&bc->fac_out.u.EctInform.Redirection,
 				&bc->redirecting.to);
-			switch (bc->outgoing_colp) {
-			case 2:/* blocked */
-				/* Block the number going out */
-				bc->fac_out.u.EctInform.Redirection.Type = 1;/* presentationRestricted */
-				break;
-			default:
-				break;
-			}
 
 			/* Send message */
 			print_facility(&bc->fac_out, bc);
@@ -6179,9 +6173,11 @@
 	misdn_copy_redirecting_from_ast(bc, ast);
 	switch (bc->outgoing_colp) {
 	case 1:/* restricted */
+		bc->redirecting.to.presentation = 1;/* restricted */
+		break;
 	case 2:/* blocked */
-		bc->redirecting.to.presentation = 1;/* restricted */
-		break;
+		/* Don't tell the remote party that the call was redirected. */
+		return;
 	default:
 		break;
 	}
@@ -6211,14 +6207,6 @@
 			bc->fac_out.u.DivertingLegInformation1.SubscriptionOption = 2;/* notificationWithDivertedToNr */
 			bc->fac_out.u.DivertingLegInformation1.DivertedToPresent = 1;
 			misdn_PresentedNumberUnscreened_fill(&bc->fac_out.u.DivertingLegInformation1.DivertedTo, &bc->redirecting.to);
-			switch (bc->outgoing_colp) {
-			case 2:/* blocked */
-				/* Block the number going out */
-				bc->fac_out.u.DivertingLegInformation1.DivertedTo.Type = 1;/* presentationRestricted */
-				break;
-			default:
-				break;
-			}
 			print_facility(&bc->fac_out, bc);
 			misdn_lib_send_event(bc, EVENT_FACILITY);
 		}
@@ -6405,13 +6393,13 @@
 		}
 #if defined(AST_MISDN_ENHANCEMENTS)
 		if (newbc->redirecting.from.number[0] && misdn_lib_is_ptp(port)) {
+			if (newbc->redirecting.count < 1) {
+				newbc->redirecting.count = 1;
+			}
+
 			/* Create DivertingLegInformation2 facility */
 			newbc->fac_out.Function = Fac_DivertingLegInformation2;
 			newbc->fac_out.u.DivertingLegInformation2.InvokeID = ++misdn_invoke_id;
-			newbc->fac_out.u.DivertingLegInformation2.DiversionCounter =
-				newbc->redirecting.count;
-			newbc->fac_out.u.DivertingLegInformation2.DiversionReason =
-				misdn_to_diversion_reason(newbc->redirecting.reason);
 			newbc->fac_out.u.DivertingLegInformation2.DivertingPresent = 1;
 			misdn_PresentedNumberUnscreened_fill(
 				&newbc->fac_out.u.DivertingLegInformation2.Diverting,
@@ -6420,12 +6408,20 @@
 			case 2:/* blocked */
 				/* Block the number going out */
 				newbc->fac_out.u.DivertingLegInformation2.Diverting.Type = 1;/* presentationRestricted */
+
+				/* Don't tell about any previous diversions or why for that matter. */
+				newbc->fac_out.u.DivertingLegInformation2.DiversionCounter = 1;
+				newbc->fac_out.u.DivertingLegInformation2.DiversionReason = 0;/* unknown */
 				break;
 			default:
+				newbc->fac_out.u.DivertingLegInformation2.DiversionCounter =
+					newbc->redirecting.count;
+				newbc->fac_out.u.DivertingLegInformation2.DiversionReason =
+					misdn_to_diversion_reason(newbc->redirecting.reason);
 				break;
 			}
 			newbc->fac_out.u.DivertingLegInformation2.OriginalCalledPresent = 0;
-			if (1 < newbc->redirecting.count) {
+			if (1 < newbc->fac_out.u.DivertingLegInformation2.DiversionCounter) {
 				newbc->fac_out.u.DivertingLegInformation2.OriginalCalledPresent = 1;
 				newbc->fac_out.u.DivertingLegInformation2.OriginalCalled.Type = 2;/* numberNotAvailableDueToInterworking */
 			}




More information about the svn-commits mailing list