[Asterisk-Users] Txfax
Roger Schreiter
roger at planinternet.de
Thu Sep 8 15:43:12 MST 2005
Il Neofita schrieb:
> Is there some way to know if the fax was received correctly or not?
Hi,
after also having asked here some days ago without an answer,
I assume, there is currently no way.
Thus, I started to study a little bit the source code.
Maybe I found a solution, which will work.
I haven't yet understood the whole souce, so I don't know,
whether my solution was silly or not or whether my solution
is reliable or not.
For me it is working great, but use with care!
Roger.
My proposal for a fax-send-success-feedback:
1. Look in txfax.c (approx line 60) for the function
static void phase_e_handler(t30_state_t *s ....
2. Add some code, which writes the number of successfully sent pages to
an channel variable:
static void phase_e_handler(t30_state_t *s, void *user_data, int result)
{
struct ast_channel *chan;
char far_ident[21];
char minibuf[11]; <<<< new line
chan = (struct ast_channel *) user_data;
if (result)
{
fax_get_far_ident(s, far_ident);
pbx_builtin_setvar_helper(chan, "REMOTESTATIONID", far_ident);
sprintf(minibuf, "%d", s->t4.pages_transferred); <<<<<< new
pbx_builtin_setvar_helper(chan, "FAX_PAGES_TRANSFERRED", minibuf);
<<<<<< new
Then you'll find the variable ${FAX_PAGES_TRANSFERRED} accessible from
the dialplan.
If you know the number of pages to be sent, you can compare and see if
complete.
More information about the asterisk-users
mailing list