I believe this involves modifying code in Asterisk that is very difficult. I would suggest not proceeding on this route unless you are or have access to a programmer capable of reverse engineering complex, poorly documented, real time programs, doing some very tricky processing. There will be a masquerade, which is one of the most difficult concepts in the asterisk internals, and you are also dealing with code that has to cope with tracking the state of channels of different technologies and dealing with sending external invite/replaces, in some cases.
Incidentally, your subject is confusing. For REFER/Replaces, the Dial has already been done, at a time when only the phone has any idea that this is part of an attended transfer. The operation you want to prefix with the recording is a re-bridging of the call.
David thank you. I’d like to focus on the last part you mention.
“For REFER/Replaces, the Dial has already been done, at a time when only the phone has any idea that this is part of an attended transfer. The operation you want to prefix with the recording is a re-bridging of the call.”
Can you help me visualize this call flow, and what the differences are in functionality between REFER and Refer/Replaces?
Are you saying that in my instance:
A calls B
B calls C <–This is where the sound is being played
B Refers A to C <-- No sound here b/c the dial happened in the last step
What I want is:
A calls B
B transfers A to C
Prior to being connected to C, A hears a message
A calls B
B answers
B’ sets up a completely distinct call to C; Asterisk has no idea this is related to the call from A to B; this is running the Dial() application
A tells B to connect to C and take over the call from B’ to C, which it identifies using the Replaces parameter
In your case, Asterisk is proxying for A, so this is an internal re-arrangement in Asterisk
With a a pure REFER
A calls B
B answers
B tells A to connect to C
A makes a new call to C