I trying to build a code that behaves like described below.
A calls B. When B picks up the phone, both of them listen a small message
(10 seconds). The messages have the same time, but they aren’t the same.
So, A listens to ‘message X’ and B listens to ‘message Y’. When the messages
are totally played, A and B can talk freely.
I already tried to use two of the Dial’s flags: M and G. When I use the M
flag, the call is split into 2. The G flag redirects the logical stream
to another extension. So, A belongs to ‘priority 1’ and B belongs to ‘2’.
exten => 555, 1, Dial(SIP/555,G(extensao,111,1))
exten => 111, 1, Playback(messageA)
exten => 111, 2, Playback(messageB)
Ok. This way, Asterisk can play the ‘message
X’ and ‘message Y’ to A and B, respectively. But, the channels are separated
now and it is not possible to rejoin them again. By the way, I didn’t find anything
about it. So, maybe (I hope) a method exists to do this task.
When I use the M flag, I can run a macro when B picks up the phone. This
way, it is possible to use the function Playback and play a message for B.
But in this case, A doesn’t hear any message, just the ‘ringing tone’.
When the message finishes, the conversation is established.
You will have the same result if use the A flag.
So… anyone already fought this problem?