Rate this page:

How to handle blind transfers

Terms you need to know before reading this article
  • transferor - the person who transfers the call;
  • transferee - the person who is being transferred;
  • transfer target - the person to whom the call is transferred.

Blind transfer lets a callee transfer a call to another person by pressing a special button and entering another person's number (usually extension number). It's called this way because the person who transfers the call won't 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, 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) 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, for example. And also, you can pass custom headers to the transfer target.

When handleBlindTransfer is enabled, the CallEvents.BlindTransferRequested event will be 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.

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

And we need to pay attention to the transferTo parameter which we will use to transfer the call.

Code sample

Code sample

If you want to use the callSIP method instead of callUser when making a blind transfer, you'll need to get the transfer target from the headers parameter (line 9):

Modified code sample

Modified code sample

If handleBlindTransfer 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 and CallEvents.TransferFailed.