Fax detection in SIP/IAX

Hi
Who can i have fax detection in SIP extentions?
I have a simple code but not work.
[from-internal]
exten => 999,1,Answer()
same => n,Wait(3)
same => Dial(SIP/999,30,tr)
same => Hangup()

exten => fax,1,Goto(fax-local,s,1)

But the sip dont detect fax tone. Who can i solve this?
Thnaks.