| | |
| | | sipService.onStatusChange = (status) => { |
| | | this.sipStatus = status.text; |
| | | this.sipStatusClass = `status-${status.type}`; |
| | | |
| | | // 注册成功 |
| | | if (status.type === "registered") { |
| | | this.startCallsetState(); |
| | | } |
| | | // 处理注册失败和断开连接情况 |
| | | if (status.type === "failed" || status.type === "disconnected") { |
| | | this.overCallsetState(); // 释放分机号 |
| | |
| | | this.randomID = res.data[0].id; |
| | | // 正确设置 sipUri |
| | | this.sipConfig.sipUri = `${this.randomNum}@192.168.10.124`; |
| | | this.startCallsetState(); |
| | | } catch (error) { |
| | | console.error("获取分机号失败:", error); |
| | | // this.updateStatus("failed", "获取分机号失败"); |