[asterisk-users] Re: Spandsp rxfax txtax fails no errors

Håkan Källberg hk at simulina.se
Wed Nov 22 02:27:16 MST 2006


On Tue, Nov 21, 2006 at 03:33:57PM -0800, daveasterisk wrote:
> Is there anyone who can help with this?
> rxfax and txfax when called in the extensions do nothing and no error 
> are generated that I can find.

I asked something similar on the list a while ago, got no answers and
took a look at the code myself and learned a little bit. Before
I used System(tiff2pdf....) to detect errors, which
wasn't so elegant, but worked well anyway.

The description looks like this:

    *CLI> show application RxFAX 
      -= Info about application 'RxFAX' =- 

    [Synopsis]
    Receive a FAX to a file

    [Description]
      RxFAX(filename[|caller][|debug]): Receives a FAX from the channel into the
    given filename. If the file exists it will be overwritten. The file
    should be in TIFF/F format.
    The "caller" option makes the application behave as a calling machine,
    rather than the answering machine. The default behaviour is to behave as
    an answering machine.
    Uses LOCALSTATIONID to identify itself to the remote end.
	 LOCALHEADERINFO to generate a header line on each page.
    Sets REMOTESTATIONID to the sender CSID.
	 FAXPAGES to the number of pages received.
	 FAXBITRATE to the transmition rate.
	 FAXRESOLUTION to the resolution.
    Returns -1 when the user hangs up.
    Returns 0 otherwise.


If you read the code, a return value of -1 means error and 0
means success, although not clearly stated so in the message
above. So far, that is what you would expect, but return values
are not testable in * dial plans, as far as I know.

I modified app_rxfax.c to set FAXSTATUS to ERROR or SUCCESS and
got it working, but then I discovered that the four return variables
listed above are set only on success. I think that FAXPAGES
would be the best to use for error checking. But still, you
will not get a reason for the failure...

There is a line in the code:

        ast_log(LOG_DEBUG, "Fax receive not successful - result (%d) %s.\n", result, t30_completion_code_to_str(result));

that shows us that written information on the type of error *is* available.
These message are in the spandsp code I suppose.

Regards:                           Håkan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 155 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20061122/c4971af9/attachment.pgp


More information about the asterisk-users mailing list