Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sip 2 sip calling with sip.js Invitation not recived #1079

Open
thanossOp opened this issue May 9, 2024 · 1 comment
Open

Sip 2 sip calling with sip.js Invitation not recived #1079

thanossOp opened this issue May 9, 2024 · 1 comment

Comments

@thanossOp
Copy link

thanossOp commented May 9, 2024

### Sender.html

`

<title>SIP Calling</title>

SIP Calling Demo

Make Call End Call

Call Accepted

Call Rejected

<script src="https://cdnjs.cloudflare.com/ajax/libs/sip.js/0.20.0/sip.min.js"></script>
<script>
  const uri = new SIP.URI(
    "sip",
    "UserA",
    "thanosdestroyer.sip.us1.twilio.com"
  );
  const sipConfig = {
    uri: uri,
    transportOptions: {
      wsServers: "ws://localhost:8080",
    },
    authorizationUser: "UserA",
    password: "password",
  };

  let userAgent;
  let currentSession;

  const socket = new WebSocket("ws://localhost:8080");

  socket.onopen = () => {
    console.log("WebSocket connected");
  };

  socket.onmessage = (event) => {
    const data = JSON.parse(event.data);
    console.log("Received message:", data);

    if (data.event === "acceptedCall") {
      document.getElementById("acceptModal").style.display = "block";
    } else if (data.event === "rejectedCall") {
      document.getElementById("rejectModal").style.display = "block";
    }
  };

  function makeCall() {
    userAgent = new SIP.UserAgent(sipConfig);
    const registerer = new SIP.Registerer(userAgent);

    const stream = navigator.mediaDevices.getUserMedia({
      audio: true,
      video: false,
    });

    userAgent.start().then(() => {
      console.log("sip user started");
      registerer.register();
      const targetURI = new SIP.URI(
        "sip",
        "UserB",
        "recieverside.sip.us1.twilio.com"
      );
      console.log("targetUrl", targetURI);

      const inviter = new SIP.Inviter(userAgent, targetURI, {
        sessionDescriptionHandlerOptions: {
          constraints: {
            stream: stream,
          },
        },
      });

      inviter.invite();
      console.log("Invite Sent Successfully");

      inviter.stateChange.addListener((newState) => {
        console.log("newstate", newState);
        switch (newState) {
          case SIP.SessionState.Establishing:
            console.log("Session is establishing...");
            break;
          case SIP.SessionState.Established:
            console.log("Session has been established!");
            break;
          case SIP.SessionState.Terminated:
            console.log("Session has terminated.");
            break;
          default:
            console.log("Default state.");
            break;
        }
      });
      socket.send(JSON.stringify({ event: "call" }));
    });
  }
</script>
`

websocket.js

`import { WebSocket, WebSocketServer } from "ws";

const wss = new WebSocketServer({ port: 8080 });

wss.on('listening', () => {
console.log('WebSocket server running on ws://localhost:8080');
});

wss.on('connection', (ws) => {
console.log('Client connected');

ws.on('message', (message) => {
try {
const data = JSON.parse(message);
console.log('Received message:', data);

      switch (data.event) {
          case 'call':
              broadcastEventExcept(ws, 'incoming_call');
              break;
          case 'accepted':
              broadcastEventExcept(ws, 'acceptedCall');
              break;
          case 'rejected':
              broadcastEventExcept(ws, 'rejectedCall');
              break;
          case 'endCall':
              broadcastEventExcept(ws, 'endCall');
              break;
          default:
              console.warn('Unknown event:', data.event);
              break;
      }
  } catch (error) {
      console.error('Error parsing message:', error);
  }

});

ws.on('close', () => {
console.log('Client disconnected');
});
});

function broadcastEventExcept(excludedClient, event) {
wss.clients.forEach((client) => {
if (client !== excludedClient && client.readyState === WebSocket.OPEN) {
client.send(JSON.stringify({ event: event }));
}
});

}`

