dujunchen 1 hafta önce
ebeveyn
işleme
68c166e9ca

+ 3 - 1
internal/app/stc/broadcast/stc-broadcast.go

@@ -277,7 +277,7 @@ func AlarmHandle(data []byte) {
 
 	switch handler {
 	case 0x01: //answer(ICP+Alarm+PACU)
-
+		//NotifyPaiu(exten, "answer")
 		err := action.RedirectInQueue(exten, "0402", "ani-rule", "1") // 1车ICP接听
 		if err != nil {
 			lfshook.NewLogger().Logger.Infof("================ICP Answer PAD====ERR============ : %+v", err.Error())
@@ -306,6 +306,7 @@ func AlarmHandle(data []byte) {
 		}
 
 	case 0x03: //hangup
+		//NotifyPaiu(exten, "hangup")
 		action.Hangup(exten)
 	}
 }
@@ -322,6 +323,7 @@ func NotifyPaiu(Exten, Action string) {
 		url = fmt.Sprintf("http://10.0.24.%s/api/sipphone?action=hangup", Exten[2:])
 	}
 
+	lfshook.NewLogger().Logger.Infof("======Notify PAIU Alarm====:%+v ", url)
 	resp, err := http.Get(url)
 	if err != nil {
 		lfshook.NewLogger().Logger.Infof("======Notify PAIU Alarm====:%+v ", err)

+ 2 - 2
internal/app/stc/index.go

@@ -23,10 +23,10 @@ const RemoteAddr = "10.0.11.11"
 func StartStcConnection(conn net.Conn) {
 	//var conn net.Conn
 	var wg sync.WaitGroup
-
+	var err error
 	for {
 		// 尝试建立连接
-		conn, err := CreateConnection()
+		conn, err = CreateConnection()
 		if err != nil {
 			time.Sleep(2 * time.Second)
 			continue