dujunchen 1 ay önce
ebeveyn
işleme
52fec23e1d

+ 5 - 0
internal/app/ami/action/call.go

@@ -176,6 +176,11 @@ func InterruptRunningTask(toRunTask string) {
 		if toRunTask == "STN" {
 			return
 		}
+
+		if toRunTask == "DCS" {
+			ConfbridgeKick(task.ConfbridgeID, "all")
+		}
+		time.Sleep(time.Millisecond * 200)
 	case "STN":
 		if toRunTask == "DCS" {
 			return

+ 32 - 12
internal/app/ami/action/index.go

@@ -42,8 +42,8 @@ func HandleAMI(event map[string]string) {
 				lfshook.NewLogger().Infof("===Cab cab interrupt PAD and====== ")
 
 				//InterruptRunningTask("C2C")
-				Hangup("3211")
-				Hangup("3281")
+				Hangup("2311")
+				Hangup("2381")
 				time.Sleep(time.Millisecond * 100) //wait endpoimt release
 			}
 		}
@@ -70,7 +70,11 @@ func HandleAMI(event map[string]string) {
 
 			} else if utils.IsIO(event["CallerIDNum"]) { // CPA
 				if priority.CheckPriority("CPA") {
-					if active.RadioFault == 0 {
+
+					lfshook.NewLogger().Infof("========event:%s  ========devide:%d", event["Event"], active.TrainDevide)
+					if active.TrainDevide == 1 || active.RadioFault == 1 { // 列车没有断开的情况下限制如下;列车断开之后CPA无任何限制
+						lfshook.NewLogger().Infof("===active.TrainDevide == 1 || active.RadioFault == 1====")
+					} else {
 						if active.ActivedCab == "" { //No active Signal on both side,Hangup caller
 							Hangup(event["CallerIDNum"])
 						} else if active.ActivedCab == "1" && event["CallerIDNum"] == "1411" {
@@ -78,7 +82,7 @@ func HandleAMI(event map[string]string) {
 						} else if active.ActivedCab == "8" && event["CallerIDNum"] == "1481" {
 							Hangup(event["CallerIDNum"])
 						}
-					} //Radio 故障时CPA无任何发起限制
+					}
 
 					//hangup others if priority is higher
 					InterruptRunningTask("CPA")        //CPA interrupt other
@@ -538,17 +542,33 @@ func HandleAMI(event map[string]string) {
 				priority.OCCAnswer = 1
 
 				time.Sleep(time.Millisecond * 300)
-				if active.ActivedCab == "1" && ExtenStatus("1411") == "Idle" { //check active and OCC status
 
-					alstatus.AlarmStatus(event["CallerIDNum"], "connect")
-					go RedirectInQueue(event["Channel"], "1411", "pad-page-occ-icp", event["CallerIDNum"]) //PAD Page(OCC+ICPs)
-					go Dial("0401", "0512", "pad-rule-pacus-occ", "ano1", "ano1", "1")                     // PACUs dial OCC1
+				if active.TrainDevide == 0 { //列车没有断开
+					if active.ActivedCab == "1" && ExtenStatus("1411") == "Idle" { //check active and OCC status
 
-				} else if active.ActivedCab == "8" && ExtenStatus("1481") == "Idle" {
+						alstatus.AlarmStatus(event["CallerIDNum"], "connect")
+						go RedirectInQueue(event["Channel"], "1411", "pad-page-occ-icp", event["CallerIDNum"]) //PAD Page(OCC+ICPs)
+						go Dial("0401", "0512", "pad-rule-pacus-occ", "ano1", "ano1", "1")                     // PACUs dial OCC1
+
+					} else if active.ActivedCab == "8" && ExtenStatus("1481") == "Idle" {
 
-					alstatus.AlarmStatus(event["CallerIDNum"], "connect")
-					go RedirectInQueue(event["Channel"], "1481", "pad-page-occ-icp", event["CallerIDNum"]) //PAD Page(OCC+ICPs)
-					go Dial("0401", "0512", "pad-rule-pacus-occ", "ano8", "ano8", "8")                     // PACUs dial OCC8
+						alstatus.AlarmStatus(event["CallerIDNum"], "connect")
+						go RedirectInQueue(event["Channel"], "1481", "pad-page-occ-icp", event["CallerIDNum"]) //PAD Page(OCC+ICPs)
+						go Dial("0401", "0512", "pad-rule-pacus-occ", "ano8", "ano8", "8")                     // PACUs dial OCC8
+					}
+				} else { //列车断开模式下
+					if active.ActivedCab == "1" && ExtenStatus("1411") == "Idle" { //check active and OCC status
+
+						alstatus.AlarmStatus(event["CallerIDNum"], "connect")
+						go RedirectInQueue(event["Channel"], "1411", "pad-page-occ-icp", event["CallerIDNum"]) //PAD Page(OCC+ICPs)
+						go Dial("0401", "0512", "pad-rule-pacus-occ", "ano1", "ano1", "1")                     // PACUs dial OCC1
+
+					} else if active.ActivedCab == "8" && ExtenStatus("1481") == "Idle" {
+
+						alstatus.AlarmStatus(event["CallerIDNum"], "connect")
+						go RedirectInQueue(event["Channel"], "1481", "pad-page-occ-icp", event["CallerIDNum"]) //PAD Page(OCC+ICPs)
+						go Dial("0401", "0512", "pad-rule-pacus-occ", "ano8", "ano8", "8")                     // PACUs dial OCC8
+					}
 				}
 			} else {
 				lfshook.NewLogger().Infof("====PAD-OCC Priority false===")

+ 2 - 2
internal/app/stc/broadcast/stc-broadcast.go

@@ -388,8 +388,8 @@ func Active(data [3]byte) {
 	//Set train info
 	if TrainInfo != 0 {
 		//Get train devide info
-		DevideInfo := TrainInfo & 0x10
-		if DevideInfo == 1 {
+		DevideInfo := TrainInfo & 0x20
+		if DevideInfo == 0x20 {
 			active.TrainDevide = 1
 
 			active.Master = true //列车断开,设置两边都Master

+ 5 - 1
internal/app/stc/priority/index.go

@@ -143,11 +143,15 @@ func CheckPriority(runType string) bool {
 			case "DCS":
 				if taskRuning.RunType == "STN" {
 					return false
+				} else {
+					return true
 				}
-				//return true
+
 			case "STN":
 				if taskRuning.RunType == "DCS" {
 					return false
+				} else {
+					return true
 				}
 			case "CHK":
 				return true