|
|
@@ -519,9 +519,9 @@ func HandleAMI(event map[string]string) {
|
|
|
alstatus.PaStatus("", "PAD", "end")
|
|
|
utils.LoggerDebug.Printf("Check PAD-ICP queue chanspy-rule-whisper !")
|
|
|
|
|
|
- res, _ := QueueStatus("0301", "") // check ICP queue ,if empty PAD end
|
|
|
+ res, _ := QueueStatus("0300", "") // check ICP queue ,if empty PAD end
|
|
|
if res == nil {
|
|
|
- utils.LoggerDebug.Printf("Check PAD-OCC queue , return nill . exit !")
|
|
|
+ utils.LoggerDebug.Printf("Check PAD-ICP queue , return nill . exit !")
|
|
|
return
|
|
|
}
|
|
|
|
|
|
@@ -586,6 +586,7 @@ func HandleAMI(event map[string]string) {
|
|
|
break
|
|
|
}
|
|
|
|
|
|
+ utils.LoggerDebug.Printf("Before callernum=%s,callername:%s,qu:%s", event["CallerIDNum"], event["CallerIDName"], event["Queue"])
|
|
|
if utils.IsPAIU(event["CallerIDNum"]) && utils.IsPAIU(event["CallerIDName"]) && event["Queue"] == "0300" { // Alarm join the queue, PAD in the queue
|
|
|
alstatus.AlarmStatus(event["CallerIDNum"], "queue") //send status to STC
|
|
|
|
|
|
@@ -597,6 +598,8 @@ func HandleAMI(event map[string]string) {
|
|
|
if ICPQueue == nil {
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ utils.LoggerDebug.Printf("Before Set PAD timer ICPANSWER=%d ICPQUE-Calls=%s", priority.ICPAnswer, ICPQueue.Calls)
|
|
|
if priority.ICPAnswer == 0 && ICPQueue.Calls == "1" { //ICP did not answer any first call to the ICP queue ; Ready to Set Occ Queue Timer
|
|
|
toRunpriority := priority.GetPriorityByKey("PAD-ICP")
|
|
|
|
|
|
@@ -637,30 +640,8 @@ func HandleAMI(event map[string]string) {
|
|
|
}
|
|
|
|
|
|
if res.Calls == "0" { // OCC queue empty
|
|
|
- /*resCaller, err := QueueStatus("0300", "") // check ICP queue, get entries
|
|
|
- if err != nil {
|
|
|
- lfshook.NewLogger().Infof("ICP QueueStatus err:%+v", err)
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- if resCaller.Entrys != nil {
|
|
|
- sort.Slice(resCaller.Entrys, func(i, j int) bool {
|
|
|
- return resCaller.Entrys[i].Position < resCaller.Entrys[j].Position
|
|
|
- })
|
|
|
-
|
|
|
- for _, caller := range resCaller.Entrys {
|
|
|
- priority.ICPAnswer = 0
|
|
|
- //lfshook.NewLogger().Infof("====QueueCallerJoin==QueueTimer===%s", event["Event"])
|
|
|
- //lfshook.NewLogger().Infof("Redirect to 0301 extension:%s Pos:%s", caller.CallerIDNum, caller.Position)
|
|
|
- //order by pos
|
|
|
- utils.LoggerDebug.Printf("Redirect %s to OCC queue Pos:%s", caller.CallerIDNum, caller.Position)
|
|
|
- RedirectInQueue(caller.CallerIDNum, "0301", "queues-occ", caller.CallerIDNum) // redirect All ICP-PAD redirect to OCC queue
|
|
|
- time.Sleep(time.Millisecond * 100) //200 ms delay
|
|
|
- }
|
|
|
- }*/
|
|
|
-
|
|
|
+ priority.ICPAnswer = 0
|
|
|
for _, ret := range alstatus.PadQueues {
|
|
|
- priority.ICPAnswer = 0
|
|
|
//order by pos
|
|
|
RedirectInQueue(ret.Exten, "0301", "queues-occ", ret.Exten) // redirect All ICP-PAD redirect to OCC queue
|
|
|
time.Sleep(time.Millisecond * 100)
|
|
|
@@ -684,7 +665,7 @@ func HandleAMI(event map[string]string) {
|
|
|
|
|
|
runningTaskName := InterruptRunningTask("PAD-OCC") //PAD-OCC interrupt other
|
|
|
if runningTaskName != "" {
|
|
|
- time.Sleep(time.Millisecond * 100) //wait endpoint release
|
|
|
+ //time.Sleep(time.Millisecond * 100) //wait endpoint release
|
|
|
}
|
|
|
|
|
|
priority.OCCAnswer = 1
|