|
@@ -40,7 +40,8 @@ func HandleAMI(event map[string]string, conn net.Conn) {
|
|
|
|
|
|
alstatus.AlarmStatus(event["CallerIDNum"], "dial", conn)
|
|
|
}
|
|
|
- case "DialEnd":
|
|
|
+ case "1111":
|
|
|
+ //case "DialEnd":
|
|
|
lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
|
if utils.IsPAIU(event["CallerIDNum"]) {
|
|
|
alstatus.AlarmStatus(event["CallerIDNum"], "Idle", conn) // Alarm dial end
|
|
@@ -50,24 +51,6 @@ func HandleAMI(event map[string]string, conn net.Conn) {
|
|
|
if utils.IsPAIU(event["CallerIDNum"]) { // Alarm join the queue
|
|
|
alstatus.AlarmStatus(event["CallerIDNum"], "queue", conn)
|
|
|
|
|
|
- switch string(event["CallerIDNum"][2]) { // connect the pacu to pad acording to the pad number
|
|
|
- case "1":
|
|
|
- ChanSpy(event["CallerIDNum"], pacu1, false, true) //connect pacu to pad
|
|
|
- case "2":
|
|
|
- ChanSpy(event["CallerIDNum"], pacu2, false, true) //connect pacu to pad
|
|
|
- case "3":
|
|
|
- ChanSpy(event["CallerIDNum"], pacu3, false, true) //connect pacu to pad
|
|
|
- case "4":
|
|
|
- ChanSpy(event["CallerIDNum"], pacu4, false, true) //connect pacu to pad
|
|
|
- case "5":
|
|
|
- ChanSpy(event["CallerIDNum"], pacu5, false, true) //connect pacu to pad
|
|
|
- case "6":
|
|
|
- ChanSpy(event["CallerIDNum"], pacu6, false, true) //connect pacu to pad
|
|
|
- case "7":
|
|
|
- ChanSpy(event["CallerIDNum"], pacu7, false, true) //connect pacu to pad
|
|
|
- case "8":
|
|
|
- ChanSpy(event["CallerIDNum"], pacu8, false, true) //connect pacu to pad
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
case "ExtensionStatus":
|
|
@@ -87,8 +70,27 @@ func HandleAMI(event map[string]string, conn net.Conn) {
|
|
|
}
|
|
|
}
|
|
|
case "BridgeEnter":
|
|
|
- lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
|
+ lfshook.NewLogger().Infof("=========%s====%s", event["Event"], event["CallerIDNum"])
|
|
|
if utils.IsPAIU(event["CallerIDNum"]) {
|
|
|
+
|
|
|
+ switch string(event["CallerIDNum"][2]) { // connect the pacu to pad acording to the pad number
|
|
|
+ case "1":
|
|
|
+ ChanSpy(event["CallerIDNum"], pacu1, false, true) //connect pacu to pad
|
|
|
+ case "2":
|
|
|
+ ChanSpy(event["CallerIDNum"], pacu2, false, true) //connect pacu to pad
|
|
|
+ case "3":
|
|
|
+ ChanSpy(event["CallerIDNum"], pacu3, false, true) //connect pacu to pad
|
|
|
+ case "4":
|
|
|
+ ChanSpy(event["CallerIDNum"], pacu4, false, true) //connect pacu to pad
|
|
|
+ case "5":
|
|
|
+ ChanSpy(event["CallerIDNum"], pacu5, false, true) //connect pacu to pad
|
|
|
+ case "6":
|
|
|
+ ChanSpy(event["CallerIDNum"], pacu6, false, true) //connect pacu to pad
|
|
|
+ case "7":
|
|
|
+ ChanSpy(event["CallerIDNum"], pacu7, false, true) //connect pacu to pad
|
|
|
+ case "8":
|
|
|
+ ChanSpy(event["CallerIDNum"], pacu8, false, true) //connect pacu to pad
|
|
|
+ }
|
|
|
alstatus.AlarmStatus(event["CallerIDNum"], "connect", conn) // Alarm connected
|
|
|
}
|
|
|
}
|