Don't hangup the call for SS7 if we get an alarm
authorMatthew Fredrickson <creslin@digium.com>
Tue, 16 Oct 2007 20:55:57 +0000 (20:55 +0000)
committerMatthew Fredrickson <creslin@digium.com>
Tue, 16 Oct 2007 20:55:57 +0000 (20:55 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85957 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index d805745..4aa0daa 100644 (file)
@@ -4106,22 +4106,24 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
                        break;
                case ZT_EVENT_ALARM:
 #ifdef HAVE_PRI
-                       if (!p->pri || !p->pri->pri || (pri_get_timer(p->pri->pri, PRI_TIMER_T309) < 0)) {
-                               /* T309 is not enabled : hangup calls when alarm occurs */
-                               if (p->call) {
-                                       if (p->pri && p->pri->pri) {
-                                               if (!pri_grab(p, p->pri)) {
-                                                       pri_hangup(p->pri->pri, p->call, -1);
-                                                       pri_destroycall(p->pri->pri, p->call);
-                                                       p->call = NULL;
-                                                       pri_rel(p->pri);
+                       if (p->sig == SIG_PRI) {
+                               if (!p->pri || !p->pri->pri || (pri_get_timer(p->pri->pri, PRI_TIMER_T309) < 0)) {
+                                       /* T309 is not enabled : hangup calls when alarm occurs */
+                                       if (p->call) {
+                                               if (p->pri && p->pri->pri) {
+                                                       if (!pri_grab(p, p->pri)) {
+                                                               pri_hangup(p->pri->pri, p->call, -1);
+                                                               pri_destroycall(p->pri->pri, p->call);
+                                                               p->call = NULL;
+                                                               pri_rel(p->pri);
+                                                       } else
+                                                               ast_log(LOG_WARNING, "Failed to grab PRI!\n");
                                                } else
-                                                       ast_log(LOG_WARNING, "Failed to grab PRI!\n");
-                                       } else
-                                               ast_log(LOG_WARNING, "The PRI Call has not been destroyed\n");
+                                                       ast_log(LOG_WARNING, "The PRI Call has not been destroyed\n");
+                                       }
+                                       if (p->owner)
+                                               p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
                                }
-                               if (p->owner)
-                                       p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
                        }
                        if (p->bearer)
                                p->bearer->inalarm = 1;
@@ -4141,6 +4143,10 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
                                break;
                        }
 #endif
+#ifdef HAVE_SS7
+                       if (p->sig == SIG_SS7)
+                               break;
+#endif
                case ZT_EVENT_ONHOOK:
                        if (p->radio) {
                                p->subs[index].f.frametype = AST_FRAME_CONTROL;