diff --git a/CHANGES b/CHANGES
index a59aff12e07cc5dfd724b3bb4aca9f344a3d4495..533c45cac5dd07d3a733f96310f9cd8b01c1dd67 100644
--- a/CHANGES
+++ b/CHANGES
@@ -189,6 +189,8 @@ libpri channel driver (chan_dahdi) DAHDI changes
    will update the redirecting-to presentation (COLR) when it becomes available.
  * Added Reverse Charging Indication receipt & transmission (requires latest
    LibPRI).
+ * Added the ability to ignore calls that are not in a Multiple Subscriber
+   Number (MSN) list for PTMP CPE interfaces.
 
 Asterisk Manager Interface
 --------------------------
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 57715cc39aa6f9fcdbe9bf23fab0adf39533856a..7f4c7f6d1aa140c16f6a1a9e76b5bad0a09b7619 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -10843,6 +10843,7 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf,
 						pris[span].pri.inbanddisconnect = conf->pri.pri.inbanddisconnect;
 #endif
 						pris[span].pri.facilityenable = conf->pri.pri.facilityenable;
+						ast_copy_string(pris[span].pri.msn_list, conf->pri.pri.msn_list, sizeof(pris[span].pri.msn_list));
 						ast_copy_string(pris[span].pri.idledial, conf->pri.pri.idledial, sizeof(pris[span].pri.idledial));
 						ast_copy_string(pris[span].pri.idleext, conf->pri.pri.idleext, sizeof(pris[span].pri.idleext));
 						ast_copy_string(pris[span].pri.internationalprefix, conf->pri.pri.internationalprefix, sizeof(pris[span].pri.internationalprefix));
@@ -15614,6 +15615,9 @@ static int process_dahdi(struct dahdi_chan_conf *confp, const char *cat, struct
 					ast_log(LOG_ERROR, "Unknown switchtype '%s' at line %d.\n", v->value, v->lineno);
 					return -1;
 				}
+			} else if (!strcasecmp(v->name, "msn")) {
+				ast_copy_string(confp->pri.pri.msn_list, v->value,
+					sizeof(confp->pri.pri.msn_list));
 			} else if (!strcasecmp(v->name, "nsf")) {
 				if (!strcasecmp(v->value, "sdn"))
 					confp->pri.pri.nsf = PRI_NSF_SDN;
diff --git a/channels/sig_pri.c b/channels/sig_pri.c
index 9276ebb155a4a3742950c54fb70a00b5573a2ef0..7dcbd679379c612c4bc3cda5899f169bda5eb094 100644
--- a/channels/sig_pri.c
+++ b/channels/sig_pri.c
@@ -999,6 +999,39 @@ void pri_event_noalarm(struct sig_pri_pri *pri, int index, int before_start_pri)
 		pri_restart(pri->dchans[index]);
 }
 
+/*!
+ * \internal
+ * \brief Determine if the given extension matches one of the MSNs in the pattern list.
+ * \since 1.6.3
+ *
+ * \param msn_patterns Comma separated list of MSN patterns to match.
+ * \param exten Extension to match in the MSN list.
+ *
+ * \retval 1 if matches.
+ * \retval 0 if no match.
+ */
+static int sig_pri_msn_match(const char *msn_patterns, const char *exten)
+{
+	char *pattern;
+	char *msn_list;
+	char *list_tail;
+
+	msn_list = strdupa(msn_patterns);
+
+	list_tail = NULL;
+	pattern = strtok_r(msn_list, ",", &list_tail);
+	while (pattern) {
+		pattern = ast_strip(pattern);
+		if (!ast_strlen_zero(pattern) && ast_extension_match(pattern, exten)) {
+			/* Extension matched the pattern. */
+			return 1;
+		}
+		pattern = strtok_r(NULL, ",", &list_tail);
+	}
+	/* Did not match any pattern in the list. */
+	return 0;
+}
+
 /*!
  * \internal
  * \brief Obtain the sig_pri owner channel lock if the owner exists.
@@ -1621,6 +1654,15 @@ static void *pri_dchannel(void *vpri)
 				break;
 #endif
 			case PRI_EVENT_RING:
+				if (!ast_strlen_zero(pri->msn_list)
+					&& !sig_pri_msn_match(pri->msn_list, e->ring.callednum)) {
+					/* The call is not for us so ignore it. */
+					ast_verb(3,
+						"Ignoring call to '%s' on span %d.  Its not in the MSN list: %s\n",
+						e->ring.callednum, pri->span, pri->msn_list);
+					pri_destroycall(pri->pri, e->ring.call);
+					break;
+				}
 				if (e->ring.channel == -1)
 					chanpos = pri_find_empty_chan(pri, 1);
 				else
diff --git a/channels/sig_pri.h b/channels/sig_pri.h
index 91de16f9aaa4ac9e6207d1e8efeea90067971ebe..40dad9d86c12fb43694f3a8d0f57f99461988934 100644
--- a/channels/sig_pri.h
+++ b/channels/sig_pri.h
@@ -195,6 +195,7 @@ struct sig_pri_pri {
 	char privateprefix[20];					/*!< for private dialplans */
 	char unknownprefix[20];					/*!< for unknown dialplans */
 	long resetinterval;						/*!< Interval (in seconds) for resetting unused channels */
+	char msn_list[AST_MAX_EXTENSION];		/*!< Comma separated list of MSNs to handle.  Empty if disabled. */
 	char idleext[AST_MAX_EXTENSION];		/*!< Where to idle extra calls */
 	char idlecontext[AST_MAX_CONTEXT];		/*!< What context to use for idle */
 	char idledial[AST_MAX_EXTENSION];		/*!< What to dial before dumping */
diff --git a/configs/chan_dahdi.conf.sample b/configs/chan_dahdi.conf.sample
index fe81874cafc15ff614578015ed6528ef4d1b279c..5f8d2b292a469c98dfe1b4f2b7925ffdb9205636 100644
--- a/configs/chan_dahdi.conf.sample
+++ b/configs/chan_dahdi.conf.sample
@@ -67,6 +67,14 @@
 ;
 ;switchtype=euroisdn
 ;
+; MSNs for ISDN spans.  Asterisk will listen for the listed numbers on
+; incoming calls and ignore any calls not listed.
+; Here you can give a comma separated list of numbers or dialplan extension
+; patterns.  An empty list disables MSN matching to allow any incoming call.
+; Only set on PTMP CPE side of ISDN span if needed.
+; The default is an empty list.
+;msn=
+;
 ; Some switches (AT&T especially) require network specific facility IE.
 ; Supported values are currently 'none', 'sdn', 'megacom', 'tollfreemegacom', 'accunet'
 ;