From 5eb924e373682320df434349f7057a8989c8a280 Mon Sep 17 00:00:00 2001 From: gernot Date: Tue, 18 Mar 2003 23:12:00 +0000 Subject: [PATCH] implemented dial_prefix, this fixed bug #537 git-svn-id: https://svn.ibp.de/svn/capisuite/trunk/capisuite@45 4ebea2bb-67d4-0310-8558-a5799e421b66 --- NEWS | 4 +++- docs/manual.docbook | 15 ++++++++++++++- scripts/capisuitefax | 21 ++++++++++++++------- scripts/fax.confin | 12 ++++++++++-- 4 files changed, 41 insertions(+), 11 deletions(-) diff --git a/NEWS b/NEWS index 476d0ca..9a7c214 100644 --- a/NEWS +++ b/NEWS @@ -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 /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 diff --git a/docs/manual.docbook b/docs/manual.docbook index ba884b8..52fe34d 100644 --- a/docs/manual.docbook +++ b/docs/manual.docbook @@ -641,6 +641,15 @@ make install overwritten in the user sections individually. + + + If anything is entered here, it will be used as a prefix which is added to any + number given to capisuitefax 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. + + Default setting which defines how many seconds we will wait for a successful connection after @@ -941,7 +950,7 @@ make install The following options are recognized by capisuitefax: - capisuitefax [-q] -d dialstring file1 [file2...] + capisuitefax [-q] [-n] -d dialstring file1 [file2...] capisuitefax [-q] -a id capisuitefax [-h] [-l] @@ -962,6 +971,10 @@ make install Shows the jobs which are currenty in the send queue. + + + Don't use the configured dial prefix for this job. Useful for internal jobs. + Be quiet, don't output informational messages diff --git a/scripts/capisuitefax b/scripts/capisuitefax index aef75df..853bea7 100755 --- a/scripts/capisuitefax +++ b/scripts/capisuitefax @@ -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 file1 [file2...] or" + print "capisuitefax [-q] [-n] -d file1 [file2...] or" print "capisuitefax [-q] -a or" print "capisuitefax [-h] [-l]" print print "possible options are:" print - print "-d , --dialstring= send fax to this number (required)" print "-a , --abort= abort fax job with id (id is a number)" - print "-l, --list print the jobs in the send queue" + print "-d , --dialstring= 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: diff --git a/scripts/fax.confin b/scripts/fax.confin index 6f1a5b2..fa09f37 100644 --- a/scripts/fax.confin +++ b/scripts/fax.confin @@ -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 #