Dialplan Detect Different Tones

Is there a way to detect different tones when calling outbound and receiving inbound calls?
I’d like to detect Fax, Busy, and Not in Service Tones etc. Is there anyways to detect this via Dialplan or AMI?

i’ve search the web and it appears to talk about older version of asterisk. I’m using Asterisk 13

I was able to find
https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Function_FAXOPT_res_fax
but it appears to explain how to receive fax instead of detecting different tones