Voice playback related to the sender/receiver

I have a question about voice playback in the dialplan.

When making a call, a ringback tone is played to the calling party,
When receiving, I want to play a new ringback tone to the calling party and a voice to the called party at the same time.
I want the receiver to be the standard, so that the call connects when playback is over.

...
...
exten => _X.,n,Dial(SIP/${EXTEN},,m(${caller_sound_file})A(${callee_sound_file}))
exten => _X.,n,Hangup()

It works as follows.

  1. In the dial state, the sound source file(caller_sound_file) is played to the calling party.
  2. When receiving a call, sound source playback is stopped on the calling side and the sound source file(callee_sound_file) is played on the receiving side.

In step 2, I want to play the sound source of the sender as a new one.

Is there any way to make this scenario work?

This seems to relate to the same underlying requirement as An issue where using the G option of Dial creates multiple CDRs which basically seems to consider a solution the OP has rejected.

Is there any reason why you have already answered the A side?

Do you actually want a change in ringback tone after the B side answers?

If you have to answer, but don’t mind the ringback tone being unchanged, you can probably use a local channel to issue that actual DIal.

If you don’t have to answer, the calling phone or network will generate the tone for you.

I think the underlying issue here is going to be that auto service, which is run on the A side during the B side playbacks, doesn’t support continuation of music on hold. However, the default is not to answer the A side at that point, so, if originating phone or network is generating the ringback, that will continue. Adding a Local channel effectively means you have an originating network within the Asterisk box.

You haven’t said which version you are using and I don’t know what the effective default for the “a” option was before it was introduced, but the current specification is definitely that the A side is not answered before the announcement completes.

As mentioned above, the scenario I want is to replace the A side sound source with a new sound source when the B side responds.

When side B responds, it looks like the mo will terminate unconditionally.
So, I want to play a new sound source through playback(), but I do not know the timing of the response start of the B side, so I am having a hard time writing a scenario.

Could you explain the reason behind your want, as I don’t remember anyone ever asking for this before.

I don’t believe asterisk is capable of sourcing media to two channels with only one process thread. Which leaves you with your original solution, which I hope someone will merge back into this discussion thread.

If side B does not answer the call, only music is played on side A,
This is because if you receive a call from side B, there is something you need to notify from side A.

U and M options also play sound sources on side B after receiving a call from side B. I wonder if there is an option to take an additional action on side A when receiving a call from side B.

Are there any technically feasible options?

U and M also put side A on auto-service whilst they are running.

Possibly a language problem, but the definition of side B is that it the one receiving a call from Asterisk, so Asterisk can never receive one from it.

Same problem; you don’t receive calls from side B, by definition.

Thank you for answer. But I don’t fully understand.
One thing I’m curious about is whether there is a dial option or other application of the dial plan to implement that scenario (playing a new sound source on the A side when the B side responds).

There doesn’t seem to be such an option.

I have a question about voice playback in the dialplan.

When making a call, a ringback tone is played to the calling party,
When receiving, I want to play a new ringback tone to the calling party and a voice to the called party at the same time.
I want the receiver to be the standard, so that the call connects when playback is over.

...
...
exten => _X.,n,Dial(SIP/${EXTEN},,m(${caller_sound_file})A(${callee_sound_file}))
exten => _X.,n,Hangup()

It works as follows.

  1. In the dial state, the sound source file(caller_sound_file) is played to the calling party.
  2. When receiving a call, sound source playback is stopped on the calling side and the sound source file(callee_sound_file) is played on the receiving side.

In step 2, I want to play the sound source of the sender as a new one.

Is there any way to make this scenario work?

Effective duplicate of Voice playback related to the sender/receiver

Could we have all three threads merged?

There was no response, so I re-uploaded it in another category.

I don’t fully understand.
One thing I’m curious about is whether there is a dial option or other application of the dial plan to implement that scenario (playing a new sound source on the A side when the B side responds).

Is there no such option?

No response to such a question typically means: “I’ve never heard of one, and don’t believe there is one, but proving the negative is difficult, and I might be wrong”.

I suspect most or all of the people that regularly answer read the “all” category.

Any such feature would play the complete message to one party before starting on that to the other one.