sinake
3 天以前 ebff666f223d920fb34cc79942fbbd59cc3038cb
src/components/CallButton/index.vue
@@ -106,21 +106,37 @@
        // 先检查是否可以呼叫
        const { canCall, reason } = sipService.canMakeCall();
        if (!canCall) {
          this.$message.warning(reason);
          return;
          const { canCall, reason } = sipService.canMakeCall();
          //this.$message.warning(reason);
          //return;
        }
        this.callStatus = "calling";
        this.isCalling = true;
        console.log("开始呼叫:", sipService);
        await sipService.makeCall(this.phoneNumber);
        await sipService.makeCall("0"+this.phoneNumber);
      } catch (error) {
        let registrationTime = Date.now(); // 记录注销成功时间
        console.log(registrationTime, "呼叫失败时间");
        console.error("呼叫失败1:", error);
        this.callStatus = "ended";
        this.isCalling = false;
        this.$message.error(`呼叫失败: ${error.message}`);
        // this.callStatus = "ended";
        // this.isCalling = false;
        //this.$message.error(`呼叫失败: ${error.message}`);
          try {
          // 先检查是否可以呼叫
          const { canCall, reason } = sipService.canMakeCall();
          if (!canCall) {
            const { canCall, reason } = sipService.canMakeCall();
          }
          this.callStatus = "calling";
          this.isCalling = true;
          console.log("开始呼叫:", sipService);
          await sipService.makeCall("0"+this.phoneNumber);
        } catch (error) {
           this.callStatus = "ended";
           this.isCalling = false;
        }
      }
    },