Indentiting transfered call


asterisk 1.8.15

I’m having troubles identifying attended transferred calls in the dialplan.

What I want: I want to send an UserEvent when the call is being transferred, telling an external application that the call is transferred from X to Y.

Example: A calls queue Q where B is a member, B answer the call, B puts A on hold, B calls C, C answers and B transfer A to C.

Depending on how I do it, I see two different results in asterisk CLI (example is from a Snom phone):

  1. When I answer the call on C, I press the transfer button twice. The B-C channel is hung up and by that I see the dialplan executes the hangup extension on the channel.
  2. When I answer the call on C, I hang up on B. Result: In asterisk CLI I only see that it shops music on hold and no dialplan are executed.

Now, A is successfully transferred from B to C in both cases, but I have no way of executing an UserEvent telling that the call has been transferred. In case 1) I have the hangup context that are executed on B-C, but I cannot find a way to identify that this hangup is caused by a transfer from B to C. In case 2) I have, well, nothing at all to work with.

Does anyone have some experience with this, any suggestions or perhaps even a solution?

What would be great is some kind of transfer context, that are executed in these cases, and some way to know that B is transferring A to C.

I cannot use ${TRANSFER_CONTEXT} since this only applies on transfers initiated with #.

Help would be highly appreciated!

Kind regards,
Kasper - a guy who are about to go mental because of this issue :smiley:

(btw. I’m sorry if this is a re-post, I guess a lot of people are having the same question, but I could not find any thread regarding this :-/)