|
|
@@ -137,12 +137,25 @@ func HandleAMI(event map[string]string) {
|
|
|
}
|
|
|
|
|
|
case "BridgeEnter":
|
|
|
- //ICP and PAD connected
|
|
|
+ //ICP and PACU connected
|
|
|
if utils.IsPACU(event["CallerIDNum"]) {
|
|
|
- if utils.IsPAIU(event["CallerIDName"]) { //relate to PACU Dial ICP caller name in AlarmHandle
|
|
|
+ if utils.IsPAIU(event["CallerIDName"]) && event["Exten"] == "0402" { //relate to PACU Dial ICP caller name in AlarmHandle
|
|
|
lfshook.NewLogger().Infof("====BridgeEnter==IN action===%s===ID:%s Name:%s", event["Event"], event["CallerIDNum"], event["CallerIDName"])
|
|
|
- alstatus.AlarmStatus(event["CallerIDName"], "connect") // Alarm connected
|
|
|
- go RedirectInQueue(event["CallerIDName"], "2311", "chanspy-rule", "") // 1车ICP接听PAIU
|
|
|
+ alstatus.AlarmStatus(event["CallerIDName"], "connect") // Alarm connected
|
|
|
+ if active.CabNum == "1" && active.Actived {
|
|
|
+ go RedirectInQueue(event["CallerIDName"], "2311", "chanspy-rule", "") // 1车ICP接听PAIU
|
|
|
+ } else if active.CabNum == "8" && active.Actived {
|
|
|
+ go RedirectInQueue(event["CallerIDName"], "2381", "chanspy-rule", "") // 1车ICP接听PAIU
|
|
|
+ }
|
|
|
+ } else if utils.IsPAIU(event["CallerIDName"]) && event["Exten"] == "0401" { // PAD connect to OCC
|
|
|
+ lfshook.NewLogger().Infof("====BridgeEnter==IN action===%s===ID:%s Name:%s", event["Event"], event["CallerIDNum"], event["CallerIDName"])
|
|
|
+ alstatus.AlarmStatus(event["CallerIDName"], "connect") // Alarm connected
|
|
|
+
|
|
|
+ if active.CabNum == "1" && active.Actived {
|
|
|
+ go RedirectInQueue(event["CallerIDName"], "1411", "chanspy-rule", "") // 1车OCC接听PAIU
|
|
|
+ } else if active.CabNum == "8" && active.Actived {
|
|
|
+ go RedirectInQueue(event["CallerIDName"], "1481", "chanspy-rule", "") // 8车OCC接听PAIU
|
|
|
+ }
|
|
|
}
|
|
|
} else if utils.IsPAIU(event["CallerIDNum"]) { //No PACU available in the cab
|
|
|
lfshook.NewLogger().Infof("====BridgeEnter==IN action===%s===ID:%s Name:%s", event["Event"], event["CallerIDNum"], event["CallerIDName"])
|