Redialing with sendfax (mgetty+fax) if busy - Setup

This is a discussion on Redialing with sendfax (mgetty+fax) if busy - Setup ; Hello, I'm working on a script to fax messages to various offices, but I need to account for the fax being busy. I checked out using Hylafax, but honestly that's WAY more complicated then we need. We don't need a ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Redialing with sendfax (mgetty+fax) if busy

  1. Redialing with sendfax (mgetty+fax) if busy

    Hello,

    I'm working on a script to fax messages to various offices, but I need
    to account for the fax being busy. I checked out using Hylafax, but
    honestly that's WAY more complicated then we need. We don't need a
    full blown fax server, just faxing files from a shell script, which is
    working fine with the mgetty+fax sendfax.

    Our only problem is that if the line is busy we get this:
    dial failed (BUSY/NO ANSWER)
    .... then the command ends with no retry.

    Here is what we have in /etc/mgetty/sendfax.config:

    verbose y
    debug 5
    fax-devices ttyS1
    fax-id
    max-tries 3
    max-tries-continue y

    I assumed the max-tries 3 and max-tries-continue y would account for
    retrying, but it's not working if so.

    Any suggestions? I guess I could write a shellscript to loop through
    the command a few times until it receives an error code of 0, but
    that's a PITA if the command should have this feature built in.

    Am I missing something?

    Thanks --

    Alex


  2. Re: Redialing with sendfax (mgetty+fax) if busy

    On May 21, 3:25 pm, Alex wrote:
    > Hello,
    >
    > I'm working on a script to fax messages to various offices, but I need
    > to account for the fax being busy. I checked out using Hylafax, but
    > honestly that's WAY more complicated then we need. We don't need a
    > full blown fax server, just faxing files from a shell script, which is
    > working fine with the mgetty+fax sendfax.
    >
    > Our only problem is that if the line is busy we get this:
    > dial failed (BUSY/NO ANSWER)
    > ... then the command ends with no retry.
    >
    > Here is what we have in /etc/mgetty/sendfax.config:
    >
    > verbose y
    > debug 5
    > fax-devices ttyS1
    > fax-id
    > max-tries 3
    > max-tries-continue y
    >
    > I assumed the max-tries 3 and max-tries-continue y would account for
    > retrying, but it's not working if so.
    >
    > Any suggestions? I guess I could write a shellscript to loop through
    > the command a few times until it receives an error code of 0, but
    > that's a PITA if the command should have this feature built in.
    >
    > Am I missing something?
    >
    > Thanks --
    >
    > Alex


    Hi,

    I still would like to know if anyone knows whether or not sendfax can
    redial in case of a busy message or error sending, but until I find
    out I've written a shellscript that'll do the trick. Just in-case
    someone else runs across this problem here it is:

    # Filename and Useage: sendfax_redial phone-number filename retries
    dialcount=0
    while [ $dialcount -lt $3 ]
    do
    if sendfax $1 $2
    then dialcount=$3
    else dialcount=`expr $dialcount "+" 1`
    fi
    done
    exit 1

    So if you're sending the file myfile.g3 to 555-1212 and you want it to
    redial 5 times, here ya go:
    sendfax_redial 5551212 myfile.g3 5
    Also note, this is sendfax with mgetty+fax and not Hylafax. I believe
    the sendmail with Hylafax has a redial flag.

    I'm still testing this and hope to use the error codes from sendfax to
    do more stuff (like email me if it fails), but this is a quick and
    dirty way to get this going. Anyone more familiar with sendfax see
    any problems in this? I'll test it thoroughly before implementing,
    but just curious.

    Thanks --

    Alex


  3. Re: Redialing with sendfax (mgetty+fax) if busy

    Alex writes:

    >Hello,


    >I'm working on a script to fax messages to various offices, but I need
    >to account for the fax being busy. I checked out using Hylafax, but
    >honestly that's WAY more complicated then we need. We don't need a
    >full blown fax server, just faxing files from a shell script, which is
    >working fine with the mgetty+fax sendfax.


    Why are you trying to reinvent the wheel? Faxservers are precisely to solve
    problems like you have.


    >Our only problem is that if the line is busy we get this:
    >dial failed (BUSY/NO ANSWER)
    >... then the command ends with no retry.


    It retries the next time the faxq runs. Three times according your config.


    >Here is what we have in /etc/mgetty/sendfax.config:


    >verbose y
    >debug 5
    >fax-devices ttyS1
    >fax-id
    >max-tries 3
    >max-tries-continue y


    >I assumed the max-tries 3 and max-tries-continue y would account for
    >retrying, but it's not working if so.


    >Any suggestions? I guess I could write a shellscript to loop through
    >the command a few times until it receives an error code of 0, but
    >that's a PITA if the command should have this feature built in.


    >Am I missing something?


    Yes.
    crontab -e
    0-55/5 * * * * /usr/bin/faxrunq
    runs faxrunq every 5 min. When a fax does not go through this tries again
    next time it is run.

    faxspool spools the fax.


    >Thanks --


    >Alex



+ Reply to Thread