Re: [asterisk-users] digium fax: failed to queue document

2009-09-29 Thread sean darcy
On Tue, Sep 29, 2009 at 2:48 PM, David Backeberg  wrote:
> On Mon, Sep 28, 2009 at 10:08 PM, sean darcy  wrote:
>> On Mon, Sep 28, 2009 at 1:09 PM, David Backeberg  
>> wrote:
>>> Have you tried using ps2tiff?
>> I looked up ps2tiff. That seems to be a windows program. There is a
>> pstotiff linux program, but it seems to be unmaintained, and isn't
>> available on Fedora.
>
> My bad. I was thinking that because libtiff provides a tiff2ps they
> would also provide a ps2tiff. I was mistaken. I use tiff2pdf as part
> of my inbound fax receipt setup to make things play nice with the
> Windows desktops.
>
> ___
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> AstriCon 2009 - October 13 - 15 Phoenix, Arizona
> Register Now: http://www.astricon.net
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>

Actually tiff2ps could work. Use convert from imagemagick to get to
tiff, tiff2ps, and then gs to g3 fax. . test2ps is also old and
unmaintained. :-(

sean

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] digium fax: failed to queue document

2009-09-29 Thread David Backeberg
On Mon, Sep 28, 2009 at 10:08 PM, sean darcy  wrote:
> On Mon, Sep 28, 2009 at 1:09 PM, David Backeberg  wrote:
>> Have you tried using ps2tiff?
> I looked up ps2tiff. That seems to be a windows program. There is a
> pstotiff linux program, but it seems to be unmaintained, and isn't
> available on Fedora.

My bad. I was thinking that because libtiff provides a tiff2ps they
would also provide a ps2tiff. I was mistaken. I use tiff2pdf as part
of my inbound fax receipt setup to make things play nice with the
Windows desktops.

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] digium fax: failed to queue document

2009-09-28 Thread sean darcy
On Mon, Sep 28, 2009 at 1:09 PM, David Backeberg  wrote:
> On Mon, Sep 28, 2009 at 12:30 PM, sean darcy  wrote:
>> Well one of the problems it that SendFax doesn't like the tiff file(BTW,
>> SendFax from app_fax.so gives you clue what the problem is). It requires
>> a special sort of tiff file. I never found any way to generate a
>> compliant file with imagemagick or netpbm from a simple text file.
>
> Have you tried using ps2tiff?
>
> The way I generated my 'compliant' tiff was quite straightforward:
> I used ReceiveFax() on a fax from a 'real' fax machine, and then used
> that tiff file for testing.
>

Well that certainly works :-) . But I'm trying to put together a
status report on a fax transmission  that I can fax to another
machine. So I need to create the tiff.

I looked up ps2tiff. That seems to be a windows program. There is a
pstotiff linux program, but it seems to be unmaintained, and isn't
available on Fedora.

sean

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] digium fax: failed to queue document

2009-09-28 Thread David Backeberg
On Mon, Sep 28, 2009 at 12:30 PM, sean darcy  wrote:
> Well one of the problems it that SendFax doesn't like the tiff file(BTW,
> SendFax from app_fax.so gives you clue what the problem is). It requires
> a special sort of tiff file. I never found any way to generate a
> compliant file with imagemagick or netpbm from a simple text file.

Have you tried using ps2tiff?

The way I generated my 'compliant' tiff was quite straightforward:
I used ReceiveFax() on a fax from a 'real' fax machine, and then used
that tiff file for testing.

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] digium fax: failed to queue document

