Attended Transfer in Asterisk Without Using REFER

Hi, I want to do an attended transfer in a VoIP phone with Asterisk, but without using REFER.

I have two VoIP phones: Phone A and Phone B, and there is also a customer.

  1. Phone A calls the customer.

  2. Phone A needs to make a warm transfer to Phone B. So Phone A calls Phone B as an internal call. At this point, two calls exist:

    • Call 1: A ↔ Customer

    • Call 2: A ↔ B

  3. Normally, when Phone A presses the transfer button, the phone sends a REFER to complete the transfer.

In my case, I want something different: when Phone A is ready to transfer and presses the transfer button, Asterisk should receive a transfer request. Then:

  • If Asterisk approves the request, the transfer will be completed, and Phone A will hang up.

  • If Asterisk denies the request, nothing should happen on the phone and the existing calls should remain active.

Is this doable? If yes, how?

On Monday 25 August 2025 at 09:20:19, Akhil via Asterisk Community wrote:

  1. Normally, when Phone A presses the transfer button, the phone sends
    a REFER to complete the transfer.

In my case, I want something different: when Phone A is ready to
transfer and presses the transfer button, Asterisk should receive a
transfer request.

How do you propose to get the phone to send something different?

Please also explain in SIP terms what that something different should be.

It’s perfectly feasible to get Asterisk to do what you’re talking about -
either transfer the customer to phone B and hang up phone A, or leave things
as they are - but what command are you able to get the phone to send to tell
Asterisk to do this?

Antony.


It is also possible that putting the birds in a laboratory setting
inadvertently renders them relatively incompetent.

  • Daniel C Dennett

Thanks for your response. As I understand, REFER means the transfer is already completed, so we can’t terminate it at that point. What I want is to handle the entire transfer before it’s completed. That’s why I said I need a transfer request first. After receiving the transfer request, Asterisk should decide whether to complete it or not.

On Monday 25 August 2025 at 09:55:22, Akhil via Asterisk Community wrote:

Thanks for your response. As I understand, REFER means the transfer is
already completed

“The REFER method indicates that the recipient (identified by the Request-URI)
should contact a third party using the contact information provided in the
request.”

https://www.ietf.org/rfc/rfc3515.txt

I need a transfer request first. After receiving the transfer request,
Asterisk should decide whether to complete it or not.

As I said, getting Asterisk to do this is not difficult.

What we need to focus on is how you propose to get your telephone to send a
different SIP command when the Transfer button is pressed.

Antony.


This space intentionally has nothing but text explaining why this space has
nothing but text explaining that this space would otherwise have been left
blank, and would otherwise have been left blank.

Why would Asterisk deny the request in the given scenario?

In my case, if I get a transfer request, I can either reject it or complete the transfer from Asterisk. That’s what I meant.

There is no ability in Asterisk for attended transfers completion to allow you to deny.

I should be more specific, you can explicitly disallow all transfers. You can’t selectively do it on a call by call basis.

Thanks for response.

Can we handle the entire attended transfer when we receive a REFER from the device? For example, can we change the ‘To’ address? In a blind transfer, after receiving a REFER from the device, we can manually transfer to an extension (using Transfer if we are working with the dialplan).

No. Asterisk handles it.

On a blind transfer the transferred party is just sent to the new location in the dialplan. What you do with it in the dialplan at that point is up to you.

Okay, I understand. In a blind transfer, the ‘to’ is a new location, and we just get a label, so we can route it to any location. But in an attended transfer, the location is already fixed, so we can’t handle it from Asterisk, right?

The “location” is another channel that is already established.

:+1:

When you complete an attended transfer, the REFER has a Replaces header in the Refer-To URI. Asterisk uses that to identify one of the channels connected to the phone initiating the transfer. It could be either the initial leg, or the enquiry leg; the phone decides which. In the normal case, the destination URI is ignored, although, in more complex cases, there could be an INVITE generated, with the Replaces header.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.