Play sound message, after call is answered

hello .

i have one sip trunk
i want to all who will answer my call , first would be played somthingADs.wav file and after this standart customer and support conversation session.
how and where i can edit or add some code ? i saw in wiki asterisk auto dial options but i cant understand.


It sounds like you want to set an “announcement” as destination of your inbound route (Inbound route > Set Destination) for the DID(s) you want to play this for.

You first need to create a recording (Admin > System Recordings) which you will later associate with the announcement.

You then create the announcement under Applications > Announcements.

You associate it with your recording and you also need to set the Destination after Playback to what is most likely an IVR…

Good luck and have a nice day!


thank’s for replay.

no not for inbound route… i want when i will call anywhere from my freepbx extension using trunk . anyone who will pick up phone/mobile.

  1. first ,will be my sound played .


Do you actually want someone to place these calls or do you want them to be automated?

If you want them to be automated you should look into call files… You can find more information on this by searching for call files here and asterisk call files on Google…

If you want someone to place those calls manually, is that recording supposed to be played back to the person who places the call or the person who answers?

Good luck and have a nice day!

Nick those calls manually ,
2.recording supposed to be played to person who answers…

There is a Dial option

re: Asterisk cmd Dial - VoIP-Info

that you can put under

Trunks > YOUR_TRUNK > Asterisk Trunk Dial Options > Override

that could apparently do that…

However, I have never used it and cannot test it at this time…

The last time I suggested to use something I could not test at this time I got … from someone here and the last thing I want to get is that when I am trying to help someone…

You are welcome to look at the web page I referred you to and see if there is anything there that could help you achieve what you want until I have time to test it…

Good luck and have a nice day!


1 Like


I finally got a chance to try it… I really wasn’t sure how much time it would take before I could do that and got lucky…

Under /var/lib/asterisk/sounds/YOUR_LANGUAGE create a custom folder.

In that folder put your recording.

Under Trunks > YOUR_TRUNK > Asterisk Trunk Dial Options > Override



What this will do is playback the recording to the callee while the caller will still hear the phone ring…

Good luck and have a nice day!


1 Like

thank you bro .you are hero :slight_smile: you saved my soul . thank you. it works…

You are welcome!


I ROTFL when I read this as one of my nickname is :innocent: (angel)…

(I did not choose it, it was given to me…)

I am glad…

By the way, when I told you to put


I assumed you had the system default values of Tt, if it wasn’t the case put what you had there plus A(custom/THE_NAME_OF_YOUR_FILE_WITHOUT_THE_EXTENSION).

Have a nice day!


haha ) thanks

hello Marbled.

i have new task… i have sip user 501 es sip trunk to other server.
so , i want that only calls from 501 has this TtA feature to play sound on provider trunk…
other extensions calls to same provider trunk .does not need playing sound. have an idea?


You can set dial options on a per extension basis but I am pretty sure this would also apply to internal calls as well which would not be a good thing…

What I would suggest you do is

  • Duplicate your trunk.
  • Revert the Asterisk Trunk Dial Options on one of those trunk copies to System
  • Duplicate the outbound route you used for that trunk.
  • On that copy set the CallerID field in the Dial Patterns to the one of the extension you want to play that message for. If you need this for many extensions than re-add all the dial patterns you had there for each extension, taking care to fill in CallerID on each one of them.
  • Assign that outbound route to the trunk which plays back the message.
  • Assign the outbound route which does not specify extensions in its dial patterns to the trunk which use the System defaults.
  • Make sure that the outbound route which specify extensions comes before the one which doesn’t (so it processes it before).

I don’t do something like this but close enough so the logic should be sound…

Good luck and have a nice day!


plus one award you :)) works…this logic

i have one more task

i have sip extension [100] as trunk to different server…
i have this sip . on sip_custom.conf.
calls from this trunk routed to telephone service provider.

i need configure. calls coming from this sip [100]
first played sound and after connect to provider trunk
i have done this config expect first stage : play sound…
what do i need ? make custom dial plan in extensions_custom.conf . ?


Just so you know you did not need to PM me, I receive the notifications when you write here…

It was just not possible for me to reply earlier…

Something is getting lost in translation because I am not really sure what you mean here…

English is not my native language (and I believe it is not yours either) and I am l a little bit unsure what you mean here…

If I was a native English speaker I might be able to figure this out but unfortunately I am not…

Is this an extension on your FreePBX box?

If 100 in an extension on your FreePBX do you want to playback a message to the person using the extension before (s)he is connected to the trunk?

How did you do that? What we did earlier was to playback a recording to the person getting called, not the caller…

Since I am not exactly sure what you want to do I cannot say for sure…

If what you want to do is to play back a recording to the person using extension 100 if, and only if, he uses a trunk (any one or a specific one?) and not if he calls another extension on the PBX then it looks like your best bet might be to use [macro-dialout-trunk-predial-hook].

Something similar to

(Please note that this thread suggests other ways of doing this…)

You would have to replace the first two lines since it sounds like you only want this to happen for a specific extension (and the “if” that’s there doesn’t do that) and of course the recording.

I saw something else which might work but since I am unsure what you want to do exactly I won’t suggest it for now…

(There are ways to have other macros run in the dial command…)

Good luck and have a nice day!



Since it is not the first time this has come up it might be a good idea to do a feature request (if one does not exist already…) to add the possibility of having a recording played when a trunk is used…

Have a nice day!


yes do not native language :slight_smile:
something like this.


A picture is worth a thousand words… :wink:

OK, so extension 100 is a remote extension connected to your FreePBX box…

From the comment you put on the picture when 100 calls 200 it plays a sound…

It plays a sound to who, extension 100 or extension 200? (or both?)

What happens when extension 100 tries to call an external number? Must the sound be played?

Please let me know…

Have a nice day!


when 100 calls to 200 . it plays a sound to 100.

when extension 100 tries to call an external number , i configured as you told earlier and plays sound…

Hi all, I need your help. We need to Play sound message on both side, after call is answered. It’s very needed for me, please help