2009-09-28 Thread sean darcy
sean darcy wrote:
> Martin wrote:
>> u don't change the ${uniquefile} for the second System/Originate
>>
>> try to add a string to the ${uniquefile} ...
>>
>> eg
>>
>> ${uniquefile}0
>>
>> Martin
> But I generate another unique file in [fax-tx] just before I try to send 
> the confirm.
> 
> Here's the first call:
> 
>  -- Executing [s...@outbound-fax:2] System("Console/dsp", "env echo 
> -e "Channel:DAHDI/g0/abbbccc\\nContext:fax-tx\\nExtension: 
> s\\nPriority: 1\\n" >/var/spool/asterisk/outgoing/call-1254021344.0") in 
> new stack
> 
> Here's the second:
> 
>  -- Executing [...@fax-tx:9] System("DAHDI/1-1", "env echo -e 
> "Channel:DAHDI/g0/abbbccc\\nContext:fax-confirm-tx\\nExtension: 
> s\\nPriority: 1\\n" >/var/spool/asterisk/outgoing/call-1254021349.10") 
> in new stack
> 
> As you can see, I also tried adding the 0 string :)
> 
> Also here's tiffinfo for the file that's not queued:
> 
> [Sep 26 23:16:38] ERROR[18841]: res_fax_digium.c:1761 dgm_fax_start: fax 
> handle: 0 failed to queue document 
> '/var/spool/asterisk/fax-tx-status-20090926_2316.tif'
> 
> tiffinfo /var/spool/asterisk/fax-tx-status-20090926_2316.tif
> TIFF Directory at offset 0x822 (2082)
>Image Width: 600 Image Length: 200
>Bits/Sample: 1
>Compression Scheme: CCITT Group 3
>Photometric Interpretation: min-is-black
>FillOrder: msb-to-lsb
>Orientation: row 0 top, col 0 lhs
>Samples/Pixel: 1
>Rows/Strip: 109
>Planar Configuration: single image plane
>DocumentName: Standard Input
>ImageDescription: converted PNM file
> 
> sean
> 
> 
>> On Sat, Sep 26, 2009 at 8:05 PM, sean darcy  wrote:
>>> In my quest to actually send a fax, I'm now stuck trying to send the
>>> confirm.
>>>
>>> First I send the fax:
>>>
>>> -- Executing [s...@outbound-fax:2] System("Console/dsp", "env echo
>>> -e "Channel:DAHDI/g0/12036378447\\nContext:fax-tx\\nExtension:
>>> s\\nPriority: 1\\n" >/var/spool/asterisk/outgoing/call-1254012878.0") in
>>> new stack
>>> -- Auto fallthrough, channel 'Console/dsp' status is 'UNKNOWN'
>>>  << Hangup on console >>
>>> -- Attempting call on DAHDI/g0/12036378447 for s...@fax-tx:1 (Retry 1)
>>> -- Requested transfer capability: 0x00 - SPEECH
>>>> Channel DAHDI/1-1 was answered.
>>> -- Executing [...@fax-tx:1] SendFAX("DAHDI/1-1",
>>> "/var/spool/asterisk/fax/20090922_1301.tif") in new stack
>>> -- Channel 'DAHDI/1-1' sending fax
>>> '/var/spool/asterisk/fax/20090922_1301.tif'
>>> -- Channel 'DAHDI/1-1' fax session '0' started
>>> .
>>>
>>> And that works.
>>>
>>> Then I try to send the confirm:
>>>
>>>'h' =>1. Set(RID=${FAXOPT(remotestationid)})
>>> [pbx_config]
>>> 2.
>>> Set(DateTime=${STRFTIME(${EPOCH},,%Y%m%d)}_${STRFTIME(${EPOCH},,%H%M)})
>>> [pbx_config]
>>> 3.
>>> Set(GLOBAL(StatusFile)=/var/spool/asterisk/fax-tx-status-${DateTime})
>>> [pbx_config]
>>> 4. System(env echo -e "${FAXOPT(pages)} Page Fax
>>> sent to ${EXTEN}. Remote ID: ${RID}" > ${StatusFile}-l1) [pbx_config]
>>> 5. System(env echo -e "Status: ${FAXOPT(status)}
>>> ${FAXOPT(statusstr)}" > ${StatusFile}-l2) [pbx_config]
>>> 6. System(convert -background white -fill black
>>> -pointsize 18 text:${StatusFile}-l1 text:${StatusFile}-l2 -crop
>>> 600x100+1+1  -append ${StatusFile}.tif) [pbx_config]
>>> 7. Set(GLOBAL(StatusFile)=${StatusFile})
>>> [pbx_config]
>>> 8.
>>> Set(UniqueFile=/var/spool/asterisk/outgoing/call-${UNIQUEID}) [pbx_config]
>>> 9. System(env echo -e
>>> "Channel:DAHDI/g0/abbbccc\\nContext:fax-confirm-tx\\nExtension:
>>> s\\nPriority: 1\\n" >${UniqueFile}) [pbx_config]
>>>
>>> But that fails:
>>>
>>> -- Executing [...@fax-tx:1] Set("DAHDI/1-1", "RID=bbb-ccc-") in
>>> new stack
>>> -- Executing [...@fax-tx:2] Set("DAHDI/1-1",
>>> "DateTime=20090926_2055") in new stack
>>> -- Executing [...@fax-tx:3] Set("DAHDI/1-1",
>>> "GLOBAL(StatusFile)=/var/spool/asterisk/fax-tx-status-20090926_2055") in
>>> new stack
>>>   == Setting global variable 'StatusFile' to
>>> '/var/spool/asterisk/fax-tx-status-20090926_2055'
>>> -- Executing [...@fax-tx:4] System("DAHDI/1-1", "env echo -e "1 Page
>>> Fax sent to h. Remote ID: bbb-ccc-" >
>>> /var/spool/asterisk/fax-tx-status-20090926_2055-l1") in new stack
>>> -- Executing [...@fax-tx:5] System("DAHDI/1-1", "env echo -e "Status:
>>> SUCCESS FAX_SUCCESS" >
>>> /var/spool/asterisk/fax-tx-status-20090926_2055-l2") in new stack
>>> -- Executing [...@fax-tx:6] System("DAHDI/1-1", "convert -background
>>> white -fill black -pointsize 18
>>> text:/var/spool/asterisk/fax-tx-status-20090926_2055-l1
>>> text:/var/spool/asterisk/fax-tx-status-20090926_2055-l2 -crop
>>> 600x100+1+1  -append
>>> /var/spool/asterisk/fax-tx-status-20090926_2055.tif") in new stack
>>> -- Executing [...@fax-tx:7] Set("DAHDI/1-1",
>>> 

Re: [asterisk-users] digium fax: failed to queue document

2009-09-27 Thread sean darcy
Martin wrote:
> u don't change the ${uniquefile} for the second System/Originate
> 
> try to add a string to the ${uniquefile} ...
> 
> eg
> 
> ${uniquefile}0
> 
> Martin
But I generate another unique file in [fax-tx] just before I try to send 
the confirm.

Here's the first call:

 -- Executing [s...@outbound-fax:2] System("Console/dsp", "env echo 
-e "Channel:DAHDI/g0/abbbccc\\nContext:fax-tx\\nExtension: 
s\\nPriority: 1\\n" >/var/spool/asterisk/outgoing/call-1254021344.0") in 
new stack

Here's the second:

 -- Executing [...@fax-tx:9] System("DAHDI/1-1", "env echo -e 
"Channel:DAHDI/g0/abbbccc\\nContext:fax-confirm-tx\\nExtension: 
s\\nPriority: 1\\n" >/var/spool/asterisk/outgoing/call-1254021349.10") 
in new stack

As you can see, I also tried adding the 0 string :)

Also here's tiffinfo for the file that's not queued:

[Sep 26 23:16:38] ERROR[18841]: res_fax_digium.c:1761 dgm_fax_start: fax 
handle: 0 failed to queue document 
'/var/spool/asterisk/fax-tx-status-20090926_2316.tif'

tiffinfo /var/spool/asterisk/fax-tx-status-20090926_2316.tif
TIFF Directory at offset 0x822 (2082)
   Image Width: 600 Image Length: 200
   Bits/Sample: 1
   Compression Scheme: CCITT Group 3
   Photometric Interpretation: min-is-black
   FillOrder: msb-to-lsb
   Orientation: row 0 top, col 0 lhs
   Samples/Pixel: 1
   Rows/Strip: 109
   Planar Configuration: single image plane
   DocumentName: Standard Input
   ImageDescription: converted PNM file

sean


> 
> On Sat, Sep 26, 2009 at 8:05 PM, sean darcy  wrote:
>> In my quest to actually send a fax, I'm now stuck trying to send the
>> confirm.
>>
>> First I send the fax:
>>
>> -- Executing [s...@outbound-fax:2] System("Console/dsp", "env echo
>> -e "Channel:DAHDI/g0/12036378447\\nContext:fax-tx\\nExtension:
>> s\\nPriority: 1\\n" >/var/spool/asterisk/outgoing/call-1254012878.0") in
>> new stack
>> -- Auto fallthrough, channel 'Console/dsp' status is 'UNKNOWN'
>>  << Hangup on console >>
>> -- Attempting call on DAHDI/g0/12036378447 for s...@fax-tx:1 (Retry 1)
>> -- Requested transfer capability: 0x00 - SPEECH
>>> Channel DAHDI/1-1 was answered.
>> -- Executing [...@fax-tx:1] SendFAX("DAHDI/1-1",
>> "/var/spool/asterisk/fax/20090922_1301.tif") in new stack
>> -- Channel 'DAHDI/1-1' sending fax
>> '/var/spool/asterisk/fax/20090922_1301.tif'
>> -- Channel 'DAHDI/1-1' fax session '0' started
>> .
>>
>> And that works.
>>
>> Then I try to send the confirm:
>>
>>'h' =>1. Set(RID=${FAXOPT(remotestationid)})
>> [pbx_config]
>> 2.
>> Set(DateTime=${STRFTIME(${EPOCH},,%Y%m%d)}_${STRFTIME(${EPOCH},,%H%M)})
>> [pbx_config]
>> 3.
>> Set(GLOBAL(StatusFile)=/var/spool/asterisk/fax-tx-status-${DateTime})
>> [pbx_config]
>> 4. System(env echo -e "${FAXOPT(pages)} Page Fax
>> sent to ${EXTEN}. Remote ID: ${RID}" > ${StatusFile}-l1) [pbx_config]
>> 5. System(env echo -e "Status: ${FAXOPT(status)}
>> ${FAXOPT(statusstr)}" > ${StatusFile}-l2) [pbx_config]
>> 6. System(convert -background white -fill black
>> -pointsize 18 text:${StatusFile}-l1 text:${StatusFile}-l2 -crop
>> 600x100+1+1  -append ${StatusFile}.tif) [pbx_config]
>> 7. Set(GLOBAL(StatusFile)=${StatusFile})
>> [pbx_config]
>> 8.
>> Set(UniqueFile=/var/spool/asterisk/outgoing/call-${UNIQUEID}) [pbx_config]
>> 9. System(env echo -e
>> "Channel:DAHDI/g0/abbbccc\\nContext:fax-confirm-tx\\nExtension:
>> s\\nPriority: 1\\n" >${UniqueFile}) [pbx_config]
>>
>> But that fails:
>>
>> -- Executing [...@fax-tx:1] Set("DAHDI/1-1", "RID=bbb-ccc-") in
>> new stack
>> -- Executing [...@fax-tx:2] Set("DAHDI/1-1",
>> "DateTime=20090926_2055") in new stack
>> -- Executing [...@fax-tx:3] Set("DAHDI/1-1",
>> "GLOBAL(StatusFile)=/var/spool/asterisk/fax-tx-status-20090926_2055") in
>> new stack
>>   == Setting global variable 'StatusFile' to
>> '/var/spool/asterisk/fax-tx-status-20090926_2055'
>> -- Executing [...@fax-tx:4] System("DAHDI/1-1", "env echo -e "1 Page
>> Fax sent to h. Remote ID: bbb-ccc-" >
>> /var/spool/asterisk/fax-tx-status-20090926_2055-l1") in new stack
>> -- Executing [...@fax-tx:5] System("DAHDI/1-1", "env echo -e "Status:
>> SUCCESS FAX_SUCCESS" >
>> /var/spool/asterisk/fax-tx-status-20090926_2055-l2") in new stack
>> -- Executing [...@fax-tx:6] System("DAHDI/1-1", "convert -background
>> white -fill black -pointsize 18
>> text:/var/spool/asterisk/fax-tx-status-20090926_2055-l1
>> text:/var/spool/asterisk/fax-tx-status-20090926_2055-l2 -crop
>> 600x100+1+1  -append
>> /var/spool/asterisk/fax-tx-status-20090926_2055.tif") in new stack
>> -- Executing [...@fax-tx:7] Set("DAHDI/1-1",
>> "GLOBAL(StatusFile)=/var/spool/asterisk/fax-tx-status-20090926_2055") in
>> new stack
>>   == Setting global variable 'StatusFile' to
>> '/var/spool/asterisk/fax-tx-status-20090926

Re: [asterisk-users] digium fax: failed to queue document

2009-09-26 Thread Martin
u don't change the ${uniquefile} for the second System/Originate

try to add a string to the ${uniquefile} ...

eg

${uniquefile}0

Martin

On Sat, Sep 26, 2009 at 8:05 PM, sean darcy  wrote:
> In my quest to actually send a fax, I'm now stuck trying to send the
> confirm.
>
> First I send the fax:
>
>     -- Executing [s...@outbound-fax:2] System("Console/dsp", "env echo
> -e "Channel:DAHDI/g0/12036378447\\nContext:fax-tx\\nExtension:
> s\\nPriority: 1\\n" >/var/spool/asterisk/outgoing/call-1254012878.0") in
> new stack
>     -- Auto fallthrough, channel 'Console/dsp' status is 'UNKNOWN'
>  << Hangup on console >>
>     -- Attempting call on DAHDI/g0/12036378447 for s...@fax-tx:1 (Retry 1)
>     -- Requested transfer capability: 0x00 - SPEECH
>        > Channel DAHDI/1-1 was answered.
>     -- Executing [...@fax-tx:1] SendFAX("DAHDI/1-1",
> "/var/spool/asterisk/fax/20090922_1301.tif") in new stack
>     -- Channel 'DAHDI/1-1' sending fax
> '/var/spool/asterisk/fax/20090922_1301.tif'
>     -- Channel 'DAHDI/1-1' fax session '0' started
> .
>
> And that works.
>
> Then I try to send the confirm:
>
>    'h' =>            1. Set(RID=${FAXOPT(remotestationid)})
> [pbx_config]
>                     2.
> Set(DateTime=${STRFTIME(${EPOCH},,%Y%m%d)}_${STRFTIME(${EPOCH},,%H%M)})
> [pbx_config]
>                     3.
> Set(GLOBAL(StatusFile)=/var/spool/asterisk/fax-tx-status-${DateTime})
> [pbx_config]
>                     4. System(env echo -e "${FAXOPT(pages)} Page Fax
> sent to ${EXTEN}. Remote ID: ${RID}" > ${StatusFile}-l1) [pbx_config]
>                     5. System(env echo -e "Status: ${FAXOPT(status)}
> ${FAXOPT(statusstr)}" > ${StatusFile}-l2) [pbx_config]
>                     6. System(convert -background white -fill black
> -pointsize 18 text:${StatusFile}-l1 text:${StatusFile}-l2 -crop
> 600x100+1+1  -append ${StatusFile}.tif) [pbx_config]
>                     7. Set(GLOBAL(StatusFile)=${StatusFile})
> [pbx_config]
>                     8.
> Set(UniqueFile=/var/spool/asterisk/outgoing/call-${UNIQUEID}) [pbx_config]
>                     9. System(env echo -e
> "Channel:DAHDI/g0/abbbccc\\nContext:fax-confirm-tx\\nExtension:
> s\\nPriority: 1\\n" >${UniqueFile}) [pbx_config]
>
> But that fails:
>
>     -- Executing [...@fax-tx:1] Set("DAHDI/1-1", "RID=bbb-ccc-") in
> new stack
>     -- Executing [...@fax-tx:2] Set("DAHDI/1-1",
> "DateTime=20090926_2055") in new stack
>     -- Executing [...@fax-tx:3] Set("DAHDI/1-1",
> "GLOBAL(StatusFile)=/var/spool/asterisk/fax-tx-status-20090926_2055") in
> new stack
>   == Setting global variable 'StatusFile' to
> '/var/spool/asterisk/fax-tx-status-20090926_2055'
>     -- Executing [...@fax-tx:4] System("DAHDI/1-1", "env echo -e "1 Page
> Fax sent to h. Remote ID: bbb-ccc-" >
> /var/spool/asterisk/fax-tx-status-20090926_2055-l1") in new stack
>     -- Executing [...@fax-tx:5] System("DAHDI/1-1", "env echo -e "Status:
> SUCCESS FAX_SUCCESS" >
> /var/spool/asterisk/fax-tx-status-20090926_2055-l2") in new stack
>     -- Executing [...@fax-tx:6] System("DAHDI/1-1", "convert -background
> white -fill black -pointsize 18
> text:/var/spool/asterisk/fax-tx-status-20090926_2055-l1
> text:/var/spool/asterisk/fax-tx-status-20090926_2055-l2 -crop
> 600x100+1+1  -append
> /var/spool/asterisk/fax-tx-status-20090926_2055.tif") in new stack
>     -- Executing [...@fax-tx:7] Set("DAHDI/1-1",
> "GLOBAL(StatusFile)=/var/spool/asterisk/fax-tx-status-20090926_2055") in
> new stack
>   == Setting global variable 'StatusFile' to
> '/var/spool/asterisk/fax-tx-status-20090926_2055'
>     -- Executing [...@fax-tx:8] Set("DAHDI/1-1",
> "UniqueFile=/var/spool/asterisk/outgoing/call-1254012879.1") in new stack
>     -- Executing [...@fax-tx:9] System("DAHDI/1-1", "env echo -e
> "Channel:DAHDI/g0/abbbccc\\nContext:fax-confirm-tx\\nExtension:
> s\\nPriority: 1\\n" >/var/spool/asterisk/outgoing/call-1254012879.1") in
> new stack
>     -- Attempting call on DAHDI/g0/abbbccc for s...@fax-confirm-tx:1
> (Retry 1)
>     -- Requested transfer capability: 0x00 - SPEECH
>     -- Hungup 'DAHDI/1-1'
> [Sep 26 20:55:17] NOTICE[14894]: pbx_spool.c:357 attempt_thread: Call
> completed to DAHDI/g0/abbbccc
>        > Channel DAHDI/2-1 was answered.
>     -- Executing [...@fax-confirm-tx:1] SendFAX("DAHDI/2-1",
> "/var/spool/asterisk/fax-tx-status-20090926_2055.tif") in new stack
>     -- Channel 'DAHDI/2-1' sending fax
> '/var/spool/asterisk/fax-tx-status-20090926_2055.tif'
> [Sep 26 20:55:26] ERROR[14912]: res_fax_digium.c:1761 dgm_fax_start: fax
> handle: 0 failed to queue document
> '/var/spool/asterisk/fax-tx-status-20090926_2055.tif'
> [Sep 26 20:55:26] ERROR[14912]: res_fax.c:811 generic_fax_exec: channel
> 'DAHDI/2-1' fax session '1' failure, reason: 'failed to start fax session'
>
> The file does exist:
>
> file /var/spool/asterisk/fax-tx-status-20090926_2055.tif
> /var/spool/asterisk/fax-tx-status-20090926_2055.tif: TIFF image data,
> little-endian
>  ls -l /var/spool/