dujunchen 2 месяцев назад
Родитель
Сommit
c90d32df34

+ 38 - 0
1.ini

@@ -0,0 +1,38 @@
+1.PA 打断(检查优先级,通过之后结束当前任务------一个报警和多个报警)
+CPA:挂断当前CPA任务
+
+PAD-ICP:hold已经连接的PAD,超时计时器不启动,当PA挂断时启动超时30秒计时器(再次hold PAD时将PAD插入队首,超时先被转到OCC)
+PAD-TMS:hold PAD(同上)
+PAD-OCC:挂断已经连接的PAD,hold其他PAD,超时计时器不启动,当PA挂断时启动超时0秒计时器
+
+
+2.司机对讲打断(检查优先级,通过之后挂对端ICP------一个报警和多个报警)
+CPA:挂端对端ICP
+
+PAD-ICP:hold已经连接的PAD,超时计时器不启动,当cabcab挂断的时候启动计时器(再次hold PAD时将PAD插入队首,超时先被转到OCC)
+PAD-TMS:(同上)
+PAD-OCC:挂断对端ICP,司机对讲挂断之后将ICP恢复到OCC-PAD状态 
+
+
+司机对讲发起打断其他低优先级或者和其他低优先级共同执行时,暂存之前任务的优先级标记,待到司机对讲结束之后再设置回。
+EMG---ICP
+OPA---ICP
+CPA---ICP
+
+
+
+
+
+
+3.ICP端优先级机制
+
+打断报警的时候发送DTMF,延时500ms再发起呼叫
+打断其他业务则直接挂断,再发起呼叫
+
+
+4.CPA和EMG被打断之后,当高优先级结束之后恢复到CPA或EMG状态,CPA 和EMG的各种状态维持问题,如何恢复EMG的优先级状态################################
+EMG :  confID + runningpriority+ runingtype
+CPA :  
+
+
+5.异常处理,新开一个线程监听AMI事件,根据业务类型判断终端是否是异常状态,如果终端中途掉异常退出则尝试重新建立业务

+ 2 - 2
cmd/main.go

@@ -28,8 +28,6 @@ func main() {
 	//gin.SetMode(gin.ReleaseMode)
 	//gin.SetMode(gin.DebugMode)
 
-	lfshook.NewLogger().Logger.SetReportCaller(true)
-
 	lfshook.NewLogger().Logger.SetFormatter(&logrus.TextFormatter{
 		ForceQuote:      false,
 		FullTimestamp:   true,
@@ -60,8 +58,10 @@ func main() {
 				DisableColors:   true,
 				ForceQuote:      true,
 				TimestampFormat: "2006-01-02 15:04:05",
+				PadLevelText:    false,
 			},
 		))
+		lfshook.NewLogger().Logger.SetReportCaller(true)
 	}
 
 	app.StartApp()

+ 11 - 3
internal/app/ami/action/call.go

