|
|
@@ -91,7 +91,11 @@ func HandleAMI(event map[string]string) {
|
|
|
case "Newchannel":
|
|
|
//lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
|
if utils.IsPAIU(event["CallerIDNum"]) && event["Exten"] == "0300" { // Alarm dial queue start; PAD dialing
|
|
|
- alstatus.PaStatus(event["CallerIDNum"], "PAD", "start")
|
|
|
+ if priority.PADStart == 0 {
|
|
|
+ priority.PADStart = 1
|
|
|
+ alstatus.PaStatus(event["CallerIDNum"], "PAD", "start")
|
|
|
+ }
|
|
|
+
|
|
|
alstatus.AlarmStatus(event["CallerIDNum"], "dial")
|
|
|
}
|
|
|
|
|
|
@@ -147,7 +151,10 @@ func HandleAMI(event map[string]string) {
|
|
|
res, _ := QueueStatus("0300", "") // check ICP queue ,if empty PAD end
|
|
|
if res.Calls == "0" {
|
|
|
priority.CleanPriorityTag()
|
|
|
- alstatus.PaStatus(event["CallerIDNum"], "PAD", "end")
|
|
|
+ if priority.PADStart == 1 && utils.IsPAIU(event["CallerIDNum"]) {
|
|
|
+ alstatus.PaStatus(event["CallerIDNum"], "PAD", "end")
|
|
|
+ priority.PADStart = 0
|
|
|
+ }
|
|
|
if priority.ResumeEmgPara.FileName != "" {
|
|
|
CheckEmgResume()
|
|
|
}
|
|
|
@@ -161,7 +168,10 @@ func HandleAMI(event map[string]string) {
|
|
|
res, _ := QueueStatus("0300", "") // check ICP queue ,if empty PAD end
|
|
|
if res.Calls == "0" {
|
|
|
priority.CleanPriorityTag()
|
|
|
- alstatus.PaStatus(event["CallerIDNum"], "PAD", "end")
|
|
|
+ if priority.PADStart == 1 && utils.IsPAIU(event["CallerIDNum"]) {
|
|
|
+ alstatus.PaStatus(event["CallerIDNum"], "PAD", "end")
|
|
|
+ priority.PADStart = 0
|
|
|
+ }
|
|
|
if priority.ResumeEmgPara.FileName != "" {
|
|
|
CheckEmgResume()
|
|
|
}
|
|
|
@@ -175,7 +185,10 @@ func HandleAMI(event map[string]string) {
|
|
|
res, _ := QueueStatus("0300", "") // check ICP queue ,if empty PAD end
|
|
|
if res.Calls == "0" {
|
|
|
priority.CleanPriorityTag()
|
|
|
- alstatus.PaStatus(event["CallerIDNum"], "PAD", "end")
|
|
|
+ if priority.PADStart == 1 && utils.IsPAIU(event["CallerIDNum"]) {
|
|
|
+ alstatus.PaStatus(event["CallerIDNum"], "PAD", "end")
|
|
|
+ priority.PADStart = 0
|
|
|
+ }
|
|
|
if priority.ResumeEmgPara.FileName != "" {
|
|
|
CheckEmgResume()
|
|
|
}
|
|
|
@@ -287,7 +300,6 @@ func HandleAMI(event map[string]string) {
|
|
|
//set priority and send PA status msg
|
|
|
switch event["CallerIDName"] {
|
|
|
case "EMG":
|
|
|
- alstatus.PaStatus(event["CallerIDNum"], "EMG", "start")
|
|
|
priority.RunningPATaskChan = event["Channel"]
|
|
|
priority.RunningType = "EMG"
|
|
|
//Pa status report
|
|
|
@@ -295,7 +307,6 @@ func HandleAMI(event map[string]string) {
|
|
|
alstatus.PaStatus("", "EMG", "start")
|
|
|
|
|
|
case "SPC":
|
|
|
- alstatus.PaStatus(event["CallerIDNum"], "SPC", "start")
|
|
|
priority.RunningPATaskChan = event["Channel"]
|
|
|
priority.RunningType = "SPC"
|
|
|
//Pa status report
|
|
|
@@ -303,7 +314,6 @@ func HandleAMI(event map[string]string) {
|
|
|
alstatus.PaStatus("", "SPC", "start")
|
|
|
|
|
|
case "DCS":
|
|
|
- alstatus.PaStatus(event["CallerIDNum"], "DCS", "start")
|
|
|
priority.RunningPATaskChan = event["Channel"]
|
|
|
priority.RunningType = "DCS"
|
|
|
//Pa status report
|
|
|
@@ -311,7 +321,6 @@ func HandleAMI(event map[string]string) {
|
|
|
alstatus.PaStatus("", "DCS", "start")
|
|
|
|
|
|
case "STN":
|
|
|
- alstatus.PaStatus(event["CallerIDNum"], "STN", "start")
|
|
|
priority.RunningPATaskChan = event["Channel"]
|
|
|
priority.RunningType = "STN"
|
|
|
//Pa status report
|
|
|
@@ -319,7 +328,6 @@ func HandleAMI(event map[string]string) {
|
|
|
alstatus.PaStatus("", "STN", "start")
|
|
|
|
|
|
case "CHK":
|
|
|
- alstatus.PaStatus(event["CallerIDNum"], "CHK", "start")
|
|
|
priority.RunningPATaskChan = event["Channel"]
|
|
|
priority.RunningType = "CHK"
|
|
|
//Pa status report
|
|
|
@@ -327,7 +335,6 @@ func HandleAMI(event map[string]string) {
|
|
|
alstatus.PaStatus("", "CHK", "start")
|
|
|
|
|
|
case "VOL": // tone-test
|
|
|
- alstatus.PaStatus(event["CallerIDNum"], "VOL", "start")
|
|
|
priority.RunningPATaskChan = event["Channel"]
|
|
|
priority.RunningType = "VOL"
|
|
|
//Pa status report
|
|
|
@@ -458,7 +465,7 @@ func HandleAMI(event map[string]string) {
|
|
|
go RedirectInQueue(event["CallerIDName"], "2381", "chanspy-rule-whisper", "") //PAD chanspy(EqW) ICP8
|
|
|
go Dial("0403", event["CallerIDName"], "chanspy-rule", "2311", "2311", "1") //ICP1---chanspy----PAD
|
|
|
}
|
|
|
- } else if utils.IsPAIU(event["CallerIDNum"]) { // PAD connect ICP-TMS;PACU not available
|
|
|
+ } else if utils.IsPAIU(event["CallerIDNum"]) && event["Exten"] == "0405" { // PAD connect ICP-TMS;PACU not available
|
|
|
|
|
|
priority.RunningPATaskChan = event["Channel"]
|
|
|
priority.RunningType = "PAD-TMS"
|