|
@@ -44,61 +44,61 @@ func HandleAMI(event map[string]string) {
|
|
|
/*case "DialBegin":
|
|
/*case "DialBegin":
|
|
|
lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
|
if utils.IsPAIU(event["CallerIDNum"]) && utils.IsICP(event["DestCallerIDNum"]) {
|
|
if utils.IsPAIU(event["CallerIDNum"]) && utils.IsICP(event["DestCallerIDNum"]) {
|
|
|
- alstatus.AlarmStatus(event["CallerIDNum"], "dial", conn) // Alarm dial ICP start
|
|
|
|
|
|
|
+ alstatus.AlarmStatus(event["CallerIDNum"], "dial") // Alarm dial ICP start
|
|
|
}
|
|
}
|
|
|
*/
|
|
*/
|
|
|
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
|
|
|
- alstatus.PaStatus(event["CallerIDNum"], "PAD", "start", conn)
|
|
|
|
|
- alstatus.AlarmStatus(event["CallerIDNum"], "dial", conn)
|
|
|
|
|
|
|
+ alstatus.PaStatus(event["CallerIDNum"], "PAD", "start")
|
|
|
|
|
+ alstatus.AlarmStatus(event["CallerIDNum"], "dial")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
case "Hangup":
|
|
case "Hangup":
|
|
|
lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
|
if utils.IsPAIU(event["CallerIDNum"]) && utils.IsICP(event["Exten"]) { // Alarm dial queue start; PAD dialing
|
|
if utils.IsPAIU(event["CallerIDNum"]) && utils.IsICP(event["Exten"]) { // Alarm dial queue start; PAD dialing
|
|
|
- alstatus.PaStatus(event["CallerIDNum"], "PAD", "end", conn)
|
|
|
|
|
|
|
+ alstatus.PaStatus(event["CallerIDNum"], "PAD", "end")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
case "QueueCallerJoin":
|
|
case "QueueCallerJoin":
|
|
|
lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
|
if utils.IsPAIU(event["CallerIDNum"]) { // Alarm join the queue, PAD in the queue
|
|
if utils.IsPAIU(event["CallerIDNum"]) { // Alarm join the queue, PAD in the queue
|
|
|
- alstatus.AlarmStatus(event["CallerIDNum"], "queue", conn)
|
|
|
|
|
|
|
+ alstatus.AlarmStatus(event["CallerIDNum"], "queue")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
case "ConfbridgeJoin":
|
|
case "ConfbridgeJoin":
|
|
|
lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
|
if utils.IsICP(event["CallerIDNum"]) && event["Exten"] == "0500" { // PA start
|
|
if utils.IsICP(event["CallerIDNum"]) && event["Exten"] == "0500" { // PA start
|
|
|
lfshook.NewLogger().Infof("====PA status:%s=====", "start")
|
|
lfshook.NewLogger().Infof("====PA status:%s=====", "start")
|
|
|
- alstatus.PaStatus(event["CallerIDNum"], "PA", "start", conn)
|
|
|
|
|
|
|
+ alstatus.PaStatus(event["CallerIDNum"], "PA", "start")
|
|
|
}
|
|
}
|
|
|
if utils.IsIO(event["CallerIDNum"]) && event["Exten"] == "0500" { //CPA start
|
|
if utils.IsIO(event["CallerIDNum"]) && event["Exten"] == "0500" { //CPA start
|
|
|
lfshook.NewLogger().Infof("====CPA status:%s=====", "start")
|
|
lfshook.NewLogger().Infof("====CPA status:%s=====", "start")
|
|
|
- alstatus.PaStatus(event["CallerIDNum"], "CPA", "start", conn)
|
|
|
|
|
|
|
+ alstatus.PaStatus(event["CallerIDNum"], "CPA", "start")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
lfshook.NewLogger().Infof("====PA status =====%s", "end")
|
|
lfshook.NewLogger().Infof("====PA status =====%s", "end")
|
|
|
- alstatus.PaStatus(event["CallerIDNum"], "PA", "end", conn)
|
|
|
|
|
|
|
+ alstatus.PaStatus(event["CallerIDNum"], "PA", "end")
|
|
|
}
|
|
}
|
|
|
if utils.IsIO(event["CallerIDNum"]) && event["Exten"] == "0500" { //CPA end
|
|
if utils.IsIO(event["CallerIDNum"]) && event["Exten"] == "0500" { //CPA end
|
|
|
lfshook.NewLogger().Infof("====CPA status =====%s", "end")
|
|
lfshook.NewLogger().Infof("====CPA status =====%s", "end")
|
|
|
- alstatus.PaStatus(event["CallerIDNum"], "CPA", "end", conn)
|
|
|
|
|
|
|
+ alstatus.PaStatus(event["CallerIDNum"], "CPA", "end")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
case "DialEnd":
|
|
case "DialEnd":
|
|
|
lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
lfshook.NewLogger().Infof("=========%s", event["Event"])
|
|
|
//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" {
|
|
|
- alstatus.PaStatus(event["CallerIDNum"], "C2C", "start", conn)
|
|
|
|
|
|
|
+ alstatus.PaStatus(event["CallerIDNum"], "C2C", "start")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
case "BridgeLeave":
|
|
case "BridgeLeave":
|
|
|
//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", conn)
|
|
|
|
|
|
|
+ alstatus.PaStatus(event["CallerIDNum"], "C2C", "end")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
case "ExtensionStatus":
|
|
case "ExtensionStatus":
|
|
@@ -114,7 +114,7 @@ func HandleAMI(event map[string]string) {
|
|
|
}
|
|
}
|
|
|
if event["StatusText"] == "Idle" || event["StatusText"] == "Unavailable" {
|
|
if event["StatusText"] == "Idle" || event["StatusText"] == "Unavailable" {
|
|
|
if len(event["Exten"]) > 3 {
|
|
if len(event["Exten"]) > 3 {
|
|
|
- alstatus.AlarmStatus(event["Exten"], event["StatusText"], conn) // PAD idle + unavailable
|
|
|
|
|
|
|
+ alstatus.AlarmStatus(event["Exten"], event["StatusText"]) // PAD idle + unavailable
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -123,12 +123,12 @@ func HandleAMI(event map[string]string) {
|
|
|
if utils.IsPACU(event["CallerIDNum"]) {
|
|
if utils.IsPACU(event["CallerIDNum"]) {
|
|
|
if utils.IsPAIU(event["CallerIDName"]) { //relate to PACU Dial ICP caller name in AlarmHandle
|
|
if utils.IsPAIU(event["CallerIDName"]) { //relate to PACU Dial ICP caller name in AlarmHandle
|
|
|
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", conn) // Alarm connected
|
|
|
|
|
|
|
+ alstatus.AlarmStatus(event["CallerIDName"], "connect") // Alarm connected
|
|
|
go RedirectInQueue(event["CallerIDName"], "2311", "chanspy-rule", "") // 1车ICP接听PAIU
|
|
go RedirectInQueue(event["CallerIDName"], "2311", "chanspy-rule", "") // 1车ICP接听PAIU
|
|
|
}
|
|
}
|
|
|
} else if utils.IsPAIU(event["CallerIDNum"]) { //No PACU available in the cab
|
|
} else if utils.IsPAIU(event["CallerIDNum"]) { //No PACU available in the cab
|
|
|
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", conn) // Alarm connected
|
|
|
|
|
|
|
+ alstatus.AlarmStatus(event["CallerIDName"], "connect") // Alarm connected
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|