There are 3 options for doing this. Actually only one option needed, but historically we have 3
1) Exactly for this purpose, option A in Dial command diallout parameters
A(x):
x - The file to play to the called party
Play an announcement to the called party, where <x> is the prompt
to be played
2) Privacy mode options.
p: This option enables screening mode. This is basically Privacy
mode without memory.
P([x]): Enable privacy mode. Use <x> as the family/key in the AstDB
database if it is provided. The current extension is used if a database
family/key is not specified.
Privacy play message based on callerid and ask name if not found
3) Macro and Gosub on answer. Just different and most flexible ways to do something with called, using that you can collect input/confirm/decline call etc.
M(macro[^arg[^...]]):
macro - Name of the macro that should be executed.
arg - Macro arguments
Execute the specified <macro> for the *called* channel before
connecting to the calling channel. Arguments can be specified to the Macro
using '^' as a delimiter. The macro can set the variable ${MACRO_RESULT}
to specify the following actions after the macro is finished executing:
${MACRO_RESULT}: If set, this action will be taken after
the macro finished executing.
ABORT: Hangup both legs of the call
CONGESTION: Behave as if line congestion was
encountered
BUSY: Behave as if a busy signal was encountered
CONTINUE: Hangup the called party and allow the
calling party to continue dialplan execution at the next priority
GOTO:[[<context>^]<exten>^]<priority>: Transfer the
call to the specified destination.
U(x[^arg[^...]]):
x - Name of the subroutine to execute via Gosub
arg - Arguments for the Gosub routine
Execute via Gosub the routine <x> for the *called* channel before
connecting to the calling channel. Arguments can be specified to the Gosub
using '^' as a delimiter. The Gosub routine can set the variable ${GO
SUB_RESULT} to specify the following actions after the Gosub returns.
${GOSUB_RESULT}:
ABORT: Hangup both legs of the call.
CONGESTION: Behave as if line congestion was
encountered.
BUSY: Behave as if a busy signal was encountered.
CONTINUE: Hangup the called party and allow the
calling party to continue dialplan execution at the next priority.
GOTO:[[<context>^]<exten>^]<priority>: Transfer the
call to the specified destination.