Call URL after bling transfer

Hello,

I’m looking to run a URL when a user called transfers to another number:

  1. The user calls from outside.
  2. I use Dial to connect it to a local user
  3. When the called user picks up, I execute a URL using the “U” option in dial.
  4. The called user can optionally transfer the caller to another local extension via a blind transfer.

It is at this moment that I would like the called user to be in a specific context to execute a URL which will send the extension of the user who initiated the transfer. I tried with __GOTO_ON_BLINDXFR but everything I put in this context is not executed. I put NoOp and nothing appears in the CLI (verbose 4 + agi debug on).

thx for your help.

From the dialplan it can be done, but one way could be also use AMI BLIND_TRANSFER listening to that event and if is trigged run the url with curl APP

Thank you for your reply.

The problem with AMI is that it can only be executed via the current script (I use PHPAGI) and that when the transfer is done, my script ends.

  • 1 Instruction 1
  • 2 Dial ()
  • 3 Instruction never executed if blind transfer.

As a reminder, the above script is always executed by the caller and only the recipient has the right to transfer.

So if I want to use AMI I have to run a permanent execution script and I don’t like this idea. Because we cannot monitor that it is always active or launched several times …

I tried with GOTO_ON_BLINDXFR but it only works for the person who transfers the caller. This allows me to execute a URL to warn my web server that the called party has hung up due to transfer, but I cannot know to whom the caller was transferred. also cannot follow the progress of the call after the transfer because I have no context on the caller side, nor on the new recipient side transferred. I am in the most total blur. Dial continues to run but on both sides I no longer have any context or execute code.

I really have trouble understanding the logic of blindxfer under asterisk. Let the transferor leave their context OK but I don’t understand why the Dial initiated by the caller stops. The caller has been transferred, it is still online so its context should be maintained and the execution of the instructions after Dial should continue. But this is not the case.

I tried to use AMI but it doesn’t work:

In the context of the caller: This one ends as soon as the transfer is made and the event is therefore not triggered (well, not triggered since my AGI script ends)

In the context of the transferor: It also does not work because the transfer has already taken place.

The problem always remains the same: the abnormal behavior of Asterisk which terminates the context of the caller while it is still in communication, that its channel is open. I don’t understand why, it’s so stupid. It does not mean anything.

Issue with AMI is that you will need to keep the script running on the background, I dont know how you did it, becuase it looks you re using AGI to execute the AMI script and this wont work,

due that

(well, not triggered since my AGI script ends)

I use PHPAGI, which understands AMI to subscribe to asterisk events and then retransmit them to a PHP function of the current script.

An independent script is not a possible solution, because in case of thread stop transfers will no longer be processed. And there is no way to know if it stops with certainty and not to restart it several times … For me it is not a “clean” solution at all.

I tried your second solution with the feature codes but I am also blocked. Because I have to transmit data to the application during the call (the extension number to transfer) and this does not seem possible.

Today there does not seem to be any possibility under asterisk.