[svn-commits] rmudgett: branch rmudgett/digitmanip r268652 - /team/rmudgett/digitmanip/chan...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jun 7 12:10:35 CDT 2010


Author: rmudgett
Date: Mon Jun  7 12:10:31 2010
New Revision: 268652

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=268652
Log:
Make append the MSN to the user tag when the span is a network.

Also moved AOC request code out of the middle of code parsing the dialed
number.

Modified:
    team/rmudgett/digitmanip/channels/sig_pri.c

Modified: team/rmudgett/digitmanip/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/digitmanip/channels/sig_pri.c?view=diff&rev=268652&r1=268651&r2=268652
==============================================================================
--- team/rmudgett/digitmanip/channels/sig_pri.c (original)
+++ team/rmudgett/digitmanip/channels/sig_pri.c Mon Jun  7 12:10:31 2010
@@ -4463,7 +4463,9 @@
 					if (pri->append_msn_to_user_tag) {
 						snprintf(pri->pvts[chanpos]->user_tag,
 							sizeof(pri->pvts[chanpos]->user_tag), "%s_%s",
-							pri->initial_user_tag, e->ring.callednum);
+							pri->initial_user_tag,
+							pri->nodetype == PRI_NETWORK
+								? plancallingnum : e->ring.callednum);
 					} else {
 						ast_copy_string(pri->pvts[chanpos]->user_tag,
 							pri->initial_user_tag, sizeof(pri->pvts[chanpos]->user_tag));
@@ -5745,21 +5747,6 @@
 		s = NULL;
 	}
 
-	/* Setup the user tag for party id's from this device for this call. */
-	if (p->pri->append_msn_to_user_tag) {
-		snprintf(p->user_tag, sizeof(p->user_tag), "%s_%s", p->pri->initial_user_tag,
-			S_OR(ast->connected.id.number, ""));
-	} else {
-		ast_copy_string(p->user_tag, p->pri->initial_user_tag, sizeof(p->user_tag));
-	}
-
-	/*
-	 * Replace the caller id tag from the channel creation
-	 * with the actual tag value.
-	 */
-	ast_free(ast->cid.cid_tag);
-	ast->cid.cid_tag = ast_strdup(p->user_tag);
-
 	l = NULL;
 	n = NULL;
 	if (!p->hidecallerid) {
@@ -5888,20 +5875,6 @@
 		}
 		c++;
 	}
-#if defined(HAVE_PRI_AOC_EVENTS)
-	if (ast_test_flag(&opts, OPT_AOC_REQUEST)
-		&& !ast_strlen_zero(opt_args[OPT_ARG_AOC_REQUEST])) {
-		if (strchr(opt_args[OPT_ARG_AOC_REQUEST], 's')) {
-			pri_sr_set_aoc_charging_request(sr, PRI_AOC_REQUEST_S);
-		}
-		if (strchr(opt_args[OPT_ARG_AOC_REQUEST], 'd')) {
-			pri_sr_set_aoc_charging_request(sr, PRI_AOC_REQUEST_D);
-		}
-		if (strchr(opt_args[OPT_ARG_AOC_REQUEST], 'e')) {
-			pri_sr_set_aoc_charging_request(sr, PRI_AOC_REQUEST_E);
-		}
-	}
-#endif	/* defined(HAVE_PRI_AOC_EVENTS) */
 #if defined(HAVE_PRI_SETUP_KEYPAD)
 	if (ast_test_flag(&opts, OPT_KEYPAD)
 		&& !ast_strlen_zero(opt_args[OPT_ARG_KEYPAD])) {
@@ -5932,6 +5905,37 @@
 		pri_sr_set_reversecharge(sr, PRI_REVERSECHARGE_REQUESTED);
 	}
 #endif	/* defined(HAVE_PRI_REVERSE_CHARGE) */
+#if defined(HAVE_PRI_AOC_EVENTS)
+	if (ast_test_flag(&opts, OPT_AOC_REQUEST)
+		&& !ast_strlen_zero(opt_args[OPT_ARG_AOC_REQUEST])) {
+		if (strchr(opt_args[OPT_ARG_AOC_REQUEST], 's')) {
+			pri_sr_set_aoc_charging_request(sr, PRI_AOC_REQUEST_S);
+		}
+		if (strchr(opt_args[OPT_ARG_AOC_REQUEST], 'd')) {
+			pri_sr_set_aoc_charging_request(sr, PRI_AOC_REQUEST_D);
+		}
+		if (strchr(opt_args[OPT_ARG_AOC_REQUEST], 'e')) {
+			pri_sr_set_aoc_charging_request(sr, PRI_AOC_REQUEST_E);
+		}
+	}
+#endif	/* defined(HAVE_PRI_AOC_EVENTS) */
+
+	/* Setup the user tag for party id's from this device for this call. */
+	if (p->pri->append_msn_to_user_tag) {
+		snprintf(p->user_tag, sizeof(p->user_tag), "%s_%s", p->pri->initial_user_tag,
+			p->pri->nodetype == PRI_NETWORK
+				? c + p->stripmsd + dp_strip
+				: S_OR(ast->connected.id.number, ""));
+	} else {
+		ast_copy_string(p->user_tag, p->pri->initial_user_tag, sizeof(p->user_tag));
+	}
+
+	/*
+	 * Replace the caller id tag from the channel creation
+	 * with the actual tag value.
+	 */
+	ast_free(ast->cid.cid_tag);
+	ast->cid.cid_tag = ast_strdup(p->user_tag);
 
 	ldp_strip = 0;
 	prilocaldialplan = p->pri->localdialplan - 1;




More information about the svn-commits mailing list