From f0a7adb3094bae29b1e81dbc6eba9f484fac9390 Mon Sep 17 00:00:00 2001
From: Richard Mudgett <rmudgett@digium.com>
Date: Wed, 5 May 2010 22:22:14 +0000
Subject: [PATCH] Avoid a crash on SS7 channels.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@261405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 channels/chan_dahdi.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 73ef3dcff9..3c48be7a30 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -12083,9 +12083,9 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf,
 
 		if (!here) {
 			tmp->locallyblocked = tmp->remotelyblocked = 0;
-			switch (chan_sig) {
+			switch (tmp->sig) {
+#if defined(HAVE_PRI)
 			case SIG_PRI_LIB_HANDLE_CASES:
-			case SIG_SS7:
 				tmp->inservice = 0;
 #if defined(HAVE_PRI_SERVICE_MESSAGES)
 				((struct sig_pri_chan *) tmp->sig_pvt)->service_status = 0;
@@ -12117,6 +12117,12 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf,
 				}
 #endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
 				break;
+#endif	/* defined(HAVE_PRI) */
+#if defined(HAVE_SS7)
+			case SIG_SS7:
+				tmp->inservice = 0;
+				break;
+#endif	/* defined(HAVE_SS7) */
 			default:
 				 /* We default to in service on protocols that don't have a reset */
 				tmp->inservice = 1;
-- 
GitLab