@@ -128,7 +128,7 @@ func InterruptRunningTask(toRunTask string) {
 	var taskName string
 	var ok bool
 
-	lfshook.NewLogger().Infof("InterruptRunningTask toRuntask:%s RunningTask:%s ", toRunTask, taskName)
+	lfshook.NewLogger().Infof("InterruptRunningTask toRuntask:%s  ", toRunTask)
 
 	if toRunTask != "PA" && toRunTask != "PAD-ICP" && toRunTask != "PAD-TMS" { // ignore C2C
 		taskName, task, ok = priority.RegistryTask.HighestPriorityRunningTask1()
@@ -500,9 +500,17 @@ func SetPadTimer() {
 	if res.Calls != "0" {
 
 		lfshook.NewLogger().Infof("PAD SetPadTimer Set QueueTimer timeout 30s !")
-		active.SetTimer = true
+		//active.SetTimer = true
+		//lfshook.NewLogger().Logger.Infof("=========Start PAD timer !=============")
+		if active.QueueTimer != nil {
+			if active.QueueTimer.Stop() {
+				lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+			} else {
+				lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+			}
+		}
+		//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

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

@@ -36,11 +36,12 @@ func HandleAMI(event map[string]string) {
 				//lfshook.NewLogger().Infof("===PA interrupt PAD====== ")
 
 				InterruptRunningTask("PA")
-
+				time.Sleep(time.Millisecond * 100) //wait endpoimt release
 			case "*": //Cab cab interrupt PAD
 				//lfshook.NewLogger().Infof("===Cab cab interrupt PAD====== ")
 
 				InterruptRunningTask("C2C")
+				time.Sleep(time.Millisecond * 100) //wait endpoimt release
 			}
 		}
 
@@ -58,8 +59,8 @@ func HandleAMI(event map[string]string) {
 				if priority.CheckPriority("ManuPa") {
 					//hangup others if priority is higher
 					lfshook.NewLogger().Infof("UserEvent event :PA start")
-					InterruptRunningTask("PA") //PA interrupt other
-
+					InterruptRunningTask("PA")         //PA interrupt other
+					time.Sleep(time.Millisecond * 100) //wait endpoimt release
 				} else {
 					Hangup(event["CallerIDNum"]) //lowwer priority ,hangup caller
 				}
@@ -75,8 +76,8 @@ func HandleAMI(event map[string]string) {
 					}
 
 					//hangup others if priority is higher
-					InterruptRunningTask("CPA") //CPA interrupt other
-
+					InterruptRunningTask("CPA")        //CPA interrupt other
+					time.Sleep(time.Millisecond * 100) //wait endpoimt release
 				} else {
 					Hangup(event["CallerIDNum"]) //lowwer priority ,hangup caller
 				}
@@ -92,7 +93,7 @@ func HandleAMI(event map[string]string) {
 				if ok {
 					if taskName == "PAD-ICP" || taskName == "PAD-TMS" || taskName == "PA" {
 						InterruptRunningTask("C2C")
-
+						time.Sleep(time.Millisecond * 100) //wait endpoimt release
 					} else {
 						lfshook.NewLogger().Infof("CabCab  hangup other the one caller %s", event["CallerIDNum"])
 						if event["CallerIDNum"] == "2311" {
@@ -218,6 +219,7 @@ func HandleAMI(event map[string]string) {
 
 			// OCC hangup detected, hangup other running channels
 			InterruptRunningTask("PAD-OCC")
+			time.Sleep(time.Millisecond * 100) //wait endpoimt release
 
 			res, _ := QueueStatus("0301", "") // check OCC queue ,if empty PAD end
 			if res.Calls == "0" {             //OCC queue is empty
@@ -303,52 +305,52 @@ func HandleAMI(event map[string]string) {
 				res, _ := QueueStatus("0300", "")  // check ICP queue ,if empty PAD end
 				res1, _ := QueueStatus("0301", "") // check OCC queue ,if empty PAD end
 
-				lfshook.NewLogger().Infof("ICP Queue calls:%s  OCC Queue calls:%s", res.Calls, res1.Calls)
-				if res.Calls == "0" && res1.Calls == "0" {
+				lfshook.NewLogger().Infof("===Hangup  PAD====== ICP Queue calls:%s  OCC Queue calls:%s", res.Calls, res1.Calls)
+				//if res.Calls == "0" && res1.Calls == "0" {
 
-					if priority.PADStart == 1 {
-						//SetPadTimer()
-						alstatus.PaStatus("", "PAD", "end")
-						priority.PADStart = 0
-						priority.PADTMSStart = 0
+				if priority.PADStart == 1 {
+					//SetPadTimer()
+					alstatus.PaStatus("", "PAD", "end")
+					priority.PADStart = 0
+					priority.PADTMSStart = 0
 
-						//clean confbridge
-						//PAD-ICP
-						taskTmp, ok := priority.RegistryTask.Get("PAD-ICP")
-						if ok {
-							ConfbridgeKick(taskTmp.ConfbridgeID, "all")
-						}
-						priority.RegistryTask.StopAndUnregister("PAD-ICP")
+					//clean confbridge
+					//PAD-ICP
+					taskTmp, ok := priority.RegistryTask.Get("PAD-ICP")
+					if ok {
+						ConfbridgeKick(taskTmp.ConfbridgeID, "all")
+					}
+					priority.RegistryTask.StopAndUnregister("PAD-ICP")
 
-						// PAD-TMS
-						taskTmp, ok = priority.RegistryTask.Get("PAD-TMS")
-						if ok {
-							ConfbridgeKick(taskTmp.ConfbridgeID, "all")
-						}
-						priority.RegistryTask.StopAndUnregister("PAD-TMS")
+					// PAD-TMS
+					taskTmp, ok = priority.RegistryTask.Get("PAD-TMS")
+					if ok {
+						ConfbridgeKick(taskTmp.ConfbridgeID, "all")
+					}
+					priority.RegistryTask.StopAndUnregister("PAD-TMS")
 
-						//PAD-OCC
-						taskTmp, ok = priority.RegistryTask.Get("PAD-OCC")
-						if ok {
-							ConfbridgeKick(taskTmp.ConfbridgeID, "all")
-						}
-						priority.RegistryTask.StopAndUnregister("PAD-OCC")
-
-						//check resume
-						taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
-						if ok {
-							if taskName == "EMG" {
-								EMGConfbridgeReinvite(task.ConfbridgeID)
-							} else if taskName == "CPA" {
-								CPAConfbridgeReinvite(task.ConfbridgeID)
-							}
+					//PAD-OCC
+					taskTmp, ok = priority.RegistryTask.Get("PAD-OCC")
+					if ok {
+						ConfbridgeKick(taskTmp.ConfbridgeID, "all")
+					}
+					priority.RegistryTask.StopAndUnregister("PAD-OCC")
+
+					//check resume
+					taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
+					if ok {
+						if taskName == "EMG" {
+							EMGConfbridgeReinvite(task.ConfbridgeID)
+						} else if taskName == "CPA" {
+							CPAConfbridgeReinvite(task.ConfbridgeID)
 						}
 					}
-
-					priority.ICPAnswer = 0
-					priority.OCCAnswer = 0
-					break
 				}
+
+				priority.ICPAnswer = 0
+				priority.OCCAnswer = 0
+				break
+				//}
 			}
 		}
 
@@ -385,9 +387,17 @@ func HandleAMI(event map[string]string) {
 				//lfshook.NewLogger().Infof("==2=QueueCallerJoin===runing:%d=====toRun:=%d==Status:%s", taskTmp, toRunpriority, event["ChannelStateDesc"])
 
 				//if (priority.RunningTypePriority > toRunpriority || priority.RunningTypePriority == 0) && event["ChannelStateDesc"] != "Up" {
-				active.SetTimer = true
+				//active.SetTimer = true
+				//lfshook.NewLogger().Logger.Infof("=========Start PAD timer !=============")
+				if active.QueueTimer != nil {
+					if active.QueueTimer.Stop() {
+						lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+					} else {
+						lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+					}
+				}
+				//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
@@ -430,7 +440,8 @@ func HandleAMI(event map[string]string) {
 		if utils.IsPAIU(event["CallerIDNum"]) && event["Queue"] == "0301" && priority.OCCAnswer == 0 { // The first PAD to OCC ,caller is PAD
 
 			if priority.CheckPriority("PAD-OCC") {
-				InterruptRunningTask("PAD-OCC") //PAD-OCC interrupt other
+				InterruptRunningTask("PAD-OCC")    //PAD-OCC interrupt other
+				time.Sleep(time.Millisecond * 100) //wait endpoimt release
 				priority.OCCAnswer = 1
 
 				time.Sleep(time.Millisecond * 300)
@@ -453,7 +464,7 @@ func HandleAMI(event map[string]string) {
 
 	case "ConfbridgeJoin":
 		lfshook.NewLogger().Infof("=========%+v", event["Event"])
-
+		lfshook.NewLogger().Infof("=========%+v", event)
 		//set priority and send PA status msg
 		switch event["CallerIDName"] {
 		case "EMG":
@@ -472,9 +483,12 @@ func HandleAMI(event map[string]string) {
 				alstatus.PaStatus("", "EMG", "start")
 				//check PAD timer
 				if priority.AllTasks.PADOCC.Priority > priority.AllTasks.EMG.Priority {
-					if active.SetTimer {
-						active.QueueTimer.Stop()
-						active.SetTimer = false
+					if active.QueueTimer != nil {
+						if active.QueueTimer.Stop() {
+							lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+						} else {
+							lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+						}
 					}
 				}
 
@@ -496,9 +510,12 @@ func HandleAMI(event map[string]string) {
 
 				//check PAD timer
 				if priority.AllTasks.PADOCC.Priority > priority.AllTasks.SPC.Priority {
-					if active.SetTimer {
-						active.QueueTimer.Stop()
-						active.SetTimer = false
+					if active.QueueTimer != nil {
+						if active.QueueTimer.Stop() {
+							lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+						} else {
+							lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+						}
 					}
 				}
 
@@ -519,9 +536,12 @@ func HandleAMI(event map[string]string) {
 				alstatus.PaStatus("", "DCS", "start")
 				//check PAD timer
 				if priority.AllTasks.PADOCC.Priority > priority.AllTasks.DCS.Priority {
-					if active.SetTimer {
-						active.QueueTimer.Stop()
-						active.SetTimer = false
+					if active.QueueTimer != nil {
+						if active.QueueTimer.Stop() {
+							lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+						} else {
+							lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+						}
 					}
 				}
 
@@ -544,9 +564,12 @@ func HandleAMI(event map[string]string) {
 
 				//check PAD timer
 				if priority.AllTasks.PADOCC.Priority > priority.AllTasks.STN.Priority {
-					if active.SetTimer {
-						active.QueueTimer.Stop()
-						active.SetTimer = false
+					if active.QueueTimer != nil {
+						if active.QueueTimer.Stop() {
+							lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+						} else {
+							lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+						}
 					}
 				}
 
@@ -569,9 +592,12 @@ func HandleAMI(event map[string]string) {
 
 				//check PAD timer
 				if priority.AllTasks.PADOCC.Priority > priority.AllTasks.CHK.Priority {
-					if active.SetTimer {
-						active.QueueTimer.Stop()
-						active.SetTimer = false
+					if active.QueueTimer != nil {
+						if active.QueueTimer.Stop() {
+							lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+						} else {
+							lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+						}
 					}
 				}
 				return
@@ -592,9 +618,12 @@ func HandleAMI(event map[string]string) {
 
 				//check PAD timer
 				if priority.AllTasks.PADOCC.Priority > priority.AllTasks.VOL.Priority {
-					if active.SetTimer {
-						active.QueueTimer.Stop()
-						active.SetTimer = false
+					if active.QueueTimer != nil {
+						if active.QueueTimer.Stop() {
+							lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+						} else {
+							lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+						}
 					}
 				}
 
@@ -625,9 +654,12 @@ func HandleAMI(event map[string]string) {
 
 			//check PAD timer
 			if priority.AllTasks.PADOCC.Priority > priority.AllTasks.PA.Priority {
-				if active.SetTimer {
-					active.QueueTimer.Stop()
-					active.SetTimer = false
+				if active.QueueTimer != nil {
+					if active.QueueTimer.Stop() {
+						lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+					} else {
+						lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+					}
 				}
 			}
 
@@ -648,9 +680,12 @@ func HandleAMI(event map[string]string) {
 
 			//check PAD timer
 			if priority.AllTasks.PADOCC.Priority > priority.AllTasks.CPA.Priority {
-				if active.SetTimer {
-					active.QueueTimer.Stop()
-					active.SetTimer = false
+				if active.QueueTimer != nil {
+					if active.QueueTimer.Stop() {
+						lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+					} else {
+						lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+					}
 				}
 			}
 
@@ -905,9 +940,12 @@ func HandleAMI(event map[string]string) {
 
 			//check PAD timer
 			if priority.AllTasks.PADOCC.Priority > priority.AllTasks.C2C.Priority {
-				if active.SetTimer {
-					active.QueueTimer.Stop()
-					active.SetTimer = false
+				if active.QueueTimer != nil {
+					if active.QueueTimer.Stop() {
+						lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+					} else {
+						lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+					}
 				}
 			}
 

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

@@ -10,10 +10,10 @@ import (
 // var ActiveCab string
 var CabNum string
 var ActivedCab = "1"
-
+var PADTimeout = 30
 var Master = false
 
-var SetTimer = false
+// var SetTimer = false
 var QueueTimer *time.Timer = nil
 
 // 挂断所有报警器

+ 46 - 20
internal/app/stc/broadcast/stc-broadcast.go

@@ -90,6 +90,7 @@ func processPacket(packet []byte) {
 		if active.ActivedCab != "" {
 			if priority.CheckPriority("STN") {
 				action.InterruptRunningTask("STN") //STN interrupt other
+				time.Sleep(time.Millisecond * 100) //wait endpoimt release
 				StationAnn(packet)
 			} else {
 				alstatus.PaStatus("", "STN", "refuse")
@@ -99,6 +100,7 @@ func processPacket(packet []byte) {
 		if active.ActivedCab != "" {
 			if priority.CheckPriority("SPC") {
 				action.InterruptRunningTask("SPC") //SPC interrupt other
+				time.Sleep(time.Millisecond * 100) //wait endpoimt release
 				SpecialAnn(packet)
 			} else {
 				alstatus.PaStatus("", "SPC", "refuse")
@@ -108,6 +110,7 @@ func processPacket(packet []byte) {
 		if active.ActivedCab != "" {
 			if priority.CheckPriority("EMG") {
 				action.InterruptRunningTask("EMG") //EMG interrupt other
+				time.Sleep(time.Millisecond * 100) //wait endpoimt release
 				EmgMsg(packet)
 			} else {
 				alstatus.PaStatus("", "EMG", "refuse")
@@ -120,6 +123,7 @@ func processPacket(packet []byte) {
 		if active.ActivedCab != "" {
 			if priority.CheckPriority("DCS") {
 				action.InterruptRunningTask("DCS") //DCS interrupt other
+				time.Sleep(time.Millisecond * 100) //wait endpoimt release
 				DcsAnn(packet)
 			} else {
 				alstatus.PaStatus("", "DCS", "refuse")
@@ -129,6 +133,7 @@ func processPacket(packet []byte) {
 		if active.ActivedCab != "" {
 			if priority.CheckPriority("CHK") {
 				action.InterruptRunningTask("CHK") //CHK interrupt other
+				time.Sleep(time.Millisecond * 100) //wait endpoimt release
 				SelfCheck(packet)
 			} else {
 				alstatus.PaStatus("", "CHK", "refuse")
@@ -138,6 +143,7 @@ func processPacket(packet []byte) {
 		if active.ActivedCab != "" {
 			if priority.CheckPriority("VOL") {
 				action.InterruptRunningTask("VOL") //VOL interrupt other
+				time.Sleep(time.Millisecond * 100) //wait endpoimt release
 				ToneTest(packet)
 			} else {
 				alstatus.PaStatus("", "VOL", "refuse")
@@ -149,13 +155,17 @@ func processPacket(packet []byte) {
 			//Before Answer PAD
 			if packet[8] == 0x01 {
 				action.InterruptRunningTask("PAD-TMS") //PAD-ICP interrupt other
+				time.Sleep(time.Millisecond * 100)     //wait endpoimt release
 			}
 
 			AlarmHandleTMS(packet)
 
-			if active.SetTimer {
-				active.QueueTimer.Stop()
-				active.SetTimer = false
+			if active.QueueTimer != nil {
+				if active.QueueTimer.Stop() {
+					lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+				} else {
+					lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+				}
 			}
 
 		} else {
@@ -165,8 +175,8 @@ func processPacket(packet []byte) {
 	case 0x0b: // reset all PAD
 		AlarmHoldResetAll(packet[8]) // reset all pad
 
-	//case 0x0c: // recored config
-	//	RecordStorageConf(packet[8:]) // RCD setting
+	case 0x0c: // Set PAD time oute
+		PadTimeOutSetting(packet[8:]) // timeout setting
 
 	case 0x0d: // ICP answer PAD
 		if priority.CheckPriority("PAD-ICP") {
@@ -174,11 +184,15 @@ func processPacket(packet []byte) {
 			//Before Answer PAD
 			if packet[8] == 0x01 {
 				action.InterruptRunningTask("PAD-ICP") //PAD-ICP interrupt other
+				time.Sleep(time.Millisecond * 100)     //wait endpoimt release
 			}
 
-			if active.SetTimer {
-				active.QueueTimer.Stop()
-				active.SetTimer = false
+			if active.QueueTimer != nil {
+				if active.QueueTimer.Stop() {
+					lfshook.NewLogger().Logger.Infof("=========Release PAD timer true !============")
+				} else {
+					lfshook.NewLogger().Logger.Infof("=========Release PAD timer false ! ============")
+				}
 			}
 
 			AlarmHandleICP(packet)
@@ -193,6 +207,15 @@ func processPacket(packet []byte) {
 	}
 }
 
+func PadTimeOutSetting(data []byte) {
+
+	Seconds := data[7]
+	if Seconds != 0 {
+		active.PADTimeout = int(Seconds)
+	}
+
+}
+
 // STN , 自动报站广播
 func StationAnn(data []byte) (err error) {
 
@@ -304,30 +327,31 @@ func AnnStop(data [4]byte) {
 	switch data[0] {
 	case 0x03:
 
-		action.HangupTask("DCS") //STOP DCS
-
+		action.HangupTask("DCS")           //STOP DCS
+		time.Sleep(time.Millisecond * 100) //wait endpoimt release
 	case 0x04:
 
-		action.HangupTask("EMG") //STOP EMG
-
+		action.HangupTask("EMG")           //STOP EMG
+		time.Sleep(time.Millisecond * 100) //wait endpoimt release
 	case 0x07:
 
-		action.HangupTask("SPC") //STOP SPC
-
+		action.HangupTask("SPC")           //STOP SPC
+		time.Sleep(time.Millisecond * 100) //wait endpoimt release
 	case 0x08:
 
-		action.HangupTask("STN") //STOP STN
-
+		action.HangupTask("STN")           //STOP STN
+		time.Sleep(time.Millisecond * 100) //wait endpoimt release
 	case 0x09:
 
-		action.HangupTask("CHK") //STOP CHK
-
+		action.HangupTask("CHK")           //STOP CHK
+		time.Sleep(time.Millisecond * 100) //wait endpoimt release
 	case 0x0a:
 
-		action.HangupTask("VOL") //STOP VOL
-
+		action.HangupTask("VOL")           //STOP VOL
+		time.Sleep(time.Millisecond * 100) //wait endpoimt release
 	default:
 		action.InterruptRunningTask("")
+		time.Sleep(time.Millisecond * 100) //wait endpoimt release
 	}
 }
 
@@ -446,6 +470,7 @@ func AlarmHandleICP(data []byte) {
 			lfshook.NewLogger().Info(err)
 		}
 		action.InterruptRunningTask("")
+		time.Sleep(time.Millisecond * 100) //wait endpoimt release
 		//action.HangupICP()
 
 	case 0x03: //hangup
@@ -532,4 +557,5 @@ func AlarmHoldResetAll(handler byte) {
 
 	//hangup running task
 	action.InterruptRunningTask("AlarmHoldResetAll") //Reset PAD ALL
+	time.Sleep(time.Millisecond * 100)               //wait endpoimt release
 }