Re: executing scripts after receiving a fax
I've posted another message to the mgetty list announcing my clerk
package which I believe addresses some of what you are interested in.
My discussion below is in relation to how clerk does or could address
On Tue, Nov 25, 2003 at 09:25:45PM +0100, Andreas Barth wrote:
> After a new fax is received, currently a single file is executed, and
> (independent of that) mail sent to the one certain user (mostly to the
> system-administrator). I want to have a plug-able framework, where a
> lot of scripts can sit in, and get executed after a fax is received.
> This should also be scalable to receiving faxes at different phone
> numbers, and handling them different.
This is how clerk handles not only fax receive, but all other events
(cid, ring, voice, etc.). For a fax, mgetty is configured to call
/etc/clerk/fax.agent. fax.agent sets up an environment that is
consistent across all agents, and then sources all the shell scripts in
/etc/clerk/fax/. Those scripts could have conditional sections based on
distinctive ring, called ID, or device to handle different incoming
phone numbers differently.
> My current proposal is to create scripts (sitting in @LIBDIR@) that
clerk scripts sit in /etc/clerk/ and source scripts in /etc/clerk/$event
(/etc/clerk/fax/, /etc/clerk/voice/, ...)
> ... After receiving a fax, the scripts are executed with something
> like run-parts (execute each script in lexical order in a given
> directory), and failure or success are logged.
Basicly what clerk does, see above. The only logging done is to
redirect all output to /var/log/clerk.log for debugging. The default
cid scripts log each call to /var/log/cid.log. Scripts could be added
to log anything they like, and the default logging could be improved to
compose more meaningful messages.
> It would be IMHO much easier if environment would be
> specified as the standard way to pass options (as this would it make
> _really_ easy to e.g. overwrite mail recipient addresses). Any opinion
> on this, and should I use a standard-prefix to variable names (e.g.
The clerk agents try to pass variables in a consistent way in the
environment. Using a standard prefix for the variables is not currently
done, but probably a good idea.
> One last (but more easily) question is open: What programms should
> exist? Create a mail with the fax as png, a mail with pdf, a automatic
> print-out? Any more?
clerk currently supports converting faxes to tif or pdf, and voicemail
to mp3, ogg, or speex.
If you'd like, I'd be willing to work with you see how clerk may fit or
be modified to fit your needs.