--- app_dial_old.c 2004-12-01 09:59:40.000000000 +0100 +++ app_dial.c 2004-12-01 10:17:50.000000000 +0100 @@ -976,6 +976,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; @@ -1141,6 +1143,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;