Browse Source

fix test2

dujunchen 6 days ago
parent
commit
0dbef192e2
3 changed files with 18 additions and 13 deletions
  1. 11 9
      internal/app/ami/action/index.go
  2. 3 0
      internal/app/index.go
  3. 4 4
      internal/app/stc/index.go

+ 11 - 9
internal/app/ami/action/index.go

@@ -333,8 +333,9 @@ func HandleAMI(event map[string]string) {
 					//alstatus.AlarmStatus(strings.Split(strings.Split(res.Entrys[0].Channel, "/")[1], "-")[0], "connect")
 					//go RedirectInQueue(PADChan, "1481", "pad-page-occ-icp", "8") //PAD Page(OCC+ICPs);goto confbrdigeIoin
 					alstatus.AlarmStatus(event["CallerIDNum"], "connect")
-					go RedirectInQueue(event["Channel"], "1411", "pad-page-occ-icp", "1") //PAD Page(OCC+ICPs)
-					go Dial("0401", "0512", "pad-rule-pacus-occ", "ano8", "ano8", "8")    // PACUs dial OCC1
+					go RedirectInQueue(event["Channel"], "1481", "pad-page-occ-icp", "1") //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")
 					//}
@@ -434,8 +435,9 @@ func HandleAMI(event map[string]string) {
 			priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.PADICP)
 			go RedirectInQueue(event["ConnectedLineName"], "2311", "chanspy-rule-whisper", event["ConnectedLineName"]) //PAD chanspy(EqW) ICP1
 
-			go Dial("0402", event["ConnectedLineName"], "call-pad-rule", event["ConnectedLineName"], event["ConnectedLineName"], "8") // PAD call ICP8
-
+			if ExtenStatus("2381") == "Idle" {
+				go Dial("0402", event["ConnectedLineName"], "call-pad-rule", event["ConnectedLineName"], event["ConnectedLineName"], "8") // PAD call ICP8
+			}
 		}
 		if event["ConnectedLineNum"] == "ani8" && event["Exten"] == "0511" { //PAD ansered by ICP8; PACUs connected ICP8
 			lfshook.NewLogger().Infof("====PAD answered by ICP8:%s=====", event["ConnectedLineName"])
@@ -445,9 +447,9 @@ func HandleAMI(event map[string]string) {
 			priority.RunningType = "PAD-ICP"
 			priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.PADICP)
 			go RedirectInQueue(event["ConnectedLineName"], "2381", "chanspy-rule-whisper", event["ConnectedLineName"]) //PAD chanspy(EqW) ICP8
-
-			go Dial("0402", event["ConnectedLineName"], "call-pad-rule", event["ConnectedLineName"], event["ConnectedLineName"], "1") // PAD call ICP2
-
+			if ExtenStatus("2311") == "Idle" {
+				go Dial("0402", event["ConnectedLineName"], "call-pad-rule", event["ConnectedLineName"], event["ConnectedLineName"], "1") // PAD call ICP1
+			}
 			break
 		}
 
@@ -567,10 +569,10 @@ func HandleAMI(event map[string]string) {
 			priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.PADTMS)
 			if active.ActivedCab == "1" {
 				go RedirectInQueue(event["CallerIDName"], "2311", "chanspy-rule-whisper", "") //PAD chanspy(EqW) ICP1
-				go Dial("0403", event["CallerIDName"], "call-pad-rule", "2381", "2381", "8")   //ICP8---call----PAD
+				go Dial("0403", event["CallerIDName"], "call-pad-rule", "2381", "2381", "8")  //ICP8---call----PAD
 			} else if active.ActivedCab == "8" {
 				go RedirectInQueue(event["CallerIDName"], "2381", "chanspy-rule-whisper", "") //PAD chanspy(EqW) ICP8
-				go Dial("0403", event["CallerIDName"], "call-pad-rule", "2311", "2311", "1")   //ICP1---call----PAD
+				go Dial("0403", event["CallerIDName"], "call-pad-rule", "2311", "2311", "1")  //ICP1---call----PAD
 			}
 		} else if utils.IsPAIU(event["CallerIDNum"]) && event["Exten"] == "0405" { // PAD connect ICP-TMS;PACU not available
 

+ 3 - 0
internal/app/index.go

@@ -32,6 +32,9 @@ func StartApp() {
 		active.Master = true
 		active.CabNum = "1"
 	}
+
+	active.Master = true
+	active.CabNum = "1"
 	lfshook.NewLogger().Infof("=================cab number:%s===========", active.CabNum)
 
 	//init the active status

+ 4 - 4
internal/app/stc/index.go

@@ -200,10 +200,10 @@ func StartConnectionToSipServer(conn net.Conn) {
 		time.Sleep(time.Second) // 重连前等待
 
 		//check connected Master tag; connection err change to Master role ,exit
-		if socket.ConnectedMaster {
-			active.Master = true
-			return
-		}
+		//if socket.ConnectedMaster {
+		//	active.Master = true
+		//	return
+		//}
 	}
 }