dujunchen 3 settimane fa
parent
commit
f672c2bcef
2 ha cambiato i file con 9 aggiunte e 6 eliminazioni
  1. 8 5
      internal/app/ami/action/index.go
  2. 1 1
      internal/app/index.go

+ 8 - 5
internal/app/ami/action/index.go

@@ -27,7 +27,7 @@ func HandleAMI(event map[string]string) {
 
 	switch event["Event"] {
 
-	case "DTMFBegin": //ICP interrupt PAD
+	case "DTMFBegin": //ICP interrupt PAD-ICP
 
 		if utils.IsICP(event["CallerIDNum"]) {
 			//exten := strings.Split(strings.Split(event["Channel"], "/")[1], "-")[0] //get ICP exten number
@@ -51,6 +51,7 @@ func HandleAMI(event map[string]string) {
 
 						number := strings.Split(strings.Split(ret.Channel, "-")[0], "/")[1]
 						active.NotifyPaiu(number, "hold")
+						HangupAllLocalChan()
 					} else if utils.IsPAIU(ret.CallerIDNum) && ret.ChannelStateDesc == "Up" && utils.IsICP(ret.ConnectedLineNum) {
 						lfshook.NewLogger().Infof("===Hangup=Chan===%+v==== ", ret.Channel)
 						Hangup(ret.Channel)
@@ -209,10 +210,12 @@ func HandleAMI(event map[string]string) {
 				} else {
 					//Hangup the other ICP
 					lfshook.NewLogger().Infof("========CabCab  hangup other one====%s", event["CallerIDNum"])
-					if event["CallerIDNum"] == "2311" {
-						Hangup("2381")
-					} else {
-						Hangup("2311")
+					if priority.RunningType != "" {
+						if event["CallerIDNum"] == "2311" {
+							Hangup("2381")
+						} else {
+							Hangup("2311")
+						}
 					}
 				}
 			} else { // hangup caller; C2C start failed

+ 1 - 1
internal/app/index.go

@@ -18,7 +18,7 @@ func StartApp() {
 	//Get cab number acording to IP
 	SetMasterCabNum()
 
-	//lfshook.NewLogger().Infof("=================cab number:%s========Master:%+v===", active.CabNum, active.Master)
+	lfshook.NewLogger().Infof("=================cab number:%s========Master:%+v===", active.CabNum, active.Master)
 
 	//init the active status
 	//active.ActivedCab = ""