Send fax when asterisk is callee

Hello,
I have a simple ivr, In one submenu (such as 9), i want to send a fax.
so anybody call with server and then press 9 dtmf . should send a fax.
How can asterisk send fax for current channel? I use SendFax()
function in dialplan but when the application is run, the Asterisk CLI
closed and dont send fax.
I could send fax if asterisk works as caller legs but dont send fax if
asterisk was callee.How can i solve this problems?
With Regards.Mojtaba

I solved the problems.
In first i set parkinglot then sendfax to that extensions, then call park .like this:
exten => s,n,Set(FAXFILE=)
exten = s,n,Set(POS=720)
exten = s,n,Set(PARKINGEXTEN=${POS})
exten = s,n,System(sendfax -n -l -B 14400 -s a4 -t 1 -d
${PARKINGEXTEN} ${FAXFILE})
exten = s,n,Park(60000,s)
with regards.Mojtaba