JsSIP How to detect call transfer successfullly

733 Views Asked by At

A holding session with B and calling on session with C. A transfer B to C by implementing code below. How to get info of B in C, i tried listening ua.on('newMessage', cb) and adding ua.sendMessage(currentSession?.remote_identity.uri, 'dataOfB') in A but ua.on('newMessage', cb) only fired in A. How to C detect call transfered successfully or get message from A. Thanks all!

    replaces: currentSession,
    mediaConstraints: { audio: true, video: false },
     pcConfig: {
     rtcpMuxPolicy: 'negotiate',
    },
  };
  holdSession?.refer(currentSession?.remote_identity.uri, options);
  currentSession?.terminate();
  holdSession?.terminate();
1

There are 1 best solutions below

1
On

As stated in their docs:

A REFER method implicitly generates a subscription to the state of the refer. The NOTIFY requests received from the peer are processed and presented in form of events by JsSIP.RTCSession.ReferSubscriber.

The documentation on these events can be found here.

Take a look at this other answer for a working example.