RE: [Asterisk-Users] RxFax/spandsp: file-naming of received faxes

2004-03-30 Thread Sam Bingner
* listens for fax tones as soon as you Answer() the line.  If you Answer
the line before ringing the local lines, it will actually detect fax tones
while in the Dial statement.

Sam

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Scott Laird
Sent: Sunday, March 28, 2004 5:52 PM
To: Martin List-Petersen
Cc: [EMAIL PROTECTED]
Subject: Re: [Asterisk-Users] RxFax/spandsp: file-naming of received faxes



On Mar 28, 2004, at 7:40 PM, Martin List-Petersen wrote:

 ; I'm using a shared analog line for testing this, so I'm using the
 fax
 ; autodetection code to yank faxes out of my IVR and into the 'fax'
 ; pseudo-extension
 [outside]
...
exten = fax,1,Goto(fax,2201,1)

 I would be interested in how you do fax autodetection.

I don't do anything particularly special, Asterisk just makes it work.
This is using a bog-standard POTS line at home.  Here's the relevant
part of my config:

[macro-outsideline]
   exten = s,1,LookupCIDName
   exten = s,2,SetMusicOnHold(random)
   exten = s,3,Dial(${PHONES},13,Ttm)
   exten = s,4,Answer
   exten = s,5,Goto(outside-ivr,s,1)

[outside-ivr]
   ; This is the outside IVR
   ; Playback a We're not home message
   ; To leave a message for Scott, press 1
   ; To leave a message for C, press 2
   ; Otherwise stay on the line.
   ;
   ; Also, 3 = main voicemail
   ;   4 = check voicemail (main)
   ;   5 = check voicemail
   ;   6 = DISA (with password)
   ;
   ; Check for fax, too

   exten = s,1,NoOp
   exten = s,2,DigitTimeout(5)
   exten = s,3,ResponseTimeout(2)
   exten = s,4,Wait(1)
   exten = s,5,Background(laird/ivr-greeting)

   exten = t,1,VoiceMail(s2201)
   exten = t,2,Hangup

   ; other stuff goes here, but it's not really important

   exten = fax,1,Answer
   exten = fax,2,Goto(fax,2201,1)

[outside]
   exten = s,1,Macro(outsideline)
   exten = fax,1,Goto(fax,2201,1)


95% of this isn't important for faxing, but I included it for context.
The big issue is the IVR stuff and the 'fax' extension.  Once we get to
the IVR, asterisk is listening for DTMF tones and apparently also fax
tones.  If it hears a fax, then it goes to the 'fax' extension.  That's
it.


Scott


___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


smime.p7s
Description: S/MIME cryptographic signature


[Asterisk-Users] RxFax/spandsp: file-naming of received faxes

2004-03-28 Thread Jan Baumann
Hi,

after successfully having installed RxFax/SpanDSP and some promising tests 
(great piece of software, Steve!) I wonder if it is possible to avoid 
overwriting the same tiff file over and over again.

Browsing the sourcecode of app_rxfax.c I found a magic '%d' flag being parsed 
out from the argument of rxfax(), but didn't manage to make that work.

extensions.conf:
exten = _3XX,1,rxfax(/tmp/faxfor-${EXTEN}-%d.tif)
always produces filenames like 'faxfor-345-0.tif', so the %d is handled somehow.
My intension is to watch the fax directory for new files by a cron job and email 
them to their recipients.

It would be nice to have %d being replaced by a timestamp like 20040328120208 or 
simply an incrementing integer and if possible have the calling station id added 
to the filename.

Any hints are greatly appreciated.

Thanks a lot,
Jan
___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] RxFax/spandsp: file-naming of received faxes

2004-03-28 Thread Nicolas Gudino
Hi Jan,

Try this:

exten = _3XX,1,SetVar(FAXFILE=/tmp/faxfor-${EXTEN}-${TIMESTAMP}.tif)
exten = _3XX,2,rxfax(${FAXFILE})

Good luck,

- Original Message - 
From: Jan Baumann [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, March 28, 2004 7:09 AM
Subject: [Asterisk-Users] RxFax/spandsp: file-naming of received faxes


 after successfully having installed RxFax/SpanDSP and some promising tests
 (great piece of software, Steve!) I wonder if it is possible to avoid
 overwriting the same tiff file over and over again.

 Browsing the sourcecode of app_rxfax.c I found a magic '%d' flag being
parsed
 out from the argument of rxfax(), but didn't manage to make that work.

 extensions.conf:
 exten = _3XX,1,rxfax(/tmp/faxfor-${EXTEN}-%d.tif)

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] RxFax/spandsp: file-naming of received faxes

2004-03-28 Thread Petr Grussmann
working thank you

Nicolas Gudino wrote:

Hi Jan,

Try this:

exten = _3XX,1,SetVar(FAXFILE=/tmp/faxfor-${EXTEN}-${TIMESTAMP}.tif)
exten = _3XX,2,rxfax(${FAXFILE})
Good luck,

