The ${REASON} variable is set by Asterisk when it enters the special Failed extension. It seems to give the only ways of finding out why a call file call failed. It takes at least these values:
0 – Failed (not busy or congested)
1 – Hung up
3 – Ring timeout
5 – Busy
8 – Congestion