Ram
Ram

Reputation: 147

Blind Transfer in JSSIP

I have been trying to make a blind transfer on a ongoing call.

Below is the code i have implemented:

transfersession(ext) {
    this.rtcSession.refer('sip:' + ext + '@' + serveraddress);
}

Can someone tell is there something more I have to write?

The above code disconnects the ongoing call and adds the call to he queue.

What mistake am I doing? Thanks in advance.

Upvotes: 0

Views: 2826

Answers (2)

Junior Mena
Junior Mena

Reputation: 57

This is my code to make a blind transfer

function makeBlindTransfer(numberToTransfer) {
  let eventHandlers = {
    requestSucceeded: function (e) {
      console.log("Transferencia realizada con exito");
    },
    requestFailed: function (e) {
      console.log("Transferencia fallo");
    },
    trying: function (e) {
      console.log("trying", e);
    },
    progress: function (e) {
      console.log("progress", e);
    },
    accepted: function (e) {
      console.log("accepted", e);
    },
    failed: function (e) {
      console.log("failed", e);
    },
  };
  try {
    ssession.refer(numberToTransfer, {
      eventHandlers,
      extraHeaders: [`Contact: <sip:${dest}@yourhost:yourport>`],
    });
  } catch (err) {
    console.log("no pudimos realizar su solicitud");
  }
}

you can check in the documentation too: https://jssip.net/documentation/2.0.x/api/refer_subscriber/ https://jssip.net/documentation/2.0.x/api/session/#method_refer

Upvotes: 3

arheops
arheops

Reputation: 15259

Other side should support refer. However, that can be insecure, so disabled by most of providers.

Anyway, you should learn how to use tcpdump/wireshark and check sip trace.

Upvotes: 1

Related Questions