Jan Baumann
2004-Mar-28 03:09 UTC
[Asterisk-Users] RxFax/spandsp: file-naming of received faxes
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
Nicolas Gudino
2004-Mar-28 06:21 UTC
[Asterisk-Users] RxFax/spandsp: file-naming of received faxes
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" <asterisk@cyberways.net> To: <asterisk-users@lists.digium.com> 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 beingparsed> 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)
Scott Laird
2004-Mar-28 20:51 UTC
[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