Question: How to play "warning" message on certain outbound destinations?

I re-read this thread and saw lazytt’s comment ref pre-dial-hook. After a bit of searching I found the macro resides in extensions.conf and is called from macro-dialout-trunk which resides in extensions-additional.conf. I coded it like this:

; this macro intentially left blank so it may be safely overwritten for any custom
; requirements that an installation may have.
; if set to “BYPASS” then this trunk will be skipped
exten => s,1,NoOp(Trunk ${OUT_${DIAL_TRUNK}} selected)
exten => s,n,Gotoif($["${OUT_${DIAL_TRUNK}:0:7}" != “SIP/700”]?skip)
exten => s,n,NoOp(Playing Progress Announcement)
exten => s,n,Playback(pls-hold-while-try,noanswer)
exten => s,n(skip),MacroExit()

; This macro is for dev purposes and just dumps channel/app variables. Useful when designing new contexts.

The SIP trunks I want to play the message are 7000, 7001, 7002 and 7003, hence the Gotoif to stop the message being played on other trunks.

This way I was able to insert the message without using the custom trunk. I just setup a normal outbound route with the four trunks I wanted to use.

If you only wanted this to happen with certain numbers I think you could use pattern matches instead of the Gotoif. Have not got deep enough into dial plans yet to work out exactly how.