|
@@ -67,6 +67,8 @@ func HandleAMI(event map[string]string) {
|
|
|
if event["UserEvent"] == "CallType" && (event["Type"] == "PA" || event["Type"] == "CPA") { //PA start; check manual PA priority
|
|
if event["UserEvent"] == "CallType" && (event["Type"] == "PA" || event["Type"] == "CPA") { //PA start; check manual PA priority
|
|
|
//PA & CPA interrupt others
|
|
//PA & CPA interrupt others
|
|
|
if utils.IsICP(event["CallerIDNum"]) { //PA
|
|
if utils.IsICP(event["CallerIDNum"]) { //PA
|
|
|
|
|
+ //清除标记
|
|
|
|
|
+
|
|
|
utils.LoggerDebug.Printf("Get UserEvent , %s calling !", event["Type"])
|
|
utils.LoggerDebug.Printf("Get UserEvent , %s calling !", event["Type"])
|
|
|
if active.ActivedCab == "" { //No active Signal on both side,Hangup caller
|
|
if active.ActivedCab == "" { //No active Signal on both side,Hangup caller
|
|
|
Hangup(event["CallerIDNum"])
|
|
Hangup(event["CallerIDNum"])
|
|
@@ -85,6 +87,10 @@ func HandleAMI(event map[string]string) {
|
|
|
time.Sleep(time.Millisecond * 100) //wait endpoint release
|
|
time.Sleep(time.Millisecond * 100) //wait endpoint release
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if priority.TaskCreating == "PA" {
|
|
|
|
|
+ utils.LoggerDebug.Printf("PA : Clean priority.TaskCreating = '' !")
|
|
|
|
|
+ priority.TaskCreating = ""
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
if priority.TaskCreating == "PA" {
|
|
if priority.TaskCreating == "PA" {
|
|
|
utils.LoggerDebug.Printf("PA : Clean priority.TaskCreating = '' !")
|
|
utils.LoggerDebug.Printf("PA : Clean priority.TaskCreating = '' !")
|
|
@@ -95,12 +101,16 @@ func HandleAMI(event map[string]string) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
time.Sleep(1 * time.Second)
|
|
time.Sleep(1 * time.Second)
|
|
|
- if priority.TaskCreating == "PA" {
|
|
|
|
|
- utils.LoggerDebug.Printf("PA : Clean priority.TaskCreating = '' !")
|
|
|
|
|
- priority.TaskCreating = ""
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ priority.PAInterrupt = 0
|
|
|
} else if utils.IsIO(event["CallerIDNum"]) { // CPA
|
|
} else if utils.IsIO(event["CallerIDNum"]) { // CPA
|
|
|
|
|
|
|
|
|
|
+ if /*priority.CABInterrupt == 1 || */ priority.PAInterrupt == 1 {
|
|
|
|
|
+ utils.LoggerDebug.Printf("Get UserEvent CPA calling ! Ignored because of PAInterrupt=1 !")
|
|
|
|
|
+ Hangup(event["CallerIDNum"])
|
|
|
|
|
+ //priority.CPAActived = 1 //CPA触发,但未运行
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
utils.LoggerDebug.Printf("Get UserEvent , %s calling !", event["Type"])
|
|
utils.LoggerDebug.Printf("Get UserEvent , %s calling !", event["Type"])
|
|
|
WaitTaskCreate("CPA", event["CallerIDNum"])
|
|
WaitTaskCreate("CPA", event["CallerIDNum"])
|
|
|
|
|
|
|
@@ -149,6 +159,7 @@ func HandleAMI(event map[string]string) {
|
|
|
}
|
|
}
|
|
|
utils.LoggerDebug.Printf("CPA calling failed , check priority return false !")
|
|
utils.LoggerDebug.Printf("CPA calling failed , check priority return false !")
|
|
|
Hangup(event["CallerIDNum"]) //lowwer priority ,hangup caller
|
|
Hangup(event["CallerIDNum"]) //lowwer priority ,hangup caller
|
|
|
|
|
+ //priority.CPAActived = 1 //CPA触发,但未运行
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
time.Sleep(1 * time.Second)
|
|
time.Sleep(1 * time.Second)
|
|
@@ -159,7 +170,7 @@ func HandleAMI(event map[string]string) {
|
|
|
}
|
|
}
|
|
|
} else if event["UserEvent"] == "CallType" && event["Type"] == "C2C" { //CabCab start; check cab cab priority
|
|
} else if event["UserEvent"] == "CallType" && event["Type"] == "C2C" { //CabCab start; check cab cab priority
|
|
|
utils.LoggerDebug.Printf("Get UserEvent , %s calling !", event["Type"])
|
|
utils.LoggerDebug.Printf("Get UserEvent , %s calling !", event["Type"])
|
|
|
- priority.CABInterrupt = 0
|
|
|
|
|
|
|
+
|
|
|
WaitTaskCreate("C2C", event["CallerIDNum"])
|
|
WaitTaskCreate("C2C", event["CallerIDNum"])
|
|
|
|
|
|
|
|
if priority.CheckPriority("CabCab") { // interrupt OCC-PAD
|
|
if priority.CheckPriority("CabCab") { // interrupt OCC-PAD
|
|
@@ -187,6 +198,8 @@ func HandleAMI(event map[string]string) {
|
|
|
}
|
|
}
|
|
|
//}
|
|
//}
|
|
|
}
|
|
}
|
|
|
|
|
+ time.Sleep(time.Second * 1)
|
|
|
|
|
+ priority.CABInterrupt = 0
|
|
|
|
|
|
|
|
} else { // hangup caller; C2C start failed
|
|
} else { // hangup caller; C2C start failed
|
|
|
//lfshook.NewLogger().Infof("CabCab hangup caller %s", event["CallerIDNum"])
|
|
//lfshook.NewLogger().Infof("CabCab hangup caller %s", event["CallerIDNum"])
|
|
@@ -361,15 +374,14 @@ func HandleAMI(event map[string]string) {
|
|
|
priority.RegistryTask.StopAndUnregister("PAD-OCC")
|
|
priority.RegistryTask.StopAndUnregister("PAD-OCC")
|
|
|
ConfbridgeKick(taskTmp.ConfbridgeID, "all")
|
|
ConfbridgeKick(taskTmp.ConfbridgeID, "all")
|
|
|
|
|
|
|
|
|
|
+ time.Sleep(time.Millisecond * 500) //wait CPA Active
|
|
|
//check resume
|
|
//check resume
|
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
|
if ok {
|
|
if ok {
|
|
|
if taskName == "EMG" {
|
|
if taskName == "EMG" {
|
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
|
} else if taskName == "CPA" {
|
|
} else if taskName == "CPA" {
|
|
|
- if CPAConfbridgeReinvite(task.ConfbridgeID) {
|
|
|
|
|
- alstatus.PaStatus("", "CPA", "start")
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ CPAConfbridgeReinvite(task.ConfbridgeID)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -386,7 +398,7 @@ func HandleAMI(event map[string]string) {
|
|
|
//time.Sleep(time.Millisecond * 100) //wait io idle
|
|
//time.Sleep(time.Millisecond * 100) //wait io idle
|
|
|
//lfshook.NewLogger().Infof("====Start OCC-PAD===next==%+v", res)
|
|
//lfshook.NewLogger().Infof("====Start OCC-PAD===next==%+v", res)
|
|
|
if active.TrainDevide == 0 { //列车没有断开
|
|
if active.TrainDevide == 0 { //列车没有断开
|
|
|
- if (active.ActivedCab == "1" && ExtenStatus("1411") == "Idle") || (active.ActivedCab == "" && active.ActivedCabDelay == "1" && ExtenStatus("1411") == "Idle") { //check active and OCC status
|
|
|
|
|
|
|
+ if (ExtenStatus("1411") == "Idle") && ((active.ActivedCab == "1" || (active.ActivedCab == "" && active.ActivedCabDelay == "1")) || (active.ActivedCab == "" && active.ActivedCabDelay == "")) { //check active and OCC status
|
|
|
time.Sleep(time.Second)
|
|
time.Sleep(time.Second)
|
|
|
PADChan := ""
|
|
PADChan := ""
|
|
|
|
|
|
|
@@ -499,16 +511,14 @@ func HandleAMI(event map[string]string) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if priority.OCCAnswer == 0 { // not OCC-PAD
|
|
if priority.OCCAnswer == 0 { // not OCC-PAD
|
|
|
|
|
+ time.Sleep(time.Millisecond * 500) //wait CPA Active
|
|
|
//check resume
|
|
//check resume
|
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
|
if ok {
|
|
if ok {
|
|
|
if taskName == "EMG" {
|
|
if taskName == "EMG" {
|
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
|
- //alstatus.PaStatus("", "EMG", "start")
|
|
|
|
|
} else if taskName == "CPA" {
|
|
} else if taskName == "CPA" {
|
|
|
- if CPAConfbridgeReinvite(task.ConfbridgeID) {
|
|
|
|
|
- alstatus.PaStatus("", "CPA", "start")
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ CPAConfbridgeReinvite(task.ConfbridgeID)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -531,11 +541,8 @@ func HandleAMI(event map[string]string) {
|
|
|
if ok {
|
|
if ok {
|
|
|
if taskName == "EMG" {
|
|
if taskName == "EMG" {
|
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
|
- //alstatus.PaStatus("", "EMG", "start")
|
|
|
|
|
} else if taskName == "CPA" {
|
|
} else if taskName == "CPA" {
|
|
|
- if CPAConfbridgeReinvite(task.ConfbridgeID) {
|
|
|
|
|
- alstatus.PaStatus("", "CPA", "start")
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ CPAConfbridgeReinvite(task.ConfbridgeID)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -656,7 +663,7 @@ func HandleAMI(event map[string]string) {
|
|
|
time.Sleep(time.Millisecond * 300)
|
|
time.Sleep(time.Millisecond * 300)
|
|
|
|
|
|
|
|
if active.TrainDevide == 0 { //列车没有断开
|
|
if active.TrainDevide == 0 { //列车没有断开
|
|
|
- if (active.ActivedCab == "1" && ExtenStatus("1411") == "Idle") || (active.ActivedCab == "" && active.ActivedCabDelay == "1" && ExtenStatus("1411") == "Idle") { //check active and OCC status
|
|
|
|
|
|
|
+ if (ExtenStatus("1411") == "Idle") && ((active.ActivedCab == "1" || (active.ActivedCab == "" && active.ActivedCabDelay == "1")) || (active.ActivedCab == "" && active.ActivedCabDelay == "")) { //check active and OCC status
|
|
|
utils.LoggerDebug.Printf("PAD %s goto OCC1 .", event["CallerIDNum"])
|
|
utils.LoggerDebug.Printf("PAD %s goto OCC1 .", event["CallerIDNum"])
|
|
|
alstatus.AlarmStatus(event["CallerIDNum"], "connect")
|
|
alstatus.AlarmStatus(event["CallerIDNum"], "connect")
|
|
|
go RedirectInQueue(event["Channel"], "1411", "pad-page-occ-icp", event["CallerIDNum"]) //PAD Page(OCC+ICPs)
|
|
go RedirectInQueue(event["Channel"], "1411", "pad-page-occ-icp", event["CallerIDNum"]) //PAD Page(OCC+ICPs)
|
|
@@ -907,7 +914,7 @@ func HandleAMI(event map[string]string) {
|
|
|
*/
|
|
*/
|
|
|
//Send PA start msg to STC
|
|
//Send PA start msg to STC
|
|
|
if utils.IsICP(event["CallerIDNum"]) && event["Exten"] == "0500" { // PA start
|
|
if utils.IsICP(event["CallerIDNum"]) && event["Exten"] == "0500" { // PA start
|
|
|
-
|
|
|
|
|
|
|
+ priority.PAInterrupt = 0
|
|
|
alstatus.PaStatus(event["CallerIDNum"], "PA", "start")
|
|
alstatus.PaStatus(event["CallerIDNum"], "PA", "start")
|
|
|
//================================
|
|
//================================
|
|
|
task := priority.TaskInfo{
|
|
task := priority.TaskInfo{
|
|
@@ -926,7 +933,6 @@ func HandleAMI(event map[string]string) {
|
|
|
priority.TaskCreating = ""
|
|
priority.TaskCreating = ""
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- priority.PAInterrupt = 0 //清除标记
|
|
|
|
|
//check PAD timer
|
|
//check PAD timer
|
|
|
if priority.AllTasks.PADOCC.Priority > priority.AllTasks.PA.Priority {
|
|
if priority.AllTasks.PADOCC.Priority > priority.AllTasks.PA.Priority {
|
|
|
if active.QueueTimer != nil {
|
|
if active.QueueTimer != nil {
|
|
@@ -954,7 +960,7 @@ func HandleAMI(event map[string]string) {
|
|
|
utils.LoggerDebug.Printf("CPA Runing , Set CPA task info %+v .", task)
|
|
utils.LoggerDebug.Printf("CPA Runing , Set CPA task info %+v .", task)
|
|
|
priority.RegistryTask.Register("CPA", task)
|
|
priority.RegistryTask.Register("CPA", task)
|
|
|
|
|
|
|
|
- utils.LoggerDebug.Printf("CPA Runing , Set CPA task info %+v .", priority.RegistryTask.ListAll())
|
|
|
|
|
|
|
+ //utils.LoggerDebug.Printf("CPA Runing , Set CPA task info %+v .", priority.RegistryTask.ListAll())
|
|
|
|
|
|
|
|
if priority.TaskCreating == "CPA" {
|
|
if priority.TaskCreating == "CPA" {
|
|
|
utils.LoggerDebug.Printf("CPA Connected : Clean priority.TaskCreating = '' !")
|
|
utils.LoggerDebug.Printf("CPA Connected : Clean priority.TaskCreating = '' !")
|
|
@@ -1056,21 +1062,19 @@ func HandleAMI(event map[string]string) {
|
|
|
case "ConfbridgeLeave":
|
|
case "ConfbridgeLeave":
|
|
|
lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
|
if utils.IsICP(event["CallerIDNum"]) && event["Exten"] == "0500" { // PA end
|
|
if utils.IsICP(event["CallerIDNum"]) && event["Exten"] == "0500" { // PA end
|
|
|
-
|
|
|
|
|
alstatus.PaStatus(event["CallerIDNum"], "PA", "end")
|
|
alstatus.PaStatus(event["CallerIDNum"], "PA", "end")
|
|
|
|
|
|
|
|
priority.RegistryTask.StopAndUnregister("PA")
|
|
priority.RegistryTask.StopAndUnregister("PA")
|
|
|
SetPadTimer()
|
|
SetPadTimer()
|
|
|
|
|
+
|
|
|
|
|
+ time.Sleep(time.Millisecond * 500) //wait CPA Active
|
|
|
// check resume
|
|
// check resume
|
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
|
if ok {
|
|
if ok {
|
|
|
if taskName == "EMG" {
|
|
if taskName == "EMG" {
|
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
|
- //alstatus.PaStatus("", "EMG", "start")
|
|
|
|
|
} else if taskName == "CPA" {
|
|
} else if taskName == "CPA" {
|
|
|
- if CPAConfbridgeReinvite(task.ConfbridgeID) {
|
|
|
|
|
- alstatus.PaStatus("", "CPA", "start")
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ CPAConfbridgeReinvite(task.ConfbridgeID)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1085,12 +1089,13 @@ func HandleAMI(event map[string]string) {
|
|
|
}
|
|
}
|
|
|
priority.RegistryTask.StopAndUnregister("CPA")
|
|
priority.RegistryTask.StopAndUnregister("CPA")
|
|
|
SetPadTimer()
|
|
SetPadTimer()
|
|
|
|
|
+
|
|
|
|
|
+ time.Sleep(time.Millisecond * 500) //wait CPA Active
|
|
|
//check resume
|
|
//check resume
|
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
|
if ok {
|
|
if ok {
|
|
|
if taskName == "EMG" {
|
|
if taskName == "EMG" {
|
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
|
- //alstatus.PaStatus("", "EMG", "start")
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1106,13 +1111,13 @@ func HandleAMI(event map[string]string) {
|
|
|
}
|
|
}
|
|
|
priority.RegistryTask.StopAndUnregister("EMG")
|
|
priority.RegistryTask.StopAndUnregister("EMG")
|
|
|
SetPadTimer()
|
|
SetPadTimer()
|
|
|
|
|
+
|
|
|
|
|
+ time.Sleep(time.Millisecond * 500) //wait CPA Active
|
|
|
//check resume
|
|
//check resume
|
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
|
if ok {
|
|
if ok {
|
|
|
if taskName == "CPA" {
|
|
if taskName == "CPA" {
|
|
|
- if CPAConfbridgeReinvite(task.ConfbridgeID) {
|
|
|
|
|
- alstatus.PaStatus("", "CPA", "start")
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ CPAConfbridgeReinvite(task.ConfbridgeID)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1127,16 +1132,15 @@ func HandleAMI(event map[string]string) {
|
|
|
}
|
|
}
|
|
|
priority.RegistryTask.StopAndUnregister("STN")
|
|
priority.RegistryTask.StopAndUnregister("STN")
|
|
|
SetPadTimer()
|
|
SetPadTimer()
|
|
|
|
|
+
|
|
|
|
|
+ time.Sleep(time.Millisecond * 500) //wait CPA Active
|
|
|
//check resume
|
|
//check resume
|
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
|
if ok {
|
|
if ok {
|
|
|
if taskName == "CPA" {
|
|
if taskName == "CPA" {
|
|
|
- if CPAConfbridgeReinvite(task.ConfbridgeID) {
|
|
|
|
|
- alstatus.PaStatus("", "CPA", "start")
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ CPAConfbridgeReinvite(task.ConfbridgeID)
|
|
|
} else if taskName == "EMG" {
|
|
} else if taskName == "EMG" {
|
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
|
- //alstatus.PaStatus("", "EMG", "start")
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1151,16 +1155,15 @@ func HandleAMI(event map[string]string) {
|
|
|
}
|
|
}
|
|
|
priority.RegistryTask.StopAndUnregister("DCS")
|
|
priority.RegistryTask.StopAndUnregister("DCS")
|
|
|
SetPadTimer()
|
|
SetPadTimer()
|
|
|
|
|
+
|
|
|
|
|
+ time.Sleep(time.Millisecond * 500) //wait CPA Active
|
|
|
//check resume
|
|
//check resume
|
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
|
if ok {
|
|
if ok {
|
|
|
if taskName == "CPA" {
|
|
if taskName == "CPA" {
|
|
|
- if CPAConfbridgeReinvite(task.ConfbridgeID) {
|
|
|
|
|
- alstatus.PaStatus("", "CPA", "start")
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ CPAConfbridgeReinvite(task.ConfbridgeID)
|
|
|
} else if taskName == "EMG" {
|
|
} else if taskName == "EMG" {
|
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
|
- //alstatus.PaStatus("", "EMG", "start")
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1175,16 +1178,15 @@ func HandleAMI(event map[string]string) {
|
|
|
}
|
|
}
|
|
|
priority.RegistryTask.StopAndUnregister("SPC")
|
|
priority.RegistryTask.StopAndUnregister("SPC")
|
|
|
SetPadTimer()
|
|
SetPadTimer()
|
|
|
|
|
+
|
|
|
|
|
+ time.Sleep(time.Millisecond * 500) //wait CPA Active
|
|
|
//check resume
|
|
//check resume
|
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
|
if ok {
|
|
if ok {
|
|
|
if taskName == "CPA" {
|
|
if taskName == "CPA" {
|
|
|
- if CPAConfbridgeReinvite(task.ConfbridgeID) {
|
|
|
|
|
- alstatus.PaStatus("", "CPA", "start")
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ CPAConfbridgeReinvite(task.ConfbridgeID)
|
|
|
} else if taskName == "EMG" {
|
|
} else if taskName == "EMG" {
|
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
|
- //alstatus.PaStatus("", "EMG", "start")
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1199,16 +1201,15 @@ func HandleAMI(event map[string]string) {
|
|
|
}
|
|
}
|
|
|
priority.RegistryTask.StopAndUnregister("CHK")
|
|
priority.RegistryTask.StopAndUnregister("CHK")
|
|
|
SetPadTimer()
|
|
SetPadTimer()
|
|
|
|
|
+
|
|
|
|
|
+ time.Sleep(time.Millisecond * 500) //wait CPA Active
|
|
|
//check resume
|
|
//check resume
|
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
|
if ok {
|
|
if ok {
|
|
|
if taskName == "CPA" {
|
|
if taskName == "CPA" {
|
|
|
- if CPAConfbridgeReinvite(task.ConfbridgeID) {
|
|
|
|
|
- alstatus.PaStatus("", "CPA", "start")
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ CPAConfbridgeReinvite(task.ConfbridgeID)
|
|
|
} else if taskName == "EMG" {
|
|
} else if taskName == "EMG" {
|
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
|
- //alstatus.PaStatus("", "EMG", "start")
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1223,16 +1224,15 @@ func HandleAMI(event map[string]string) {
|
|
|
}
|
|
}
|
|
|
priority.RegistryTask.StopAndUnregister("VOL")
|
|
priority.RegistryTask.StopAndUnregister("VOL")
|
|
|
SetPadTimer()
|
|
SetPadTimer()
|
|
|
|
|
+
|
|
|
|
|
+ time.Sleep(time.Millisecond * 500) //wait CPA Active
|
|
|
//check resume
|
|
//check resume
|
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
|
if ok {
|
|
if ok {
|
|
|
if taskName == "CPA" {
|
|
if taskName == "CPA" {
|
|
|
- if CPAConfbridgeReinvite(task.ConfbridgeID) {
|
|
|
|
|
- alstatus.PaStatus("", "CPA", "start")
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ CPAConfbridgeReinvite(task.ConfbridgeID)
|
|
|
} else if taskName == "EMG" {
|
|
} else if taskName == "EMG" {
|
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
|
- //alstatus.PaStatus("", "EMG", "start")
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1252,6 +1252,7 @@ func HandleAMI(event map[string]string) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
priority.RegistryTask.Register("C2C", task)
|
|
priority.RegistryTask.Register("C2C", task)
|
|
|
|
|
+ priority.CABInterrupt = 0
|
|
|
alstatus.PaStatus(event["CallerIDNum"], "C2C", "start")
|
|
alstatus.PaStatus(event["CallerIDNum"], "C2C", "start")
|
|
|
if priority.TaskCreating == "C2C" {
|
|
if priority.TaskCreating == "C2C" {
|
|
|
utils.LoggerDebug.Printf("C2C Connected : Clean priority.TaskCreating = '' !")
|
|
utils.LoggerDebug.Printf("C2C Connected : Clean priority.TaskCreating = '' !")
|
|
@@ -1319,20 +1320,19 @@ func HandleAMI(event map[string]string) {
|
|
|
//lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
//lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
|
//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" {
|
|
|
-
|
|
|
|
|
alstatus.PaStatus(event["CallerIDNum"], "C2C", "end")
|
|
alstatus.PaStatus(event["CallerIDNum"], "C2C", "end")
|
|
|
priority.RegistryTask.StopAndUnregister("C2C")
|
|
priority.RegistryTask.StopAndUnregister("C2C")
|
|
|
//time.Sleep(time.Millisecond * 100)
|
|
//time.Sleep(time.Millisecond * 100)
|
|
|
SetPadTimer()
|
|
SetPadTimer()
|
|
|
|
|
+
|
|
|
|
|
+ time.Sleep(time.Millisecond * 500) //wait CPA Active
|
|
|
//check resume
|
|
//check resume
|
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
taskName, task, ok := priority.RegistryTask.HighestPriorityRunningTask1()
|
|
|
if ok {
|
|
if ok {
|
|
|
if taskName == "EMG" {
|
|
if taskName == "EMG" {
|
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
EMGConfbridgeReinvite(task.ConfbridgeID)
|
|
|
} else if taskName == "CPA" {
|
|
} else if taskName == "CPA" {
|
|
|
- if CPAConfbridgeReinvite(task.ConfbridgeID) {
|
|
|
|
|
- alstatus.PaStatus("", "CPA", "start")
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ CPAConfbridgeReinvite(task.ConfbridgeID)
|
|
|
} else {
|
|
} else {
|
|
|
ICPConfbridgeReinvite(task.ConfbridgeID, taskName)
|
|
ICPConfbridgeReinvite(task.ConfbridgeID, taskName)
|
|
|
}
|
|
}
|