> For a complete documentation index, fetch https://docs.voximplant.ai/llms.txt

# Call transfers

Blind transfers let a callee transfer a call to another person by pressing a special button and entering another person's number (usually an extension number). It is called this way because the person who transfers the call does not talk with the person to whom he transfers it.

A lot of traditional telephony services rely on this SIP phones-/SIP trunks-designed functionality. [Earlier](https://voximplant.com/blog/blind-transfer-support-for-sip-phones), a blind transfer requested by a third-party SIP started a call in a new session and the third call leg (transfer target) always saw the transferor as caller ID.

Now, one can use the [handleBlindTransfer(bool)](https://voximplant.com/docs/references/voxengine/call#handleblindtransfer) mode to control the third call leg within an existing session, which makes such communications more flexible. You can change the caller ID to be shown to the transfer target by setting [displayName](https://voximplant.com/docs/references/voxengine/call#displayname), for example. Also, you can pass custom headers to the transfer target.

When **handleBlindTransfer** is enabled, the [CallEvents.BlindTransferRequested](https://voximplant.com/docs/references/voxengine/callevents#blindtransferrequested) event is triggered to request for the transfer target within an existing session and to notify the transferor of the result.

Here are the two methods we can use to notify the transferor of the result:

* [notifyBlindTransferSuccess(void)](https://voximplant.com/docs/references/voxengine/call#notifyblindtransfersuccess)
* [notifyBlindTransferFailed(code, reason)](https://voximplant.com/docs/references/voxengine/call#notifyblindtransferfailed)

The event has the following parameters:

* **call** – the active call
* **transferTo** – username/phone number of the transfer target
* **headers** – optional SIP headers received with the message
* **name** – the name of the event

Pay attention to the **transferTo** parameter which we use to transfer the call.

```javascript title="Code sample"
VoxEngine.addEventListener(AppEvents.CallAlerting, (inc) => {
  setTimeout(() => VoxEngine.terminate(), 100000);
  const outCall = VoxEngine.callUser({
    username: inc.destination,
    callerid: inc.callerid,
    displayName: inc.displayName
  });
  outCall.addEventListener(CallEvents.Connected, (out) => {
    inc.call.answer(undefined, { scheme: out.scheme });
    VoxEngine.sendMediaBetween(inc.call, out.call);
    out.call.handleBlindTransfer(true);
    out.call.addEventListener(CallEvents.BlindTransferRequested, (out) => {
      const outCall2 = VoxEngine.callUser({
        username: out.transferTo,
        callerid: inc.callerid,
        displayName: inc.displayName
      });
      outCall2.addEventListener(CallEvents.Connected, (out2) => {
        out.call.notifyBlindTransferSuccess();
        VoxEngine.sendMediaBetween(out2.call, inc.call);
      });
      outCall2.addEventListener(CallEvents.Failed, (out2) => {
        out.call.notifyBlindTransferFailed(out2.code, out2.reason);
      });
    });
  });
});

```

If you want to use the [callSIP](https://voximplant.com/docs/references/voxengine/voxengine/callsip) method instead of [callUser](https://voximplant.com/docs/references/voxengine/voxengine/calluser) when making a blind transfer, you need to get the transfer target from the [headers](https://voximplant.com/docs/references/voxengine/callsipparameters#headers) parameter (line 9):

```javascript title="Modified code sample"
VoxEngine.addEventListener(AppEvents.CallAlerting, (inc) => {
  setTimeout(() => VoxEngine.terminate(), 100000);
  const outCall = VoxEngine.callUser(
    inc.destination,
    inc.callerid,
    inc.displayName,
    null,
    false,
    inc.scheme
  );
  outCall.addEventListener(CallEvents.Connected, (out) => {
    inc.call.answer(null, out.scheme);
    VoxEngine.sendMediaBetween(inc.call, out.call);
    out.call.handleBlindTransfer(true);
    out.call.addEventListener(CallEvents.BlindTransferRequested, (out) => {
      const outCall2 = VoxEngine.callSIP(out.headers['Refer-To'], {
        displayName: out.headers['Referred-By'],
        callerid: out.headers['Referred-By']
      });
      outCall2.addEventListener(CallEvents.Connected, (out2) => {
        out.call.notifyBlindTransferSuccess();
        VoxEngine.sendMediaBetween(out2.call, inc.call);
      });
      outCall2.addEventListener(CallEvents.Failed, (out2) => {
        out.call.notifyBlindTransferFailed(out2.code, out2.reason);
      });
    });
  });
});

```

If **handleBlindTransfer** is set to **false**, the old logic is used. We receive the info about our transfer target the same way (REFER), but there are two sessions created and here we work with [CallEvents.TransferComplete](https://voximplant.com/docs/references/websdk/voximplant/callevents#transfercomplete) and [CallEvents.TransferFailed](https://voximplant.com/docs/references/websdk/voximplant/callevents#transferfailed).