--- app_dial.c 2004-11-07 22:49:43.000000000 +0100 +++ app_dial_patch.c 2004-11-16 10:51:33.000000000 +0100 @@ -944,6 +944,8 @@ peer = wait_for_answer(chan, outgoing, &to, &allowredir_in, &allowredir_out, &allowdisconnect_in, &allowdisconnect_out, &sentringing, status, sizeof(status), numbusy, numnochan, numcongestion); if (!peer) { + snprintf(toast, sizeof(toast), "%i", chan->hangupcause); + pbx_builtin_setvar_helper(chan, "HANGUPCAUSE", toast); if (to) /* Musta gotten hung up */ res = -1; @@ -1067,6 +1069,8 @@ pbx_builtin_setvar_helper(chan, "DIALEDTIME", toast); snprintf(toast, sizeof(toast), "%ld", (long)(end_time - answer_time)); pbx_builtin_setvar_helper(chan, "ANSWEREDTIME", toast); + snprintf(toast, sizeof(toast), "%i", chan->hangupcause); + pbx_builtin_setvar_helper(chan, "HANGUPCAUSE", toast); } else res = -1;