|
@@ -42,38 +42,29 @@ func HandleAMI(event map[string]string) {
|
|
|
//PA & CPA interrupt others
|
|
//PA & CPA interrupt others
|
|
|
if utils.IsICP(event["CallerIDNum"]) {
|
|
if utils.IsICP(event["CallerIDNum"]) {
|
|
|
if priority.CheckPriority("ManuPa") {
|
|
if priority.CheckPriority("ManuPa") {
|
|
|
- HangupAllExcept(event["CallerIDNum"]) //hangup others if priority is higher
|
|
|
|
|
|
|
+ //hangup others if priority is higher
|
|
|
|
|
+ HangupRunningTask()
|
|
|
} else {
|
|
} else {
|
|
|
Hangup(event["CallerIDNum"]) //lowwer priority ,hangup caller
|
|
Hangup(event["CallerIDNum"]) //lowwer priority ,hangup caller
|
|
|
}
|
|
}
|
|
|
} else if utils.IsIO(event["CallerIDNum"]) { // CPA
|
|
} else if utils.IsIO(event["CallerIDNum"]) { // CPA
|
|
|
if priority.CheckPriority("CPA") {
|
|
if priority.CheckPriority("CPA") {
|
|
|
- HangupAllExcept(event["CallerIDNum"]) //hangup others if priority is higher
|
|
|
|
|
|
|
+ //hangup others if priority is higher
|
|
|
|
|
+ HangupRunningTask()
|
|
|
} else {
|
|
} else {
|
|
|
Hangup(event["CallerIDNum"]) //lowwer priority ,hangup caller
|
|
Hangup(event["CallerIDNum"]) //lowwer priority ,hangup caller
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} else if event["UserEvent"] == "CallType" && event["Type"] == "C2C" { //CabCab; check cab cab priority
|
|
} else if event["UserEvent"] == "CallType" && event["Type"] == "C2C" { //CabCab; check cab cab priority
|
|
|
- //priority.RunningTypePriority = 3 PAD---PAD back to queue
|
|
|
|
|
- //priority.RunningTypePriority = 4 CPA
|
|
|
|
|
|
|
|
|
|
if priority.CheckPriority("CabCab") {
|
|
if priority.CheckPriority("CabCab") {
|
|
|
- if event["CallerIDNum"] == "2311" { //cab1 call cab8
|
|
|
|
|
- if ExtenStatus("2381") == "InUse" {
|
|
|
|
|
- Hangup("2381")
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- if ExtenStatus("2311") == "InUse" { // cab8 call cab1
|
|
|
|
|
- Hangup("2311")
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ HangupRunningTask()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
case "Newchannel":
|
|
case "Newchannel":
|
|
|
//lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
//lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
|
if utils.IsPAIU(event["CallerIDNum"]) && event["Exten"] == "0300" { // Alarm dial queue start; PAD dialing
|
|
if utils.IsPAIU(event["CallerIDNum"]) && event["Exten"] == "0300" { // Alarm dial queue start; PAD dialing
|
|
|
- priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.PADICP)
|
|
|
|
|
alstatus.PaStatus(event["CallerIDNum"], "PAD", "start")
|
|
alstatus.PaStatus(event["CallerIDNum"], "PAD", "start")
|
|
|
alstatus.AlarmStatus(event["CallerIDNum"], "dial")
|
|
alstatus.AlarmStatus(event["CallerIDNum"], "dial")
|
|
|
}
|
|
}
|
|
@@ -155,10 +146,10 @@ func HandleAMI(event map[string]string) {
|
|
|
break
|
|
break
|
|
|
} else { //OCC queue is not empty
|
|
} else { //OCC queue is not empty
|
|
|
|
|
|
|
|
- if active.CabNum == "1" && active.Actived && ExtenStatus("1411") == "Idle" { //check active and OCC status
|
|
|
|
|
|
|
+ if active.CabNum == "1" && active.Actived && alstatus.GetExtenStat("1411") == "Idle" { //check active and OCC status
|
|
|
Dial("0401", "0512", "pad-rule-pacus-occ", "ano1", event["CallerIDNum"], "1") // PACUs dial OCC1
|
|
Dial("0401", "0512", "pad-rule-pacus-occ", "ano1", event["CallerIDNum"], "1") // PACUs dial OCC1
|
|
|
//goto ConfbridgeJoin, OCC1 answer PAD
|
|
//goto ConfbridgeJoin, OCC1 answer PAD
|
|
|
- } else if active.CabNum == "8" && active.Actived && ExtenStatus("1481") == "Idle" {
|
|
|
|
|
|
|
+ } else if active.CabNum == "8" && active.Actived && alstatus.GetExtenStat("1481") == "Idle" {
|
|
|
Dial("0401", "0512", "pad-rule-pacus-occ", "ano8", event["CallerIDNum"], "8") // PACUs dial OCC8
|
|
Dial("0401", "0512", "pad-rule-pacus-occ", "ano8", event["CallerIDNum"], "8") // PACUs dial OCC8
|
|
|
//goto ConfbridgeJoin, OCC8 answer PAD
|
|
//goto ConfbridgeJoin, OCC8 answer PAD
|
|
|
}
|
|
}
|
|
@@ -168,6 +159,7 @@ func HandleAMI(event map[string]string) {
|
|
|
case "QueueCallerJoin":
|
|
case "QueueCallerJoin":
|
|
|
lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
|
if priority.OCCAnswer == 1 && event["Queue"] == "0300" { //New PAD Goto the OCC queue in the first time, if OCC answered
|
|
if priority.OCCAnswer == 1 && event["Queue"] == "0300" { //New PAD Goto the OCC queue in the first time, if OCC answered
|
|
|
|
|
+ alstatus.AlarmStatus(event["CallerIDNum"], "queue") //send status to STC
|
|
|
go RedirectInQueue(event["CallerIDNum"], "0301", "queues-occ", "")
|
|
go RedirectInQueue(event["CallerIDNum"], "0301", "queues-occ", "")
|
|
|
break
|
|
break
|
|
|
}
|
|
}
|
|
@@ -203,13 +195,13 @@ func HandleAMI(event map[string]string) {
|
|
|
//PAD chanspy(WqE) OCC;
|
|
//PAD chanspy(WqE) OCC;
|
|
|
//ICPs chanspy(qE) PAD;
|
|
//ICPs chanspy(qE) PAD;
|
|
|
if utils.IsPAIU(event["CallerIDNum"]) && event["Queue"] == "0301" && priority.OCCAnswer == 0 { // The first PAD to OCC ,caller is PAD
|
|
if utils.IsPAIU(event["CallerIDNum"]) && event["Queue"] == "0301" && priority.OCCAnswer == 0 { // The first PAD to OCC ,caller is PAD
|
|
|
- if active.CabNum == "1" && active.Actived && ExtenStatus("1411") == "Idle" { //check active and OCC status
|
|
|
|
|
|
|
+ if active.CabNum == "1" && active.Actived && alstatus.GetExtenStat("1411") == "Idle" { //check active and OCC status
|
|
|
priority.OCCAnswer = 1
|
|
priority.OCCAnswer = 1
|
|
|
alstatus.OccPad("start")
|
|
alstatus.OccPad("start")
|
|
|
priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.PADOCC) //Set running priority
|
|
priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.PADOCC) //Set running priority
|
|
|
Dial("0401", "0512", "pad-rule-pacus-occ", "ano1", event["CallerIDNum"], "1") // PACUs dial OCC1
|
|
Dial("0401", "0512", "pad-rule-pacus-occ", "ano1", event["CallerIDNum"], "1") // PACUs dial OCC1
|
|
|
//Goto event=ConfbridgeJoin;OCC answer PAD
|
|
//Goto event=ConfbridgeJoin;OCC answer PAD
|
|
|
- } else if active.CabNum == "8" && active.Actived && ExtenStatus("1481") == "Idle" {
|
|
|
|
|
|
|
+ } else if active.CabNum == "8" && active.Actived && alstatus.GetExtenStat("1481") == "Idle" {
|
|
|
priority.OCCAnswer = 1
|
|
priority.OCCAnswer = 1
|
|
|
priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.PADOCC) //Set running priority
|
|
priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.PADOCC) //Set running priority
|
|
|
alstatus.OccPad("start")
|
|
alstatus.OccPad("start")
|
|
@@ -225,12 +217,14 @@ func HandleAMI(event map[string]string) {
|
|
|
lfshook.NewLogger().Infof("====PA status:%s=====", "start")
|
|
lfshook.NewLogger().Infof("====PA status:%s=====", "start")
|
|
|
priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.ManuPa)
|
|
priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.ManuPa)
|
|
|
alstatus.PaStatus(event["CallerIDNum"], "PA", "start")
|
|
alstatus.PaStatus(event["CallerIDNum"], "PA", "start")
|
|
|
|
|
+ priority.RunningPATaskChan = event["Channel"]
|
|
|
priority.RunningType = "PA"
|
|
priority.RunningType = "PA"
|
|
|
break
|
|
break
|
|
|
} else if utils.IsIO(event["CallerIDNum"]) && event["Exten"] == "0501" { //CPA start
|
|
} else if utils.IsIO(event["CallerIDNum"]) && event["Exten"] == "0501" { //CPA start
|
|
|
lfshook.NewLogger().Infof("====CPA status:%s=====", "start")
|
|
lfshook.NewLogger().Infof("====CPA status:%s=====", "start")
|
|
|
priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.CPA)
|
|
priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.CPA)
|
|
|
alstatus.PaStatus(event["CallerIDNum"], "CPA", "start")
|
|
alstatus.PaStatus(event["CallerIDNum"], "CPA", "start")
|
|
|
|
|
+ priority.RunningPATaskChan = event["Channel"]
|
|
|
priority.RunningType = "CPA"
|
|
priority.RunningType = "CPA"
|
|
|
break
|
|
break
|
|
|
}
|
|
}
|
|
@@ -241,26 +235,49 @@ func HandleAMI(event map[string]string) {
|
|
|
alstatus.PaStatus(event["CallerIDNum"], "EMG", "start")
|
|
alstatus.PaStatus(event["CallerIDNum"], "EMG", "start")
|
|
|
priority.RunningPATaskChan = event["Channel"]
|
|
priority.RunningPATaskChan = event["Channel"]
|
|
|
priority.RunningType = "EMG"
|
|
priority.RunningType = "EMG"
|
|
|
|
|
+ //Pa status report
|
|
|
|
|
+ priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.EMG)
|
|
|
|
|
+ alstatus.PaStatus("", "EMG", "start")
|
|
|
|
|
+
|
|
|
case "SPC":
|
|
case "SPC":
|
|
|
alstatus.PaStatus(event["CallerIDNum"], "SPC", "start")
|
|
alstatus.PaStatus(event["CallerIDNum"], "SPC", "start")
|
|
|
priority.RunningPATaskChan = event["Channel"]
|
|
priority.RunningPATaskChan = event["Channel"]
|
|
|
priority.RunningType = "SPC"
|
|
priority.RunningType = "SPC"
|
|
|
|
|
+ //Pa status report
|
|
|
|
|
+ priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.SPC)
|
|
|
|
|
+ alstatus.PaStatus("", "EMG", "start")
|
|
|
|
|
+
|
|
|
case "DCS":
|
|
case "DCS":
|
|
|
alstatus.PaStatus(event["CallerIDNum"], "DCS", "start")
|
|
alstatus.PaStatus(event["CallerIDNum"], "DCS", "start")
|
|
|
priority.RunningPATaskChan = event["Channel"]
|
|
priority.RunningPATaskChan = event["Channel"]
|
|
|
priority.RunningType = "DCS"
|
|
priority.RunningType = "DCS"
|
|
|
|
|
+ //Pa status report
|
|
|
|
|
+ priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.DCS)
|
|
|
|
|
+ alstatus.PaStatus("", "EMG", "start")
|
|
|
|
|
+
|
|
|
case "STN":
|
|
case "STN":
|
|
|
alstatus.PaStatus(event["CallerIDNum"], "STN", "start")
|
|
alstatus.PaStatus(event["CallerIDNum"], "STN", "start")
|
|
|
priority.RunningPATaskChan = event["Channel"]
|
|
priority.RunningPATaskChan = event["Channel"]
|
|
|
priority.RunningType = "STN"
|
|
priority.RunningType = "STN"
|
|
|
|
|
+ //Pa status report
|
|
|
|
|
+ priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.STN)
|
|
|
|
|
+ alstatus.PaStatus("", "STN", "start")
|
|
|
|
|
+
|
|
|
case "CHK":
|
|
case "CHK":
|
|
|
alstatus.PaStatus(event["CallerIDNum"], "CHK", "start")
|
|
alstatus.PaStatus(event["CallerIDNum"], "CHK", "start")
|
|
|
priority.RunningPATaskChan = event["Channel"]
|
|
priority.RunningPATaskChan = event["Channel"]
|
|
|
priority.RunningType = "CHK"
|
|
priority.RunningType = "CHK"
|
|
|
|
|
+ //Pa status report
|
|
|
|
|
+ priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.CHK)
|
|
|
|
|
+ alstatus.PaStatus("", "CHK", "start")
|
|
|
|
|
+
|
|
|
case "VOL":
|
|
case "VOL":
|
|
|
alstatus.PaStatus(event["CallerIDNum"], "VOL", "start")
|
|
alstatus.PaStatus(event["CallerIDNum"], "VOL", "start")
|
|
|
priority.RunningPATaskChan = event["Channel"]
|
|
priority.RunningPATaskChan = event["Channel"]
|
|
|
priority.RunningType = "VOL"
|
|
priority.RunningType = "VOL"
|
|
|
|
|
+ //Pa status report
|
|
|
|
|
+ priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.VOL)
|
|
|
|
|
+ alstatus.PaStatus("", "VOL", "start")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//ICP answer PAD;
|
|
//ICP answer PAD;
|
|
@@ -268,6 +285,9 @@ func HandleAMI(event map[string]string) {
|
|
|
lfshook.NewLogger().Infof("====PAD answered by ICP1:%s=====", event["ConnectedLineName"])
|
|
lfshook.NewLogger().Infof("====PAD answered by ICP1:%s=====", event["ConnectedLineName"])
|
|
|
alstatus.AlarmStatus(event["ConnectedLineName"], "connect")
|
|
alstatus.AlarmStatus(event["ConnectedLineName"], "connect")
|
|
|
|
|
|
|
|
|
|
+ priority.RunningPATaskChan = event["Channel"]
|
|
|
|
|
+ priority.RunningType = "PAD-ICP"
|
|
|
|
|
+ priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.PADICP)
|
|
|
go RedirectInQueue(event["ConnectedLineName"], "2311", "chanspy-rule-whisper", event["ConnectedLineName"]) //PAD chanspy(EqW) ICP1
|
|
go RedirectInQueue(event["ConnectedLineName"], "2311", "chanspy-rule-whisper", event["ConnectedLineName"]) //PAD chanspy(EqW) ICP1
|
|
|
go Dial("0402", event["ConnectedLineName"], "chanspy-rule", event["ConnectedLineName"], event["ConnectedLineName"], "8") //ICP8 chanspy PAD
|
|
go Dial("0402", event["ConnectedLineName"], "chanspy-rule", event["ConnectedLineName"], event["ConnectedLineName"], "8") //ICP8 chanspy PAD
|
|
|
//goto event=ChanSpyStart; PAD whisper ICP8
|
|
//goto event=ChanSpyStart; PAD whisper ICP8
|
|
@@ -277,6 +297,9 @@ func HandleAMI(event map[string]string) {
|
|
|
lfshook.NewLogger().Infof("====PAD answered by ICP8:%s=====", event["ConnectedLineName"])
|
|
lfshook.NewLogger().Infof("====PAD answered by ICP8:%s=====", event["ConnectedLineName"])
|
|
|
alstatus.AlarmStatus(event["ConnectedLineName"], "connect")
|
|
alstatus.AlarmStatus(event["ConnectedLineName"], "connect")
|
|
|
|
|
|
|
|
|
|
+ priority.RunningPATaskChan = event["Channel"]
|
|
|
|
|
+ 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 RedirectInQueue(event["ConnectedLineName"], "2381", "chanspy-rule-whisper", event["ConnectedLineName"]) //PAD chanspy(EqW) ICP8
|
|
|
go Dial("0402", event["ConnectedLineName"], "chanspy-rule", event["ConnectedLineName"], event["ConnectedLineName"], "1") //ICP1 chanspy PAD
|
|
go Dial("0402", event["ConnectedLineName"], "chanspy-rule", event["ConnectedLineName"], event["ConnectedLineName"], "1") //ICP1 chanspy PAD
|
|
|
//goto event=ChanSpyStart; PAD whisper ICP1
|
|
//goto event=ChanSpyStart; PAD whisper ICP1
|
|
@@ -288,6 +311,9 @@ func HandleAMI(event map[string]string) {
|
|
|
lfshook.NewLogger().Infof("====PAD answered by OCC1:%s=====", event["ConnectedLineName"])
|
|
lfshook.NewLogger().Infof("====PAD answered by OCC1:%s=====", event["ConnectedLineName"])
|
|
|
alstatus.AlarmStatus(event["ConnectedLineName"], "connect")
|
|
alstatus.AlarmStatus(event["ConnectedLineName"], "connect")
|
|
|
|
|
|
|
|
|
|
+ priority.RunningPATaskChan = event["Channel"]
|
|
|
|
|
+ priority.RunningType = "PAD-OCC"
|
|
|
|
|
+ priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.PADOCC)
|
|
|
go RedirectInQueue(event["ConnectedLineName"], "1411", "chanspy-rule-whisper", event["ConnectedLineName"]) //PAD chanspy(EqW) IO1
|
|
go RedirectInQueue(event["ConnectedLineName"], "1411", "chanspy-rule-whisper", event["ConnectedLineName"]) //PAD chanspy(EqW) IO1
|
|
|
//goto event=ChanSpyStart; ICPs spy PAD
|
|
//goto event=ChanSpyStart; ICPs spy PAD
|
|
|
break
|
|
break
|
|
@@ -296,6 +322,9 @@ func HandleAMI(event map[string]string) {
|
|
|
lfshook.NewLogger().Infof("====PAD answered by OCC8:%s=====", event["ConnectedLineName"])
|
|
lfshook.NewLogger().Infof("====PAD answered by OCC8:%s=====", event["ConnectedLineName"])
|
|
|
alstatus.AlarmStatus(event["ConnectedLineName"], "connect")
|
|
alstatus.AlarmStatus(event["ConnectedLineName"], "connect")
|
|
|
|
|
|
|
|
|
|
+ priority.RunningPATaskChan = event["Channel"]
|
|
|
|
|
+ priority.RunningType = "PAD-OCC"
|
|
|
|
|
+ priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.PADOCC)
|
|
|
go RedirectInQueue(event["ConnectedLineName"], "1481", "chanspy-rule-whisper", event["ConnectedLineName"]) //PAD chanspy(EqW) IO8
|
|
go RedirectInQueue(event["ConnectedLineName"], "1481", "chanspy-rule-whisper", event["ConnectedLineName"]) //PAD chanspy(EqW) IO8
|
|
|
//goto event=ChanSpyStart; ICPs spy PAD
|
|
//goto event=ChanSpyStart; ICPs spy PAD
|
|
|
break
|
|
break
|
|
@@ -304,7 +333,7 @@ func HandleAMI(event map[string]string) {
|
|
|
case "ChanSpyStart":
|
|
case "ChanSpyStart":
|
|
|
lfshook.NewLogger().Infof("=========event:%s callerid:%s SpyeeConnectedLineName:%s SpyerExten:%s", event["Event"], event["CallerIDNum"], event["SpyeeConnectedLineName"], event["SpyerExten"])
|
|
lfshook.NewLogger().Infof("=========event:%s callerid:%s SpyeeConnectedLineName:%s SpyerExten:%s", event["Event"], event["CallerIDNum"], event["SpyeeConnectedLineName"], event["SpyerExten"])
|
|
|
//PAD answered by OCC; ICPs chanspy PAD
|
|
//PAD answered by OCC; ICPs chanspy PAD
|
|
|
- if utils.IsPAIU(event["SpyeeConnectedLineName"]) && utils.IsIO(event["SpyerExten"]) { // check if it is PAD whisper IO
|
|
|
|
|
|
|
+ if utils.IsPAIU(event["SpyeeConnectedLineName"]) && utils.IsIO(event["SpyerExten"]) { // check if it is PAD whisper IO/OCC
|
|
|
go Dial("0404", event["SpyeeConnectedLineName"], "chanspy-rule", "ano", "ano", "") //ICPs chanspy PAD
|
|
go Dial("0404", event["SpyeeConnectedLineName"], "chanspy-rule", "ano", "ano", "") //ICPs chanspy PAD
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -313,11 +342,15 @@ func HandleAMI(event map[string]string) {
|
|
|
if utils.IsICP(event["CallerIDNum"]) && event["Exten"] == "0500" { // PA end
|
|
if utils.IsICP(event["CallerIDNum"]) && event["Exten"] == "0500" { // PA end
|
|
|
lfshook.NewLogger().Infof("====PA status =====%s", "end")
|
|
lfshook.NewLogger().Infof("====PA status =====%s", "end")
|
|
|
priority.RunningTypePriority = 0
|
|
priority.RunningTypePriority = 0
|
|
|
|
|
+ priority.RunningType = ""
|
|
|
|
|
+ priority.RunningPATaskChan = ""
|
|
|
alstatus.PaStatus(event["CallerIDNum"], "PA", "end")
|
|
alstatus.PaStatus(event["CallerIDNum"], "PA", "end")
|
|
|
}
|
|
}
|
|
|
if utils.IsIO(event["CallerIDNum"]) && event["Exten"] == "0501" { //CPA end
|
|
if utils.IsIO(event["CallerIDNum"]) && event["Exten"] == "0501" { //CPA end
|
|
|
lfshook.NewLogger().Infof("====CPA status =====%s", "end")
|
|
lfshook.NewLogger().Infof("====CPA status =====%s", "end")
|
|
|
priority.RunningTypePriority = 0
|
|
priority.RunningTypePriority = 0
|
|
|
|
|
+ priority.RunningType = ""
|
|
|
|
|
+ priority.RunningPATaskChan = ""
|
|
|
alstatus.PaStatus(event["CallerIDNum"], "CPA", "end")
|
|
alstatus.PaStatus(event["CallerIDNum"], "CPA", "end")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -326,6 +359,7 @@ func HandleAMI(event map[string]string) {
|
|
|
//Cab Cab start
|
|
//Cab Cab start
|
|
|
if utils.IsICP(event["CallerIDNum"]) && utils.IsICP(event["ConnectedLineNum"]) && event["DialStatus"] == "ANSWER" {
|
|
if utils.IsICP(event["CallerIDNum"]) && utils.IsICP(event["ConnectedLineNum"]) && event["DialStatus"] == "ANSWER" {
|
|
|
priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.CabCab)
|
|
priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.CabCab)
|
|
|
|
|
+ priority.RunningType = "C2C"
|
|
|
alstatus.PaStatus(event["CallerIDNum"], "C2C", "start")
|
|
alstatus.PaStatus(event["CallerIDNum"], "C2C", "start")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -334,6 +368,7 @@ func HandleAMI(event map[string]string) {
|
|
|
//Cab Cab end
|
|
//Cab Cab end
|
|
|
if utils.IsICP(event["CallerIDNum"]) && utils.IsICP(event["ConnectedLineNum"]) && event["Exten"] == "0400" {
|
|
if utils.IsICP(event["CallerIDNum"]) && utils.IsICP(event["ConnectedLineNum"]) && event["Exten"] == "0400" {
|
|
|
priority.RunningTypePriority = 0
|
|
priority.RunningTypePriority = 0
|
|
|
|
|
+ priority.RunningType = ""
|
|
|
alstatus.PaStatus(event["CallerIDNum"], "C2C", "end")
|
|
alstatus.PaStatus(event["CallerIDNum"], "C2C", "end")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -343,8 +378,8 @@ func HandleAMI(event map[string]string) {
|
|
|
//update extension status
|
|
//update extension status
|
|
|
if event["StatusText"] == "Idle" || event["StatusText"] == "Unavailable" {
|
|
if event["StatusText"] == "Idle" || event["StatusText"] == "Unavailable" {
|
|
|
if len(event["Exten"]) > 3 && utils.IsPAIU(event["Exten"]) {
|
|
if len(event["Exten"]) > 3 && utils.IsPAIU(event["Exten"]) {
|
|
|
- alstatus.ExtenStatMap[event["Exten"]] = event["StatusText"]
|
|
|
|
|
-
|
|
|
|
|
|
|
+ //alstatus.ExtenStatMap[event["Exten"]] = event["StatusText"]
|
|
|
|
|
+ alstatus.SetExtenStat(event["Exten"], event["StatusText"])
|
|
|
//lfshook.NewLogger().Infof("======Extension Map : %+v==============", alstatus.ExtenStatMap)
|
|
//lfshook.NewLogger().Infof("======Extension Map : %+v==============", alstatus.ExtenStatMap)
|
|
|
alstatus.AlarmStatus(event["Exten"], event["StatusText"]) // PAD idle + unavailable
|
|
alstatus.AlarmStatus(event["Exten"], event["StatusText"]) // PAD idle + unavailable
|
|
|
}
|
|
}
|
|
@@ -357,6 +392,9 @@ func HandleAMI(event map[string]string) {
|
|
|
lfshook.NewLogger().Infof("====BridgeEnter==IN action===%s===ID:%s Name:%s", event["Event"], event["CallerIDNum"], event["CallerIDName"])
|
|
lfshook.NewLogger().Infof("====BridgeEnter==IN action===%s===ID:%s Name:%s", event["Event"], event["CallerIDNum"], event["CallerIDName"])
|
|
|
alstatus.AlarmStatus(event["CallerIDName"], "connect") // Alarm connected
|
|
alstatus.AlarmStatus(event["CallerIDName"], "connect") // Alarm connected
|
|
|
|
|
|
|
|
|
|
+ priority.RunningPATaskChan = event["Channel"]
|
|
|
|
|
+ priority.RunningType = "PAD-TMS"
|
|
|
|
|
+ priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.PADTMS)
|
|
|
if active.CabNum == "1" && active.Actived {
|
|
if active.CabNum == "1" && active.Actived {
|
|
|
go RedirectInQueue(event["CallerIDName"], "2311", "chanspy-rule-whisper", "") //PAD chanspy(EqW) ICP1
|
|
go RedirectInQueue(event["CallerIDName"], "2311", "chanspy-rule-whisper", "") //PAD chanspy(EqW) ICP1
|
|
|
go Dial("0403", event["CallerIDName"], "chanspy-rule", "2381", "2381", "8") //ICP8---chanspy----PAD
|
|
go Dial("0403", event["CallerIDName"], "chanspy-rule", "2381", "2381", "8") //ICP8---chanspy----PAD
|
|
@@ -365,6 +403,10 @@ func HandleAMI(event map[string]string) {
|
|
|
go Dial("0403", event["CallerIDName"], "chanspy-rule", "2311", "2311", "1") //ICP1---chanspy----PAD
|
|
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"]) { // PAD connect ICP-TMS;PACU not available
|
|
|
|
|
+
|
|
|
|
|
+ priority.RunningPATaskChan = event["Channel"]
|
|
|
|
|
+ priority.RunningType = "PAD-TMS"
|
|
|
|
|
+ priority.RunningTypePriority, _ = strconv.Atoi(priority.Priority.PADTMS)
|
|
|
lfshook.NewLogger().Infof("====send pad status=====")
|
|
lfshook.NewLogger().Infof("====send pad status=====")
|
|
|
alstatus.AlarmStatus(event["CallerIDNum"], "connect") // PAD connect ICP-TMS
|
|
alstatus.AlarmStatus(event["CallerIDNum"], "connect") // PAD connect ICP-TMS
|
|
|
}
|
|
}
|