reciver.html
`

<title>SIP Calling Receiver</title>

SIP Calling Receiver

Incoming call from UserA

Answer Call Reject Call
<script src="https://cdnjs.cloudflare.com/ajax/libs/sip.js/0.20.0/sip.min.js"></script>
<script>
  let userAgent;
  let currentSession;

  const socket = new WebSocket("ws://localhost:8080");

  socket.onopen = () => {
    console.log("WebSocket connected");
  };

  socket.onmessage = (event) => {
    const data = JSON.parse(event.data);
    console.log("Received message:", data);

    if (data.event === "incoming_call") {
      document.getElementById("callModal").style.display = "block";
    } else if (data.event === "endCall") {
      endCall();
    }
  };

  async function answerCall() {
    if (!userAgent) {
      try {
        const uri = new SIP.URI(
          "sip",
          "UserB",
          "recieverside.sip.us1.twilio.com"
        );

        const sipConfig = {
          uri: uri,
          transportOptions: {
            wsServers: "ws://localhost:8080",
          },
          authorizationUser: "UserB",
          password: "password",
          delegate: {
            onInvite,
          },
        };

        console.log("sipConfig", sipConfig);

        userAgent = new SIP.UserAgent(sipConfig);
        await userAgent.start();
        console.log("userAgent", userAgent);

        document.getElementById("callModal").style.display = "none";
        socket.send(JSON.stringify({ event: "accepted" }));
      } catch (error) {
        console.error("Error accessing user media:", error);
      }
    }
  }

  function onInvite(invitation) {
    const stream = navigator.mediaDevices.getUserMedia({
      audio: true,
      video: false,
    });
    console.log("Incoming call invitation received:", invitation);

    // Handle incoming call acceptance
    try {
      invitation.accept({
        sessionDescriptionHandlerOptions: {
          constraints: {
            stream: stream,
          },
        },
      });

      console.log("Call accepted successfully.");

      // Attach the incoming audio stream to an audio element
      const remoteAudio = document.getElementById("remoteAudio");
      remoteAudio.srcObject = invitation.remoteMediaStream;
    } catch (e) {
      console.error("Error accepting call:", e);
    }
  }

  function rejectCall() {
    // Hide the call modal after rejecting
    document.getElementById("callModal").style.display = "none";
    socket.send(JSON.stringify({ event: "rejected" }));
  }
</script>
`

### reciver console

WebSocket connected
reciver.html:27 Received message: {event: 'incoming_call'}
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | Configuration:
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · allowLegacyNotifications: false
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · authorizationHa1: ""
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · authorizationPassword: NOT SHOWN
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · authorizationUsername: ""
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · autoStart: false
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · autoStop: true
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · delegate: {}
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · contactName: ""
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · contactParams: {"transport":"ws"}
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · displayName: ""
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · forceRport: false
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · hackAllowUnregisteredOptionTags: false
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · hackIpInContact: false
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · hackViaTcp: false
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · logBuiltinEnabled: true
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · logConfiguration: true
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · logConnector: undefined
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · logLevel: "log"
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · noAnswerTimeout: 60
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · preloadedRouteSet: []
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · reconnectionAttempts: 0
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · reconnectionDelay: 4
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · sendInitialProvisionalResponse: true
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · sessionDescriptionHandlerFactory: (t,s)=>{void 0===e&&(e=it());const i={iceGatheringTimeout:void 0!==(null==s?void 0:s.iceGatheringTimeout)?null==s?void 0:s.iceGatheringTimeout:5e3,peerConnectionConfiguration:Object.assign(Object.assign({},{bundlePolicy:"balanced",certificates:void 0,iceCandidatePoolSize:0,iceServers:[{urls:"stun:stun.l.google.com:19302"}],iceTransportPolicy:"all",peerIdentity:void 0,rtcpMuxPolicy:"require"}),null==s?void 0:s.peerConnectionConfiguration)},r=t.userAgent.getLogger("sip.SessionDescriptionHandler");return new nt(r,e,i)}
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · sessionDescriptionHandlerFactoryOptions: {}
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · sipExtension100rel: "Unsupported"
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · sipExtensionReplaces: "Unsupported"
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · sipExtensionExtraSupported: []
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · sipjsId: "6doim"
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · transportConstructor: at
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · transportOptions: {"wsServers":"ws://localhost:8080"}
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · uri: sip:UserB@your.sip.server.com
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · userAgentString: "SIP.js/0.20.0"
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · viaHost: "nek2our57rpd.invalid"
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · authorizationUser: "UserB"
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · password: "password"
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Transport | The transport option "wsServers" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.
print @ sip.min.js:2
genericLog @ sip.min.js:2
genericLog @ sip.min.js:2
warn @ sip.min.js:2
at @ sip.min.js:2
ct @ sip.min.js:2
answerCall @ reciver.html:48
onclick @ reciver.html:12
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | Configuration:
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | · expires: 600
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | · extraContactHeaderParams: []
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | · extraHeaders: []
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | · logConfiguration: true
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | · instanceId: ""
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | · params: {}
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | · regId: 0
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | · registrar: sip:your.sip.server.com
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | · refreshFrequency: 99
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | Starting sip:UserB@your.sip.server.com
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | Transitioned from Stopped to Started
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Transport | Connecting ws://localhost:8080
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Transport | Transitioned from Disconnected to Connecting
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Transport | WebSocket opened ws://localhost:8080
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Transport | Transitioned from Connecting to Connected
reciver.html:54 UserAgent started successfully
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | Waiting toggled to true
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Transport | Sending WebSocket message:

REGISTER sip:your.sip.server.com SIP/2.0
Via: SIP/2.0/WS nek2our57rpd.invalid;branch=z9hG4bK99063
To: sip:UserB@your.sip.server.com
From: sip:UserB@your.sip.server.com;tag=idsudie5cr
CSeq: 2 REGISTER
Call-ID: 6doimviiaj9nlv5aihhu
Max-Forwards: 70
Contact: sip:au00a4ge@nek2our57rpd.invalid;transport=ws;expires=600
Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER
Supported: outbound, path, gruu
User-Agent: SIP.js/0.20.0
Content-Length: 0

WebSocket connected
reciver.html:27 Received message: {event: 'incoming_call'}
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | Configuration:
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · allowLegacyNotifications: false
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · authorizationHa1: ""
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · authorizationPassword: NOT SHOWN
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · authorizationUsername: ""
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · autoStart: false
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · autoStop: true
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · delegate: {}
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · contactName: ""
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · contactParams: {"transport":"ws"}
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · displayName: ""
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · forceRport: false
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · hackAllowUnregisteredOptionTags: false
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · hackIpInContact: false
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · hackViaTcp: false
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · logBuiltinEnabled: true
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · logConfiguration: true
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · logConnector: undefined
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · logLevel: "log"
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · noAnswerTimeout: 60
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · preloadedRouteSet: []
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · reconnectionAttempts: 0
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · reconnectionDelay: 4
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · sendInitialProvisionalResponse: true
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · sessionDescriptionHandlerFactory: (t,s)=>{void 0===e&&(e=it());const i={iceGatheringTimeout:void 0!==(null==s?void 0:s.iceGatheringTimeout)?null==s?void 0:s.iceGatheringTimeout:5e3,peerConnectionConfiguration:Object.assign(Object.assign({},{bundlePolicy:"balanced",certificates:void 0,iceCandidatePoolSize:0,iceServers:[{urls:"stun:stun.l.google.com:19302"}],iceTransportPolicy:"all",peerIdentity:void 0,rtcpMuxPolicy:"require"}),null==s?void 0:s.peerConnectionConfiguration)},r=t.userAgent.getLogger("sip.SessionDescriptionHandler");return new nt(r,e,i)}
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · sessionDescriptionHandlerFactoryOptions: {}
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · sipExtension100rel: "Unsupported"
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · sipExtensionReplaces: "Unsupported"
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · sipExtensionExtraSupported: []
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · sipjsId: "6doim"
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · transportConstructor: at
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · transportOptions: {"wsServers":"ws://localhost:8080"}
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · uri: sip:UserB@your.sip.server.com
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · userAgentString: "SIP.js/0.20.0"
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · viaHost: "nek2our57rpd.invalid"
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · authorizationUser: "UserB"
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | · password: "password"
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Transport | The transport option "wsServers" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.
print @ sip.min.js:2
genericLog @ sip.min.js:2
genericLog @ sip.min.js:2
warn @ sip.min.js:2
at @ sip.min.js:2
ct @ sip.min.js:2
answerCall @ reciver.html:48
onclick @ reciver.html:12
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | Configuration:
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | · expires: 600
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | · extraContactHeaderParams: []
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | · extraHeaders: []
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | · logConfiguration: true
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | · instanceId: ""
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | · params: {}
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | · regId: 0
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | · registrar: sip:your.sip.server.com
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | · refreshFrequency: 99
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | Starting sip:UserB@your.sip.server.com
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.UserAgent | Transitioned from Stopped to Started
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Transport | Connecting ws://localhost:8080
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Transport | Transitioned from Disconnected to Connecting
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Transport | WebSocket opened ws://localhost:8080
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Transport | Transitioned from Connecting to Connected
reciver.html:54 UserAgent started successfully
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Registerer | Waiting toggled to true
sip.min.js:2 Thu May 09 2024 12:18:10 GMT+0530 (India Standard Time) | sip.Transport | Sending WebSocket message:

REGISTER sip:your.sip.server.com SIP/2.0
Via: SIP/2.0/WS nek2our57rpd.invalid;branch=z9hG4bK99063
To: sip:UserB@your.sip.server.com
From: sip:UserB@your.sip.server.com;tag=idsudie5cr
CSeq: 2 REGISTER
Call-ID: 6doimviiaj9nlv5aihhu
Max-Forwards: 70
Contact: sip:au00a4ge@nek2our57rpd.invalid;transport=ws;expires=600
Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER
Supported: outbound, path, gruu
User-Agent: SIP.js/0.20.0
Content-Length: 0

when i send invitation to reciver its not reciving any invitation like in onInvite function i add some console but its not console in reciver side also i dont access my mic as its not going to onInvite function

@thanossOp
Copy link
Author

The issue is solved i need to send whole sip message to reciver so it solved
but amy one have ay idea abut after establish connection how can we run python script like after establish connection if i have speak function and in tha function i speak what is your name then reciver side speak that text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant