Search code examples
asterisksipvoip

Asterisk PBX play message "this call may be recorded..." at the same time extension rings


My dialplan looks something like this:

[SomeContext]
 exten => 302,1,Answer();
 same => n,Playback(/etc/ast/audio/this-call-may-be-recorded)
 same => n,Dial(SIP/user1)

The audio /etc/ast/audio/this-call-may-be-recorded.sln takes about 8 seconds to play. After those 8 seconds the phone starts ringing. My question is how can I start ringing the phone and at the same time play the audio ensuring that the audio finish playing? Agents take about 10 seconds to answer the call when busy. That means that the customer waits 8 seconds + 10 seconds = 18 seconds. Some calls are very important to us and we want to reduce the time it takes for calls to be answered. **Our goal is for the phone to start ringing right away and if the agent answers the call fast then for him to wait 8 seconds until the message 'this call may be recorded...' to finish playing.


Things I have tried:

I am getting the solutions from this link: https://www.voip-info.org/asterisk-cmd-dial/

  1. Play the audio /etc/ast/audio/this-call-may-be-recorded as a ring tone instead of the default ring. I do that with the option r([tone]). This solution does not work because if the agent answers to fast then the audio /etc/ast/audio/this-call-may-be-recorded does not finishes playing.

  2. Tried option A and that option appends audio after the call is answered. If the agent takes 10 seconds to answer then it will still take 18 seconds for the calls to be connected.

  3. Use channel originate command channel originate SIP/user1 extension 1001@WaitForUserToFinishHearingMessage. This solution I will try next but it is to complicated. I will have to have 2 separate channels. Keep track of when the channels are ready to being bridged. Moreover since I am recording the call I will have to merge the recordigs. Hopefully I do not have to take this approach.


Solution

  • There are no easy ways finish this task.

    Possible solutions

    1) Create conference call, put caller inside, start playback, create external call to agent and put same conference.

    • complexity is advanced
    • you loose queues reporting and broke cdr

    2) Attach chan_spy channel to caller in default sequence

    • complexity is above advanced
    • agent not hear message
    • need add message manualy to monitor recordings for prove you really played that to called. Chan spy channels will not go to recordings..