How to dynamically detect incoming fax and incoming calls?

Hello everyone,

My server is running Asterisk 1.8.15.0 and also has Digium’s Fax for Asterisk module installed. I was able to get incoming faxes working. Now I want to configure Asterisk to be able to detect and receive incoming faxes and incoming calls simultaneously for the same phone number. These are the commands I have in the dialplan but they are not working:

exten => _XXXXXXXXX,1,Answer()
exten => _XXXXXXXXX,n,Playtones(ring)
exten => _XXXXXXXXX,n,Wait(5)
exten => _XXXXXXXXX,n(fax),NoOp(***** FAX DETECTED *****)
exten => _XXXXXXXXX,n(fax),Goto(fax-rx,receive,1)
exten => _XXXXXXXXX,n,Goto(default,${EXTEN:6},1)

With the above commands every incoming calls is sent to the fax-receive context. I want the incoming call to be redirected to a specific context whether it’s an incoming fax or incoming phone call.

Any help is appreciated! Thanks in advance!

I haven’t used fax myself, but fax is an extension, not a priority. You can’t have two priorities with the same name under the same extension. ,Goto(fax-rx,receive,1) is reached on all valid paths. Goto(default,${EXTEN:6},1) is unreachable, because there is nothing that will get past the preceding line.