WXL (wul)
21 小时以前 6e413d95d035e6d798f62fde7964287e1d2fa416
src/utils/sipService-cs.js
@@ -12,6 +12,7 @@
  init(config) {
    try {
      this.updateStatus("connecting", "连接中...");
console.log(config);
      this.ua = new JsSIP.UA({
        sockets: [new JsSIP.WebSocketInterface(config.wsUrl)],
@@ -92,7 +93,7 @@
      sessionTimersExpires: 300,
      extraHeaders: [
        "Min-SE: 120",
        "Route: <sip:@192.168.100.6>",
        "Route: <sip:@192.168.10.124>",
        "Accept: application/sdp",
        "Supported: replaces, timer",
        "Allow: INVITE, ACK, BYE, CANCEL, OPTIONS",
@@ -139,7 +140,7 @@
    };
    this.currentSession = this.ua.call(
      `sip:${targetNumber}@192.168.100.6`,
      `sip:${targetNumber}@192.168.10.124`,
      options
    );
    // 在会话创建后修改 SDP
@@ -150,7 +151,7 @@
          .call(pc, offerOptions)
          .then((offer) => {
            const modifiedSdp = offer.sdp
              .replace(/c=IN IP4 192\.168\.100\.10/g, "c=IN IP4 192.168.100.6")
              .replace(/c=IN IP4 192\.168\.100\.10/g, "c=IN IP4 192.168.10.124")
              .replace(/m=audio \d+ RTP\/AVP.*/, "m=audio 7078 RTP/AVP 0 8");
            return new RTCSessionDescription({
              type: "offer",