0

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.

Ram
  • 147
  • 4
  • 16

2 Answers2

3

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

1

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.

arheops
  • 15,544
  • 1
  • 21
  • 27
  • 1
    I think I might have misguided. The usecase is that the customer will call agent A and now agent A has to transfer the call to agent B. The client side library which we are using to accept and end the calls is JSSip. – Ram Jul 28 '20 at 03:38
  • @arheops I want to send custom data, please guide me. Unable to send custom data from local to remote using JSSIP. https://jssip.net/documentation/3.7.x/api/session/#attribute_data – varundhariyal Jun 21 '21 at 11:40
  • Refer not designed to send custom data. Add custom X-header or just change number with custom data, like customer_id#dest_number@ip – arheops Jun 21 '21 at 14:01