소스 검색

update pad

dujunchen 1 주 전
부모
커밋
5f6a6085d0
3개의 변경된 파일19개의 추가작업 그리고 17개의 파일을 삭제
  1. 11 12
      internal/app/ami/action/index.go
  2. 0 3
      internal/app/stc/active/index.go
  3. 8 2
      internal/app/stc/broadcast/stc-broadcast.go

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

@@ -213,7 +213,7 @@ func HandleAMI(event map[string]string) {
 		if event["ConnectedLineNum"] == "ani1" && event["Exten"] == "0511" { //PAD answered by ICP; PACUs connected ICP1
 			lfshook.NewLogger().Infof("====PAD answered by ICP1:%s=====", event["ConnectedLineName"])
 			alstatus.AlarmStatus(event["ConnectedLineName"], "connect")
-			go Dial("0402", "2311", "chanspy-rule", "ani1", event["ConnectedLineName"], "8") //trigger ChanSpyStart ,ICP8 whisper ICP1
+			go Dial("0402", "2311", "chanspy-rule-whisper", "ani1", event["ConnectedLineName"], "8") //trigger ChanSpyStart ,ICP8 whisper ICP1
 			//goto event=ChanSpyStart; PAD whisper ICP8
 			break
 		}
@@ -221,7 +221,7 @@ func HandleAMI(event map[string]string) {
 		if event["ConnectedLineNum"] == "ani8" && event["Exten"] == "0511" { //PAD ansered by ICP8; PACUs connected ICP8
 			lfshook.NewLogger().Infof("====PAD answered by ICP8:%s=====", event["ConnectedLineName"])
 			alstatus.AlarmStatus(event["ConnectedLineName"], "connect")
-			go Dial("0402", "2381", "chanspy-rule", "ani8", event["ConnectedLineName"], "1") //trigger ChanSpyStart ,ICP1 whisper ICP8
+			go Dial("0402", "2381", "chanspy-rule-whisper", "ani8", event["ConnectedLineName"], "1") //trigger ChanSpyStart ,ICP1 whisper ICP8
 			//goto event=ChanSpyStart; PAD whisper ICP1
 			break
 		}
@@ -230,7 +230,7 @@ func HandleAMI(event map[string]string) {
 		if event["ConnectedLineNum"] == "ano1" && event["Exten"] == "0512" { //PAD answered by OCC; PACUs connected IO1
 			lfshook.NewLogger().Infof("====PAD answered by OCC1:%s=====", event["ConnectedLineName"])
 			alstatus.AlarmStatus(event["ConnectedLineName"], "connect")
-			go RedirectInQueue(event["ConnectedLineName"], "1411", "chanspy-rule", "") //PAD whisper IO1
+			go RedirectInQueue(event["ConnectedLineName"], "1411", "chanspy-rule-whisper", "") //PAD whisper IO1
 			//goto event=ChanSpyStart; ICPs spy PAD
 			break
 		}
@@ -238,7 +238,7 @@ func HandleAMI(event map[string]string) {
 		if event["ConnectedLineNum"] == "ano8" && event["Exten"] == "0512" { //PAD ansered by OCC8; PACUs connected IO8
 			lfshook.NewLogger().Infof("====PAD answered by OCC8:%s=====", event["ConnectedLineName"])
 			alstatus.AlarmStatus(event["ConnectedLineName"], "connect")
-			go RedirectInQueue(event["ConnectedLineName"], "1481", "chanspy-rule", "") //PAD whisper IO8
+			go RedirectInQueue(event["ConnectedLineName"], "1481", "chanspy-rule-whisper", "") //PAD whisper IO8
 			//goto event=ChanSpyStart; ICPs spy PAD
 			break
 		}
@@ -248,19 +248,19 @@ func HandleAMI(event map[string]string) {
 		//PAD answered by ICP ; PAD whisper ICP
 		if event["SpyerConnectedLineName"] == "2381" && event["SpyerCallerIDNum"] == "2311" { //check if it is ICP8 whisper ICP1
 			lfshook.NewLogger().Infof("====PAD answered by ICP===;PAD whisper 2381=====")
-			go RedirectInQueue(event["SpyeeConnectedLineName"], "2381", "chanspy-rule", "") //PAD whisper ICP8
+			go RedirectInQueue(event["SpyeeConnectedLineName"], "2381", "chanspy-rule-whisper", "") //PAD whisper ICP8
 			break
 		}
 
 		if event["SpyerConnectedLineName"] == "2311" && event["SpyerCallerIDNum"] == "2381" { //check if it is ICP1 whisper ICP8
 			lfshook.NewLogger().Infof("====PAD answered by ICP===;PAD whisper 2311=====")
-			go RedirectInQueue(event["SpyeeConnectedLineName"], "2311", "chanspy-rule", "") //PAD whisper ICP1
+			go RedirectInQueue(event["SpyeeConnectedLineName"], "2311", "chanspy-rule-whisper", "") //PAD whisper ICP1
 			break
 		}
 
 		//PAD answered by OCC; ICPs chanspy PAD
 		if utils.IsPAIU(event["SpyeeConnectedLineName"]) && utils.IsIO(event["SpyerExten"]) { // check if it is PAD whisper IO
-			Dial("0404", event["SpyeeConnectedLineName"], "chanspy-rule-icps", "ano", "ano", "") //ICPs chanspy PAD
+			go Dial("0404", event["SpyeeConnectedLineName"], "chanspy-rule", "ano", "ano", "") //ICPs chanspy PAD
 		}
 
 	case "ConfbridgeLeave":
@@ -312,12 +312,11 @@ func HandleAMI(event map[string]string) {
 			alstatus.AlarmStatus(event["CallerIDName"], "connect") // Alarm connected
 
 			if active.CabNum == "1" && active.Actived {
-				go Dial("0403", "2311", "chanspy-rule", "ICP8-ICP1", "ICP8-ICP1", "8") // ICP8 whisper ICP1
-				//goto ChanSpyStart, PAD whisper ICP8
+				go RedirectInQueue(event["CallerIDName"], "2311", "chanspy-rule-whisper", "") //PAD chanspy(EqW) ICP1
 			} else if active.CabNum == "8" && active.Actived {
-				go Dial("0403", "2381", "chanspy-rule", "ICP8-ICP1", "ICP8-ICP1", "8") // ICP1 whisper ICP8
-				//goto ChanSpyStart, PAD whisper ICP1
+				go RedirectInQueue(event["CallerIDName"], "2381", "chanspy-rule-whisper", "") //PAD chanspy(EqW) ICP8
 			}
+			//Goto ChanSpyStart; ICP spy PAD
 		} else if utils.IsPAIU(event["CallerIDNum"]) {
 			lfshook.NewLogger().Infof("====send pad status=====")
 			alstatus.AlarmStatus(event["CallerIDNum"], "connect") // PAD connect ICP-TMS
@@ -339,7 +338,7 @@ func StartAMI(connectOKCallBack func(), handleEvents []func(event map[string]str
 		// lfshook.NewLogger().Infof("ami event on %+v", payload[0])
 		event := payload[0].(map[string]string)
 
-		HandleAMI(event)
+		go HandleAMI(event)
 
 		for _, handle := range handleEvents {
 			go handle(event)

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

@@ -4,7 +4,4 @@ package active
 var CabNum string
 var Actived bool
 
-var ICPAnswer = 0
-var OCCAnswer = 0
-
 //var ActivedMC int

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

@@ -418,7 +418,9 @@ func AlarmHandleICP(data []byte) {
 
 	switch handler {
 	case 0x01: //answer(ICP+Alarm+PACU)
-
+		//NotifyPaiu(exten, "answer")
+		priority.ICPAnswer = 1
+		lfshook.NewLogger().Logger.Infof("================ICP Answer PAD================:%s ", exten)
 		if active.CabNum == "1" && active.Actived {
 			action.Dial("0402", "0511", "pad-rule-pacus", "ani1", exten, "1") // PACUs dial ICP1
 			//goto ami event ConfbridgeJoin, ICP answer PAD
@@ -474,7 +476,11 @@ func AlarmHandleTMS(data []byte) {
 
 	switch handler {
 	case 0x01: //answer(ICP+Alarm+PACU)
-		//NotifyPaiu(exten, "answer")
+		//PACU---call---->ICP1
+		//PAD---->Chanspy(WEq)-->ICP1
+		//ICP2--->spy(Eq)---->PAD
+
+		priority.ICPAnswer = 1
 		lfshook.NewLogger().Logger.Infof("================TMS Answer PAD:%s===PACU:%s==========", exten, PacuNum)
 		if action.ExtenStatus(PacuNum) == "Idle" {
 			if active.CabNum == "1" && active.Actived {