- Original Message - 
From: Jan Baumann [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, March 28, 2004 7:09 AM
Subject: [Asterisk-Users] RxFax/spandsp: file-naming of received faxes

 

after successfully having installed RxFax/SpanDSP and some promising tests
(great piece of software, Steve!) I wonder if it is possible to avoid
overwriting the same tiff file over and over again.
Browsing the sourcecode of app_rxfax.c I found a magic '%d' flag being
   

parsed
 

out from the argument of rxfax(), but didn't manage to make that work.

extensions.conf:
exten = _3XX,1,rxfax(/tmp/faxfor-${EXTEN}-%d.tif)
   

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users
 

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] RxFax/spandsp: file-naming of received faxes

2004-03-28 Thread Scott Laird
On Mar 28, 2004, at 5:21 AM, Nicolas Gudino wrote:

Hi Jan,

Try this:

exten = _3XX,1,SetVar(FAXFILE=/tmp/faxfor-${EXTEN}-${TIMESTAMP}.tif)
exten = _3XX,2,rxfax(${FAXFILE})
Or

  exten = 
_3XX,1,SetVar(FAXFILE=/var/spool/asterisk-fax/${UNIQUEID}.tif)

If you want a unique id, why not use the one that Asterisk provides?

In case anyone's interested, I spent a bit of time on incoming faxes 
yesterday, prototyping a DID FAX-type setup.  Here are a few snippets, 
in case anyone's interested.

[macro-faxreceive]
  exten = s,1,SetVar(FAXFILE=/var/spool/asterisk-fax/${UNIQUEID}.tif)
  exten = s,2,DBGet(EMAILADDR=extensionemail/${MACRO_EXTEN})
  exten = s,3,rxfax(${FAXFILE})
  exten = s,103,SetVar([EMAIL PROTECTED])
  exten = s,104,Goto(3)
[fax]
  exten = 2201,1,Macro(faxreceive)
  exten = 2202,1,Macro(faxreceive)
  exten = 2203,1,Macro(faxreceive)
  exten = h,1,system(/usr/local/sbin/mailfax ${FAXFILE} ${EMAILADDR} \
 ${CALLERIDNUM} ${CALLERIDNAME})
; I'm using a shared analog line for testing this, so I'm using the fax
; autodetection code to yank faxes out of my IVR and into the 'fax'
; pseudo-extension
[outside]
  ...
  exten = fax,1,Goto(fax,2201,1)
Finally, here's /usr/local/sbin/mailfax:

#!/bin/sh

FAXFILE=$1
RECIPIENT=$2
FAXSENDER=$3
tiff2ps -2eaz -w 8.5 -h 11 $FAXFILE |
  ps2pdf - |
  mime-construct --to $RECIPIENT --subject Fax from $FAXSENDER 
--attachment fax.pdf --type application/pdf --file -

In Debian, tiff2ps comes in libtiff-tools, ps2pdf is part of 
Ghostscript, and mime-construct is its own package.

To set the email address associated with each extension, do 'database 
put extensionemail EXTEN [EMAIL PROTECTED]'

Scott

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] RxFax/spandsp: file-naming of received faxes

2004-03-28 Thread Scott Laird
On Mar 28, 2004, at 7:40 PM, Martin List-Petersen wrote:

; I'm using a shared analog line for testing this, so I'm using the 
fax
; autodetection code to yank faxes out of my IVR and into the 'fax'
; pseudo-extension
[outside]
   ...
   exten = fax,1,Goto(fax,2201,1)
I would be interested in how you do fax autodetection.
I don't do anything particularly special, Asterisk just makes it work.  
This is using a bog-standard POTS line at home.  Here's the relevant 
part of my config:

[macro-outsideline]
  exten = s,1,LookupCIDName
  exten = s,2,SetMusicOnHold(random)
  exten = s,3,Dial(${PHONES},13,Ttm)
  exten = s,4,Answer
  exten = s,5,Goto(outside-ivr,s,1)
[outside-ivr]
  ; This is the outside IVR
  ; Playback a We're not home message
  ; To leave a message for Scott, press 1
  ; To leave a message for C, press 2
  ; Otherwise stay on the line.
  ;
  ; Also, 3 = main voicemail
  ;   4 = check voicemail (main)
  ;   5 = check voicemail
  ;   6 = DISA (with password)
  ;
  ; Check for fax, too
  exten = s,1,NoOp
  exten = s,2,DigitTimeout(5)
  exten = s,3,ResponseTimeout(2)
  exten = s,4,Wait(1)
  exten = s,5,Background(laird/ivr-greeting)
  exten = t,1,VoiceMail(s2201)
  exten = t,2,Hangup
  ; other stuff goes here, but it's not really important

  exten = fax,1,Answer
  exten = fax,2,Goto(fax,2201,1)
[outside]
  exten = s,1,Macro(outsideline)
  exten = fax,1,Goto(fax,2201,1)
95% of this isn't important for faxing, but I included it for context.  
The big issue is the IVR stuff and the 'fax' extension.  Once we get to 
the IVR, asterisk is listening for DTMF tones and apparently also fax 
tones.  If it hears a fax, then it goes to the 'fax' extension.  That's 
it.

Scott

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users