Pārlūkot izejas kodu

修正pad接通太频繁导致接听无效的问题,修正PA打断PAD-OCC无法恢复CPA的问题

root 3 nedēļas atpakaļ
vecāks
revīzija
073f0eb082

+ 13 - 2
internal/app/ami/action/call.go

@@ -329,8 +329,19 @@ func InterruptRunningTask(toRunTask string) string {
 			//lfshook.NewLogger().Infof("===InterruptRunningTask=Hangup connected PAD=== ")
 			Hangup(task.RunChannel)
 
-			//3. Hangup OI & ICP
-			HangupIO()
+			//3. interrupt OCC-PAD Hangup OI
+			if active.ActivedCab == "1" {
+				Hangup("1411")
+			} else if active.ActivedCab == "8" {
+				Hangup("1481")
+			} else {
+				if active.ActivedCabDelay == "1" {
+					Hangup("1411")
+				} else if active.ActivedCabDelay == "8" {
+					Hangup("1481")
+				}
+			}
+
 			HangupAllLocalChan()
 			ConfbridgeKick(task.ConfbridgeID, "all")
 

+ 1 - 1
internal/app/ami/action/index.go

@@ -28,7 +28,7 @@ func HandleAMI(event map[string]string) {
 	case "DTMFBegin": //ICP interrupt PAD
 		lfshook.NewLogger().Infof("=========%s====caller:%s=====digit:%s==", event["Event"], event["CallerIDNum"], event["Digit"])
 
-		if utils.IsICP(event["CallerIDNum"]) && event["Exten"] != "" {
+		if utils.IsICP(event["CallerIDNum"]) && event["Exten"] != "" && event["Direction"] == "Received" {
 
 			//PA interrupt PAD
 			switch event["Digit"] {

+ 0 - 23
internal/app/stc/broadcast/stc-broadcast.go

@@ -341,23 +341,11 @@ func processPacket(packet []byte) {
 	case 0x0e: //TMS answer PAD
 
 		handler := packet[8]
-		key := suppressKey("exten", handler)
 
 		//Drop other handler in 2 sec
 		//PACUs---call---->ICP1
 		//PAD---->Chanspy(WEq)-->ICP1;PAD--->Call---->ICP2
 		if handler == 0x01 { //answer PAD
-			if _, loaded := suppressedExts.LoadOrStore(key, struct{}{}); loaded {
-				utils.LoggerDebug.Printf("Suppressed duplicate ICP Alarm (handler=0x01) for PAD: within 4 seconds")
-				return
-			}
-
-			time.AfterFunc(4*time.Second, func() {
-				suppressedExts.Delete(key)
-				utils.LoggerDebug.Printf("Suppression released .")
-			})
-			//}
-
 			//检查是否有任务正在创建
 			action.WaitTaskCreate("PAD-TMS")
 
@@ -411,22 +399,11 @@ func processPacket(packet []byte) {
 	case 0x0d: // ICP answer PAD
 
 		handler := packet[8]
-		key := suppressKey("exten", handler)
 
 		//Drop other handler in 2 sec
 		//PACUs---call---->ICP1
 		//PAD---->Chanspy(WEq)-->ICP1;PAD--->Call---->ICP2
 		if handler == 0x01 {
-			if _, loaded := suppressedExts.LoadOrStore(key, struct{}{}); loaded {
-				utils.LoggerDebug.Printf("Suppressed duplicate ICP Alarm (handler=0x01) for PAD: within 4 seconds")
-				return
-			}
-
-			time.AfterFunc(4*time.Second, func() {
-				suppressedExts.Delete(key)
-				utils.LoggerDebug.Printf("Suppression released for key: %s", key)
-			})
-			//}
 
 			//检查是否有任务正在创建
 			action.WaitTaskCreate("PAD-ICP")

+ 1 - 1
internal/app/stc/priority/task.go

@@ -97,7 +97,7 @@ func (r *TaskRegistry) HighestPriorityRunningTask() (string, TaskInfo, bool) {
 			found = true
 		}
 	}
-	utils.LoggerDebug.Printf("HighestPriorityRunningTask1 Get task:%+v", best)
+	utils.LoggerDebug.Printf("HighestPriorityRunningTask Get task:%+v", best)
 	return bestKey, best, found
 }