implemented dial_prefix, this fixed bug #537

git-svn-id: https://svn.ibp.de/svn/capisuite/trunk/capisuite@45 4ebea2bb-67d4-0310-8558-a5799e421b66
This commit is contained in:
gernot 2003-03-18 23:12:00 +00:00
parent 90da7fe57f
commit 5eb924e373
4 changed files with 41 additions and 11 deletions

4
NEWS
View File

@ -112,5 +112,7 @@
* scripts: fixed remote inquiry: mixed new and old messages sometimes
* core: fixed quite some problems when doing "make install" to an arbitrary
prefix, thanks to Achim Bohnet for pointing me to these
* core: moved "capisuite" to <prefix>/sbin instead of bin
* scripts: stricter permissions of received files and dirs, thx to Achim Bohnet
this fixes bug #544
this fixes bug #544
* scripts: dial_prefix implemented, closes bug #537

View File

@ -641,6 +641,15 @@ make install</screen>
overwritten in the user sections individually.</para>
</listitem>
</varlistentry>
<varlistentry id="fax_dial_prefix">
<term><option>dial_prefix=""</option></term>
<listitem><para>If anything is entered here, it will be used as a prefix which is added to any
number given to <command>capisuitefax</command> as prefix. This is e.g. very helpful if your
ISDN adapter is connected to a PBX which needs "0" for external calls. It's also possible to
disable its usage later for a certain fax document, so setting this will certainly not prevent
you from placing internal calls without prefix.</para>
</listitem>
</varlistentry>
<varlistentry id="fax_outgoing_timeout">
<term><option>outgoing_timeout="60"</option></term>
<listitem><para>Default setting which defines how many seconds we will wait for a successful connection after
@ -941,7 +950,7 @@ make install</screen>
<para>The following options are recognized by <command>capisuitefax</command>:</para>
<screen>capisuitefax [-q] -d dialstring file1 [file2...]</screen>
<screen>capisuitefax [-q] [-n] -d dialstring file1 [file2...]</screen>
<screen>capisuitefax [-q] -a id</screen>
<screen>capisuitefax [-h] [-l]</screen>
<variablelist>
@ -962,6 +971,10 @@ make install</screen>
<term><option>-l</option></term>
<listitem><para>Shows the jobs which are currenty in the send queue.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-n</option></term>
<listitem><para>Don't use the configured dial prefix for this job. Useful for internal jobs.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-q</option></term>
<listitem><para>Be quiet, don't output informational messages</para></listitem>

View File

@ -4,7 +4,7 @@
# ---------------------------------------------------
# copyright : (C) 2002 by Gernot Hillier
# email : gernot@hillier.de
# version : $Revision: 1.2 $
# version : $Revision: 1.3 $
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -15,25 +15,27 @@ import getopt,os,sys,re,time,pwd,errno,fcntl
# capisuite stuff
import cs_helpers
dialstring=""
dialstring=""
abort=""
quiet=0
listqueue=0
useprefix=1
def usage(error=""):
print "capisuitefax - capisuite tool for enqueueing faxes"
print
print "usage:"
print "capisuitefax [-q] -d <dial> file1 [file2...] or"
print "capisuitefax [-q] [-n] -d <dial> file1 [file2...] or"
print "capisuitefax [-q] -a <id> or"
print "capisuitefax [-h] [-l]"
print
print "possible options are:"
print
print "-d <dial>, --dialstring=<dial> send fax to this number (required)"
print "-a <id>, --abort=<id> abort fax job with id (id is a number)"
print "-l, --list print the jobs in the send queue"
print "-d <dial>, --dialstring=<dial> send fax to this number (required)"
print "-h, --help print this usage information"
print "-l, --list print the jobs in the send queue"
print "-n, --noprefix ignore configured dial prefix for this call (for internal calls)"
print "-q, --quiet be quiet, don't output informational messages"
print
print "The given files must be in Adobe PostScript format"
@ -87,7 +89,7 @@ def abortjob(config,user,job):
try:
optlist,args = getopt.getopt(sys.argv[1:], "d:a:lhq", ['dialstring=','help',"abort=","list","quiet"])
optlist,args = getopt.getopt(sys.argv[1:], "d:a:lhqn", ['dialstring=','noprefix','help',"abort=","list","quiet"])
except getopt.GetoptError, e:
usage(e.msg)
@ -95,6 +97,7 @@ except getopt.GetoptError, e:
# read options
for option,param in optlist:
if option in ('-d','--dialstring'): dialstring=param
if option in ('-n','--noprefix'): useprefix=0
if option in ('-h','--help'): usage()
if option in ('-l','--list'): listqueue=1
if option in ('-a','--abort'): abort=param
@ -128,7 +131,11 @@ if (listqueue):
showlist(config,user)
if (abort):
abortjob(config,user,abort)
abortjob(config,user,abort)
prefix=cs_helpers.getOption(config,user,"dial_prefix")
if (useprefix and prefix!=None):
dialstring=prefix+dialstring
# convert and enqueue files
for i in args:

View File

@ -1,4 +1,4 @@
# $Id: fax.confin,v 1.2 2003/02/21 13:12:19 gernot Exp $
# $Id: fax.confin,v 1.3 2003/03/18 23:12:00 gernot Exp $
#
# This is the fax configuration file for the scripts distributed with CapiSuite
#
@ -79,7 +79,15 @@ outgoing_MSN=""
#
# This value decides how long to wait for a successful connection if the other
# party doesn't answer the call at once.
outgoing_timeout="60"
outgoing_timeout="60"
# dial_prefix
#
# This value is used as a prefix for all outgoing numbers when using
# capisuitefax for enqueueing a fax document. It will be saved in the
# description file and so won't change anything for already enqueued
# documents.
dial_prefix=""
# fax_stationID
#