When you make a call using this system, you want the caller to play the call-connected music, and when the receiver answers the call, you want to play music to both the caller and receiver at the same time.
I wrote a dial plan as follows.
extensions.conf
...
...
exten => _X.,n,Set(__ORIGCHANNEL=${CHANNEL})
exten => _X.,n,Dial(SIP/${EXTEN},,m(${caller_sound_file})G(default,_X.,100))
exten => _X.,n,Hangup()
exten => _X.,100,Goto(_X.,200)
exten => _X.,101,Goto(_X.,300)
exten => _X.,n,Hangup()
exten => _X.,200,Playback(caller_sound_file2)
exten => _X.,n,Hangup()
exten => _X.,300,Playback(callee_sound_file)
exten => _X.,n,Bridge(${ORIGCHANNEL}) ; bridge
exten => _X.,n,Hangup()
Problem:
Three CDRs are created.
Until it becomes a bridged, it seems to be a completely different call. (If you end the call while music is playing on both sides, only one side is terminated.)
After the bridge is established, the call connection is normal and the call ends well.
What’s the reason?
If I am using the dial G option incorrectly, please let me know the correct way.
I’d like to write a scenario like the one above in a different way. Help me.
OS : Amazon Linux 2
Asterisk Version: 16
CDR module : Adaptive ODBC, MySQL
The CDR options were not modified.