2 İşlemeler 09621e8a81 ... 27f9a11a99

Yazar SHA1 Mesaj Tarih
  root 27f9a11a99 update 1 ay önce
  root 1393d59a65 fix occ-pad hangup 1 ay önce

+ 9 - 7
internal/app/ami/action/call.go

@@ -28,7 +28,7 @@ func InActiveHangup() {
 		HangupTask("PA")
 		HangupTask("CPA")
 		HangupTask("VOL")
-		HangupTask("PAD-OCC")
+		//HangupTask("PAD-OCC")
 	} else {
 		HangupTask("PA")
 		HangupTask("PAD-OCC")
@@ -583,12 +583,12 @@ func SetPadTimer() {
 		//lfshook.NewLogger().Logger.Infof("=========Start PAD timer !=============")
 		if active.QueueTimer != nil {
 			if active.QueueTimer.Stop() {
-				lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+				//lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
 			} else {
-				lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+				//lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
 			}
 		}
-		lfshook.NewLogger().Logger.Infof("=========Start PAD timer !======%d=======", active.PADTimeout)
+		//lfshook.NewLogger().Logger.Infof("=========Start PAD timer !======%d=======", active.PADTimeout)
 		active.QueueTimer = time.AfterFunc(time.Duration(active.PADTimeout)*time.Second, func() { // check the PAD 30s timeout
 			//active.QueueTimer = time.AfterFunc(30*time.Second, func() { // check the PAD 30s timeout
 			//if both not active , return
@@ -621,7 +621,7 @@ func SetPadTimer() {
 					for _, caller := range resCaller.Entrys {
 						priority.ICPAnswer = 0
 						//lfshook.NewLogger().Infof("====SetPadTimer==QueueTimer==2=")
-						lfshook.NewLogger().Infof("Q300==SetPadTimer==Redirect to 0301 entry:%s=Pos:%s==", caller.CallerIDNum, caller.Position)
+						//lfshook.NewLogger().Infof("Q300==SetPadTimer==Redirect to 0301 entry:%s=Pos:%s==", caller.CallerIDNum, caller.Position)
 						//order by pos
 						RedirectInQueue(caller.CallerIDNum, "0301", "queues-occ", caller.CallerIDNum) // redirect All ICP-PAD redirect to OCC queue
 						time.Sleep(time.Millisecond * 100)                                            //200 ms delay
@@ -668,6 +668,8 @@ func ConfbridgeKick(confnum, channel string) (res map[string]string, err error)
 }
 
 func CPAConfbridgeKick(confnum string) (res map[string]string, err error) {
+	utils.LoggerDebug.Printf("CPA CPAConfbridgeKick , kick all members .")
+
 	chans, err := ConfbridgeList(confnum)
 	if err != nil {
 		return nil, errors.New(res["Message"])
@@ -690,7 +692,7 @@ func CPAConfbridgeReinvite(confID string) {
 }
 
 func EMGConfbridgeKick(confnum string) (res map[string]string, err error) {
-
+	utils.LoggerDebug.Printf("EMG EMGConfbridgeKick , kick all members .")
 	chans, err := ConfbridgeList(confnum)
 	if err != nil {
 		return nil, errors.New(res["Message"])
@@ -863,8 +865,8 @@ func WaitTaskCreate(task string, args ...string) { //arg1(task chan)
 			priorityPA := priority.GetPriorityByKey("PA")
 			//获取将要创建的任务的优先级
 			priorityTask := priority.GetPriorityByKey(task)
-			//比较优先级,确定是否终止正在创建的任务
 
+			//比较优先级,确定是否终止正在创建的任务
 			if priorityPA < priorityTask {
 				utils.LoggerDebug.Printf("%s check task PA creating , hangup CPA %s ", task, args[0])
 				//结束task(CPA)

+ 114 - 97
internal/app/ami/action/index.go

@@ -326,21 +326,21 @@ func HandleAMI(event map[string]string) {
 				priority.OCCAnswer = 0
 				priority.PADOccStart = 0
 
-				/*//clean confbridge
+				//clean confbridge
 				taskTmp, _ := priority.RegistryTask.Get("PAD-OCC")
+				priority.RegistryTask.StopAndUnregister("PAD-OCC")
 				ConfbridgeKick(taskTmp.ConfbridgeID, "all")
 
-					//check resume
-						priority.RegistryTask.StopAndUnregister("PAD-OCC")
-						taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
-						if ok {
-							if taskName == "EMG" {
-								EMGConfbridgeReinvite(task.ConfbridgeID)
-							} else if taskName == "CPA" {
-								CPAConfbridgeReinvite(task.ConfbridgeID)
-							}
-						}
-				*/
+				//check resume
+				taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
+				if ok {
+					if taskName == "EMG" {
+						EMGConfbridgeReinvite(task.ConfbridgeID)
+					} else if taskName == "CPA" {
+						CPAConfbridgeReinvite(task.ConfbridgeID)
+					}
+				}
+
 				//break
 			} else { //OCC queue is not empty
 
@@ -353,62 +353,77 @@ func HandleAMI(event map[string]string) {
 
 				//time.Sleep(time.Millisecond * 100) //wait io idle
 				//lfshook.NewLogger().Infof("====Start OCC-PAD===next==%+v", res)
-				if active.ActivedCab == "1" && ExtenStatus("1411") == "Idle" { //check active and OCC status
-					time.Sleep(time.Second)
-					PADChan := ""
-
-					if res.Entrys != nil {
-						for _, chanEntry := range res.Entrys {
-							lfshook.NewLogger().Infof("PAD answered by OCC1 pos:%s chan:%s", chanEntry.Position, chanEntry.Channel)
-
-							if chanEntry.Position == "1" {
-								PADChan = chanEntry.Channel
-								utils.LoggerDebug.Printf("PAD-OCC , Get the first PAD(%s) in the queue !", PADChan)
-								break
+				if active.TrainDevide == 0 { //列车没有断开
+					if (active.ActivedCab == "1" && ExtenStatus("1411") == "Idle") || (active.ActivedCab == "" && active.ActivedCabDelay == "1" && ExtenStatus("1411") == "Idle") { //check active and OCC status
+						time.Sleep(time.Second)
+						PADChan := ""
+
+						if res.Entrys != nil {
+							for _, chanEntry := range res.Entrys {
+								lfshook.NewLogger().Infof("PAD answered by OCC1 pos:%s chan:%s", chanEntry.Position, chanEntry.Channel)
+
+								if chanEntry.Position == "1" {
+									PADChan = chanEntry.Channel
+									utils.LoggerDebug.Printf("PAD-OCC , Get the first PAD(%s) in the queue !", PADChan)
+									break
+								}
 							}
-						}
 
-						if PADChan != "" {
-							Ext := strings.Split(strings.Split(res.Entrys[0].Channel, "/")[1], "-")[0]
-							alstatus.AlarmStatus(Ext, "connect")
+							if PADChan != "" {
+								Ext := strings.Split(strings.Split(res.Entrys[0].Channel, "/")[1], "-")[0]
+								alstatus.AlarmStatus(Ext, "connect")
 
-							utils.LoggerDebug.Printf("PAD goto OCC1 , redirect %s to OCC1 !", PADChan)
-							go RedirectInQueue(PADChan, "1411", "pad-page-occ-icp", Ext) //PAD Page(OCC+ICPs)
+								utils.LoggerDebug.Printf("PAD goto OCC1 , redirect %s to OCC1 !", PADChan)
+								go RedirectInQueue(PADChan, "1411", "pad-page-occ-icp", Ext) //PAD Page(OCC+ICPs)
 
-							go Dial("0401", "0512", "pad-rule-pacus-occ", "ano1", "ano1", "1") // PACUs dial OCC1
-						} else {
-							lfshook.NewLogger().Infof("OCC-QueueStatus PADCchan NULL")
-							utils.LoggerDebug.Printf("PAD-OCC , OCC Queue Status PADCchan return NULL .")
-						}
-					}
-					break
-				} else if active.ActivedCab == "8" && ExtenStatus("1481") == "Idle" {
-					time.Sleep(time.Second)
-					PADChan := ""
-
-					if res.Entrys != nil {
-						for _, chanEntry := range res.Entrys {
-							lfshook.NewLogger().Infof("PAD answered by OCC1 pos:%s chan:%s", chanEntry.Position, chanEntry.Channel)
-							if chanEntry.Position == "1" {
-								PADChan = chanEntry.Channel
-								utils.LoggerDebug.Printf("PAD-OCC , Get the first PAD(%s) in the queue !", PADChan)
-								break
+								go Dial("0401", "0512", "pad-rule-pacus-occ", "ano1", "ano1", "1") // PACUs dial OCC1
+							} else {
+								lfshook.NewLogger().Infof("OCC-QueueStatus PADCchan NULL")
+								utils.LoggerDebug.Printf("PAD-OCC , OCC Queue Status PADCchan return NULL .")
 							}
 						}
+						break
+					} else if (active.ActivedCab == "8" && ExtenStatus("1481") == "Idle") || (active.ActivedCab == "" && active.ActivedCabDelay == "8" && ExtenStatus("1481") == "Idle") {
+						time.Sleep(time.Second)
+						PADChan := ""
+
+						if res.Entrys != nil {
+							for _, chanEntry := range res.Entrys {
+								lfshook.NewLogger().Infof("PAD answered by OCC1 pos:%s chan:%s", chanEntry.Position, chanEntry.Channel)
+								if chanEntry.Position == "1" {
+									PADChan = chanEntry.Channel
+									utils.LoggerDebug.Printf("PAD-OCC , Get the first PAD(%s) in the queue !", PADChan)
+									break
+								}
+							}
 
-						if PADChan != "" {
-							Ext := strings.Split(strings.Split(res.Entrys[0].Channel, "/")[1], "-")[0]
-							alstatus.AlarmStatus(Ext, "connect")
+							if PADChan != "" {
+								Ext := strings.Split(strings.Split(res.Entrys[0].Channel, "/")[1], "-")[0]
+								alstatus.AlarmStatus(Ext, "connect")
 
-							utils.LoggerDebug.Printf("PAD goto OCC8 , redirect %s to OCC8 !", PADChan)
-							go RedirectInQueue(PADChan, "1481", "pad-page-occ-icp", Ext) //PAD Page(OCC+ICPs)
+								utils.LoggerDebug.Printf("PAD goto OCC8 , redirect %s to OCC8 !", PADChan)
+								go RedirectInQueue(PADChan, "1481", "pad-page-occ-icp", Ext) //PAD Page(OCC+ICPs)
 
-							go Dial("0401", "0512", "pad-rule-pacus-occ", "ano8", "ano8", "8") // PACUs dial OCC1
-						} else {
-							lfshook.NewLogger().Infof("OCC QueueStatus PADCchan NULL")
+								go Dial("0401", "0512", "pad-rule-pacus-occ", "ano8", "ano8", "8") // PACUs dial OCC1
+							} else {
+								lfshook.NewLogger().Infof("OCC QueueStatus PADCchan NULL")
+							}
 						}
+						break
+					}
+				} 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
 					}
-					break
 				}
 			}
 		}
@@ -417,9 +432,9 @@ func HandleAMI(event map[string]string) {
 
 			number := strings.Split(strings.Split(event["Channel"], "-")[0], "/")[1]
 
-			//lfshook.NewLogger().Infof("===hangup PAD =======================%s", number)
+			lfshook.NewLogger().Infof("===hangup PAD ===NUM:%s=================listAllTask:%+v===", number, priority.RegistryTask.ListAll())
 
-			if utils.IsPAIU(number) {
+			if utils.IsPAIU(number) { //pad and io hangup
 
 				//clean confbridge & clean task info
 				//PAD-ICP
@@ -443,6 +458,7 @@ func HandleAMI(event map[string]string) {
 					priority.RegistryTask.StopAndUnregister("PAD-OCC")
 				}
 
+				lfshook.NewLogger().Infof("===hangup PAD ===NUM:%s========2222=========listAllTask:%+v===", number, priority.RegistryTask.ListAll())
 				//Check PAD END
 				res, _ := QueueStatus("0300", "")  // check ICP queue ,if empty PAD end
 				res1, _ := QueueStatus("0301", "") // check OCC queue ,if empty PAD end
@@ -538,9 +554,9 @@ func HandleAMI(event map[string]string) {
 				//lfshook.NewLogger().Logger.Infof("=========Start PAD timer !=============")
 				if active.QueueTimer != nil {
 					if active.QueueTimer.Stop() {
-						lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+						//lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
 					} else {
-						lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+						//lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
 					}
 				}
 				//lfshook.NewLogger().Logger.Infof("=========Start PAD timer !======%d=======", active.PADTimeout)
@@ -548,9 +564,9 @@ func HandleAMI(event map[string]string) {
 				active.QueueTimer = time.AfterFunc(time.Duration(active.PADTimeout)*time.Second, func() { // check the PAD 30s timeout
 					//active.QueueTimer = time.AfterFunc(30*time.Second, func() { // check the PAD 30s timeout
 					//if both not active , return
-					if active.ActivedCab == "" {
-						return
-					}
+					//if active.ActivedCab == "" {
+					//	return
+					//}
 
 					res, err := QueueStatus("0301", "") // check OCC queue , if empty OCC-PAD start
 					if err != nil {
@@ -609,20 +625,20 @@ func HandleAMI(event map[string]string) {
 
 				time.Sleep(time.Millisecond * 300)
 
-				//if active.TrainDevide == 0 { //列车没有断开
-				if active.ActivedCab == "1" && ExtenStatus("1411") == "Idle" { //check active and OCC status
-					utils.LoggerDebug.Printf("PAD %s goto OCC1 .", event["CallerIDNum"])
-					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" {
-					utils.LoggerDebug.Printf("PAD %s goto OCC8 .", event["CallerIDNum"])
-					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.TrainDevide == 0 { //列车没有断开
+					if (active.ActivedCab == "1" && ExtenStatus("1411") == "Idle") || (active.ActivedCab == "" && active.ActivedCabDelay == "1" && ExtenStatus("1411") == "Idle") { //check active and OCC status
+						utils.LoggerDebug.Printf("PAD %s goto OCC1 .", event["CallerIDNum"])
+						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") || (active.ActivedCab == "" && active.ActivedCabDelay == "8" && ExtenStatus("1481") == "Idle") {
+						utils.LoggerDebug.Printf("PAD %s goto OCC8 .", event["CallerIDNum"])
+						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")
@@ -635,7 +651,8 @@ func HandleAMI(event map[string]string) {
 						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===")
 			}
@@ -673,9 +690,9 @@ func HandleAMI(event map[string]string) {
 				if priority.AllTasks.PADOCC.Priority > priority.AllTasks.EMG.Priority {
 					if active.QueueTimer != nil {
 						if active.QueueTimer.Stop() {
-							lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+							//lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
 						} else {
-							lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+							//lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
 						}
 					}
 				}
@@ -704,9 +721,9 @@ func HandleAMI(event map[string]string) {
 				if priority.AllTasks.PADOCC.Priority > priority.AllTasks.SPC.Priority {
 					if active.QueueTimer != nil {
 						if active.QueueTimer.Stop() {
-							lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+							//lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
 						} else {
-							lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+							//lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
 						}
 					}
 				}
@@ -735,9 +752,9 @@ func HandleAMI(event map[string]string) {
 				if priority.AllTasks.PADOCC.Priority > priority.AllTasks.DCS.Priority {
 					if active.QueueTimer != nil {
 						if active.QueueTimer.Stop() {
-							lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+							//lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
 						} else {
-							lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+							//lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
 						}
 					}
 				}
@@ -767,9 +784,9 @@ func HandleAMI(event map[string]string) {
 				if priority.AllTasks.PADOCC.Priority > priority.AllTasks.STN.Priority {
 					if active.QueueTimer != nil {
 						if active.QueueTimer.Stop() {
-							lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+							//lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
 						} else {
-							lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+							//lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
 						}
 					}
 				}
@@ -799,9 +816,9 @@ func HandleAMI(event map[string]string) {
 				if priority.AllTasks.PADOCC.Priority > priority.AllTasks.CHK.Priority {
 					if active.QueueTimer != nil {
 						if active.QueueTimer.Stop() {
-							lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+							//lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
 						} else {
-							lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+							//lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
 						}
 					}
 				}
@@ -829,9 +846,9 @@ func HandleAMI(event map[string]string) {
 				if priority.AllTasks.PADOCC.Priority > priority.AllTasks.VOL.Priority {
 					if active.QueueTimer != nil {
 						if active.QueueTimer.Stop() {
-							lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+							//lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
 						} else {
-							lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+							//lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
 						}
 					}
 				}
@@ -869,9 +886,9 @@ func HandleAMI(event map[string]string) {
 			if priority.AllTasks.PADOCC.Priority > priority.AllTasks.PA.Priority {
 				if active.QueueTimer != nil {
 					if active.QueueTimer.Stop() {
-						lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+						//lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
 					} else {
-						lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+						//lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
 					}
 				}
 			}
@@ -901,9 +918,9 @@ func HandleAMI(event map[string]string) {
 			if priority.AllTasks.PADOCC.Priority > priority.AllTasks.CPA.Priority {
 				if active.QueueTimer != nil {
 					if active.QueueTimer.Stop() {
-						lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+						//lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
 					} else {
-						lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+						//lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
 					}
 				}
 			}
@@ -1189,9 +1206,9 @@ func HandleAMI(event map[string]string) {
 			if priority.AllTasks.PADOCC.Priority > priority.AllTasks.C2C.Priority {
 				if active.QueueTimer != nil {
 					if active.QueueTimer.Stop() {
-						lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+						//lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
 					} else {
-						lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+						//lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
 					}
 				}
 			}

+ 2 - 0
internal/app/stc/active/index.go

@@ -15,6 +15,8 @@ var ActivedCab = "1"
 var PADTimeout = 30
 var Master = false
 
+var ActivedCabDelay = "1"
+
 var TrainDevide = 0
 var RadioFault = 0
 

+ 5 - 1
internal/app/stc/broadcast/stc-broadcast.go

@@ -467,7 +467,7 @@ func Active(data [3]byte) {
 	master := int(data[1])
 	TrainInfo := int(data[2])
 
-	lfshook.NewLogger().Logger.Infof("=====active:%x======cab=%s Master=%d=====data:%x======", Signal, active.CabNum, master, data)
+	lfshook.NewLogger().Logger.Infof("=====active:%x======cab=%s Master=%d=====data:%x======ActivedCabDelay:%x", Signal, active.CabNum, master, data, active.ActivedCabDelay)
 
 	//Set Master
 	if master == 1 && active.CabNum == "1" {
@@ -558,6 +558,8 @@ func Active(data [3]byte) {
 		//active signal from 8 to 1
 		if active.ActivedCab == "8" || active.ActivedCab == "" {
 			active.ActivedCab = "1"
+			active.ActivedCabDelay = "1"
+
 			action.InActiveHangup()
 		}
 
@@ -565,6 +567,8 @@ func Active(data [3]byte) {
 		//active signal from 1 to 8
 		if active.ActivedCab == "1" || active.ActivedCab == "" {
 			active.ActivedCab = "8"
+			active.ActivedCabDelay = "8"
+
 			action.InActiveHangup()
 		}
 

+ 2 - 2
internal/app/stc/priority/index.go

@@ -145,9 +145,9 @@ func CheckPriority(runType string) bool {
 
 			switch runType {
 			case "PAD-ICP":
-				return true
+				return false
 			case "PAD-TMS":
-				return true
+				return false
 			case "EMG":
 				return true
 			case "SPC":