*snipped > > ast_set_variables(chan, vars); > insert pbx_builtin_var here --> > ast_pbx_run(chan); > > since DIALSTATUS and HANGUPCAUSE are both protected, you will probably > have to create another such as FAILEDCODE. > > i hope this helps. > oops, almost forgot. and you need to fill it with 'reason'.