HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [hylafax-users] sendfax and dialrules



Sorry for top posting, but, a little more info on the problem. I read
the man page for sendfax and it looks like I can put a "DialRules"
parameter into <install_dir>/lib/fax/sendfax.conf. Which I have now
done. The contents of this file are as follows:

----------------------------------------------------------------------
root@host:/opt/hylafax-5.1.8/lib/fax # cat ./sendfax.conf
DialRules: /opt/hylafax-5.1.8/var/spool/etc/dialrules
----------------------------------------------------------------------

I then run the dtrace script "opensnoop.d" which returns a list of files
opened for reading by a process and any error codes if any. The entire
output for this run is attached, it's easier to read in the attached file.

I've highlighted the 2 lines where you can see sendfax opening the
sendfax.conf file and the line where it attempts to open the dialrules
file. In previous run's sendfax did not try to open that particular
dialrules file, previously it attempted to open
<install_dir>/lib/fax/dialrules, which does not exist in my case.

Sooo, now I'm wondering if sendfax is applying the dialrules to my
number, by the looks of things, sendfax does open the dialrules file,
but, based on the session log (as illustrated below), it looks like
sendfax is not actually applying the dialrules to the number passed on
the commandline ("-d 1112222").

Could it be that my dialrules file has a typ0 in it? Does the dialrules
have to be tab delimitered, would there be any problem with the "^\+"
parameter? I know the plus is a metacharacter in regex, so I'm just
wondering if there is anything that does not look right in my dialrules
file (I've attached it aswell, just in case).

This is a weird one for me, I'm no guru with HylaFAX+, but dialtest
works, but any application using the dialrules does not :/

Bruce McAlister wrote:
> Lee Howard wrote:
>> Bruce McAlister wrote:
>>
>>> dialtest -a 01 -c 353 -i 00 -l 0 ./dialrules
>>>
>> If dialtest is giving proper results, but the actual number being dialed
>> or displayed is not in agreement with what you see from dialtest, then...
>>
>> 1) check the permissions on your dialrules and make sure that the faxq
>> and faxsend processes are able to read it.
> 
> The permissions on my dialrules file is as follows:
> 
> root@host:/opt/hylafax-5.1.8/var/spool/etc # ls -l dialrules
> -r--r--r--   1 root     root        2252 Oct  8 22:54 dialrules
> 
> 
>> 2) be aware that DialStringRules is a config option that applies both to
>> etc/config as well as etc/config.<devid>.  Thus it is possible to have
>> faxq and faxsend disagree with each other (and there are reasons why you
>> may *want* this).  So if you're using a non-default dialrules file name
>> you'll want to take special notice of this.
>>
> 
> Just as a precaution, I verified that the modem config files also have
> the dialrules defined in them, but the problem still appears to be the same:
> 
> <spool_dir>/etc/config:
> 
> ----------------------------------------------------------------------------
> root@host:/opt/hylafax-5.1.8/var/spool/etc # cat config
> LogFacility:            daemon
> CountryCode:            353
> AreaCode:               01
> LongDistancePrefix:     0
> InternationalPrefix:    00
> DialStringRules:        "etc/dialrules"
> ServerTracing:          1
> MaxConcurrentCalls:     6
> ----------------------------------------------------------------------------
> 
> <spool_dir>/etc/config._etc_iaxmodem_devices_ttyIAX000
> 
> PS: The config.<dev_modem> files are symlinked back to ../config/iaxmodem.
> 
> ----------------------------------------------------------------------------
> root@host:/opt/hylafax-5.1.8/var/spool/etc # cat
> config._etc_iaxmodem_devices_ttyIAX000
> # $Id: iaxmodem,v 1.6 2007/08/07 18:22:39 faxguy Exp $
> 
> #
> # prototype config for the IAXmodem softmodem which uses
> # the spandsp soft-DSP library
> #
> 
> # CONFIG:CLASS1:spandsp:.*:.*: Manufacturer=spandsp Model=IAXmodem
> # CONFIG:CLASS1.0:spandsp:.*:.*: Manufacturer=spandsp Model=IAXmodem
> #
> # BEGIN-SERVER
> # END-SERVER
> 
> #
> #
> # Modem-related stuff: should reflect modem command interface
> # and hardware connection/cabling (e.g. flow control).
> #
> ModemType:              Class1          # use this to supply a hint
> 
> #
> #             *** Caller-ID settings ***
> #
> # Enabling this will use the hfaxd-protocol to set Caller*ID
> #
> #ModemSetOriginCmd:     "AT+VSID=\"%s\",\"%d\""
> #
> # If "glare" during initialization becomes a problem then take
> # the modem off-hook during initialization, and then place it
> # back on-hook when done.
> #
> #ModemResetCmds:        "ATH1\nAT+VCID=1"       # enables CallID display
> #ModemReadyCmds:        ATH0
> #
> # You'll likely want Caller*ID display (also displays DID) enabled.
> #
> ModemResetCmds:         AT+VCID=1       # enables CallID display
> #
> # If you are "missing" Caller*ID data on some calls (but not all)
> # and if you do not have adequate glare protection you may want to
> # not answer based on RINGs, but rather enable the CallIDAnswerLength
> # for NDID, disable AT+VCID=1 and do this:
> #
> RingsBeforeAnswer: 2
> #ModemRingResponse: AT+VRID=1
> 
> # The pty apparently does not support changing parity.
> PagerTTYParity:         none
> 
> Class1AdaptRecvCmd:     AT+FAR=1
> Class1TMConnectDelay:   400             # counteract quick CONNECT response
> Class1RMQueryCmd:       "!24,48,72,96"  # V.17 fast-train recv doesn't
> work well
> 
> CallIDPattern:          "NMBR="
> CallIDPattern:          "NAME="
> CallIDPattern:          "ANID="
> CallIDPattern:          "NDID="
> #CallIDAnswerLength:    4
> # Uncomment these if you really want them, but you probably don't.
> #CallIDPattern:          "DATE="
> #CallIDPattern:          "TIME="
> 
> Class1ColorJPEGSupport: yes
> Class1JBIGSupport:      yes
> 
> TagLineFont:            etc/lutRS18.pcf
> TagLineFormat:          "From: %%n|%c|Page %%p of %%t"
> 
> DialStringRules:        "etc/dialrules"
> ----------------------------------------------------------------------------
> 
> <spool_dir>/etc/dialrules
> 
> ----------------------------------------------------------------------------
> ! $Id: dialrules,v 1.2 2006/10/17 22:34:42 faxguy Exp $
> !
> ! HylaFAX (tm) Dialing String Processing Rules.
> !
> ! This file describes how to process user-specified dialing strings
> ! to create two items:
> !
> ! CanonicalNumber: a unique string that is derived from all dialing
> ! strings to the same destination phone number.  This string is used
> ! by the fax server for ``naming'' the destination.
> !
> ! DialString: the string passed to the modem for use in dialing the
> ! telephone.  This string should be void of any characters that might
> ! confuse the modem.
> !
> Area=${AreaCode}                ! local area code
> Country=${CountryCode}          ! local country code
> IDPrefix=${InternationalPrefix} ! prefix for placing an international call
> LDPrefix=${LongDistancePrefix}  ! prefix for placing a long distance call
> !
> WS="    "                       ! our notion of white space
> !
> ! Convert a phone number to a canonical format:
> !
> !    +<country><areacode><rest>
> !
> ! by (possibly) stripping off leading dialing prefixes for
> ! long distance and/or international dialing.
> !
> CanonicalNumber := [
> %.*                     =                       ! strip calling card stuff
> [abcABC]                = 2                     ! these convert alpha to
> numbers
> [defDEF]                = 3
> [ghiGHI]                = 4
> [jklJKL]                = 5
> [mnoMNO]                = 6
> [prsPRS]                = 7
> [tuvTUV]                = 8
> [wxyWXY]                = 9
> [^+0-9]+                =                       ! strip white space etc.
> ^${IDPrefix}            = +                     ! replace int. dialing code
> ^${LDPrefix}            = +${Country}           ! replace l.d. dialing code
> ^[^+]                   = +${Country}${Area}&   ! otherwise, insert
> canon form
> ]
> !
> ! Process a dialing string according to local requirements.
> ! These rules do only one transformation: they convert in-country
> ! international calls to long-distance calls.
> !
> DialString := [
> [-${WS}.]+              =                       ! strip syntactic sugar
> \(                      =
> \)                      =
> [abcABC]                = 2                     ! these convert alpha to
> numbers
> [defDEF]                = 3
> [ghiGHI]                = 4
> [jklJKL]                = 5
> [mnoMNO]                = 6
> [prsPRS]                = 7
> [tuvTUV]                = 8
> [wxyWXY]                = 9
> !
> ! Added by Bruce McAlister
> !
> ^00                          = +
> ^[1-9][0-9]{6}$              = ${Area}&
> ^0                           =
> ^[1-9]                       = ${IDPrefix}${Country}&
> ^\+                          = ${IDPrefix}
> ]
> ----------------------------------------------------------------------------
> 
> When I submit the fax I submit it as follows:
> 
> sendfax -n -T 3 -d 1112222 /etc/hosts
> 
> The "faxstat -rs" looks like this
> 
> ----------------------------------------------------------------------------
> HylaFAX scheduler on host: Running
> Modem /etc/iaxmodem/devices/ttyIAX001 (): Waiting for modem to come ready
> Modem /etc/iaxmodem/devices/ttyIAX000 (): Running and idle
> Modem /etc/iaxmodem/devices/ttyIAX005 (): Running and idle
> Modem /etc/iaxmodem/devices/ttyIAX002 (): Running and idle
> Modem /etc/iaxmodem/devices/ttyIAX007 (): Running and idle
> Modem /etc/iaxmodem/devices/ttyIAX003 (): Running and idle
> Modem /etc/iaxmodem/devices/ttyIAX004 (): Running and idle
> Modem /etc/iaxmodem/devices/ttyIAX006 (): Running and idle
> 
> Protect Page  Owner        Sender/TSI  Recvd@ Filename
> -rw----    8  5                       Sat11PM fax000000001.tif
> -rw----    8  5                       Sat11PM fax000000002.tif
> -rw----    1  5                       Sun10AM fax000000003.tif
> -rw----    2  5                       Sun11AM fax000000004.tif
> -rw----    2  5                       Sun12PM fax000000005.tif
> -rw----    1  5                         09:16 fax000000006.tif
> -rw----    1  5                         10:16 fax000000007.tif
> -rw----    1  5                         10:22 fax000000008.tif
> -rw----    1  5                         16:37 fax000000009.tif
> -rw----    1  5                         16:41 fax000000010.tif
> 
> JID  Pri S  Owner Number       Pages Dials     TTS Status
> 41   126 S   root 1112222       0:1   1:3    23:47 No local dialtone
> ----------------------------------------------------------------------------
> 
> The session log looks as follows:
> 
> ----------------------------------------------------------------------------
> Oct 09 00:42:47.79: [22686]: SESSION BEGIN 000000068 +1112222
> Oct 09 00:42:47.79: [22686]: HylaFAX (tm) Version 5.1.8
> Oct 09 00:42:47.79: [22686]: SEND FAX: JOB 41 DEST 1112222 COMMID
> 000000068 DEVICE '/etc/iaxmodem/devices/ttyIAX001' FROM 'Super-Use
> r <root@host>' USER root
> Oct 09 00:42:47.79: [22686]: STATE CHANGE: RUNNING -> SENDING
> Oct 09 00:42:47.79: [22686]: <-- [12:AT+FCLASS=1\r]
> Oct 09 00:42:47.79: [22686]: <-- <11:41 54 2B 46 43 4C 41 53 53 3D 31>
> Oct 09 00:42:47.79: [22686]: <-- <1:0D>
> Oct 09 00:42:47.79: [22686]: --> <2:0D 0A>
> Oct 09 00:42:47.79: [22686]: --> <4:4F 4B 0D 0A>
> Oct 09 00:42:47.79: [22686]: --> [2:OK]
> Oct 09 00:42:47.79: [22686]: MODEM set XON/XOFF/FLUSH: input ignored,
> output disabled
> Oct 09 00:42:47.79: [22686]: DIAL 1112222
> Oct 09 00:42:47.79: [22686]: <-- [12:ATDT1112222\r]
> Oct 09 00:42:47.79: [22686]: <-- <11:41 54 44 54 31 31 31 32 32 32 32>
> Oct 09 00:42:47.79: [22686]: <-- <1:0D>
> Oct 09 00:42:47.80: [22686]: --> <2:0D 0A>
> Oct 09 00:42:47.80: [22686]: --> <13:4E 4F 20 44 49 41 4C 54 4F 4E 45 0D 0A>
> Oct 09 00:42:47.80: [22686]: --> [11:NO DIALTONE]
> Oct 09 00:42:47.80: [22686]: SEND FAILED: JOB 41 DEST 1112222 ERR No
> local dialtone {E004}
> Oct 09 00:42:48.81: [22686]: <-- [5:ATH0\r]
> Oct 09 00:42:48.81: [22686]: <-- <4:41 54 48 30>
> Oct 09 00:42:48.81: [22686]: <-- <1:0D>
> Oct 09 00:42:48.81: [22686]: --> <2:0D 0A>
> Oct 09 00:42:48.81: [22686]: --> <4:4F 4B 0D 0A>
> Oct 09 00:42:48.81: [22686]: --> [2:OK]
> Oct 09 00:42:48.81: [22686]: MODEM set DTR OFF
> Oct 09 00:42:48.81: [22686]: MODEM set baud rate: 0 baud (flow control
> unchanged)
> Oct 09 00:42:48.81: [22686]: STATE CHANGE: SENDING -> MODEMWAIT (timeout 5)
> Oct 09 00:42:48.81: [22686]: SESSION END
> ----------------------------------------------------------------------------
> 
> The asterisk server we are using for relaying does it's routing on the
> destination number, this number must be of the
> <IDPrefix><CountryCode><AreaCode><Number>, hence the configuration of
> the dialrules. If Asterisk does not see a number of this form it hangs
> up the line, i assume this is why we get no dialtone when the modem
> tries to dial that number.
> 
> Any additional tips or suggestions would be appreciated.
> 
>> Thanks,
>>
>> Lee.
>>
>>
>> ____________________ HylaFAX(tm) Users Mailing List _______________________
>>  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
>> On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
>>  *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*
>>
>>
> 
> 
> ____________________ HylaFAX(tm) Users Mailing List _______________________
>   To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
>  On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
>   *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*
> 
> 

TIME           STRTIME                UID    PID  FD ERR PATH                 ARGS
2598246788971  2007 Oct  9 10:35:53     0  22588   3   0 /var/ld/ld.config                            sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246789089  2007 Oct  9 10:35:53     0  22588   3   0 /opt/hylafax/lib/libfaxutil.so               sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246789259  2007 Oct  9 10:35:53     0  22588   3   0 /usr/sfw/lib/libstdc++.so.6                  sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246789475  2007 Oct  9 10:35:53     0  22588   3   0 /lib/libpam.so.1                             sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246789574  2007 Oct  9 10:35:53     0  22588   3   0 /opt/csw/lib/libjbig.so.1                    sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246789660  2007 Oct  9 10:35:53     0  22588   3   0 /opt/hylafax/lib/libtiff.so.3                sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246789763  2007 Oct  9 10:35:53     0  22588   3   0 /usr/lib/libz.so.1                           sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246789850  2007 Oct  9 10:35:53     0  22588   3   0 /lib/libsocket.so.1                          sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246789941  2007 Oct  9 10:35:53     0  22588   3   0 /lib/libnsl.so.1                             sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246790088  2007 Oct  9 10:35:53     0  22588   3   0 /usr/lib/libmalloc.so.1                      sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246790164  2007 Oct  9 10:35:53     0  22588   3   0 /lib/libm.so.2                               sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246790274  2007 Oct  9 10:35:53     0  22588   3   0 /usr/sfw/lib/libgcc_s.so.1                   sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246790364  2007 Oct  9 10:35:53     0  22588   3   0 /lib/libc.so.1                               sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246790552  2007 Oct  9 10:35:53     0  22588   3   0 /lib/libcmd.so.1                             sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246790644  2007 Oct  9 10:35:53     0  22588   3   0 /opt/hylafax/lib/libjpeg.so.62               sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246794401  2007 Oct  9 10:35:53     0  22588   3   0 /usr/lib/locale/en_IE.UTF-8/en_IE.UTF-8.so.3 sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246794530  2007 Oct  9 10:35:53     0  22588   3   0 /usr/lib/locale/common/methods_unicode.so.3  sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246795036  2007 Oct  9 10:35:53     0  22588   3   0 /opt/hylafax-5.1.8/lib/fax/hyla.conf         sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246795165  2007 Oct  9 10:35:53     0  22588   3   0 /opt/hylafax-5.1.8/lib/fax/sendfax.conf      sendfax -n -T 3 -d 1112222 /etc/hosts\0    <------- sendfax.conf
2598246795216  2007 Oct  9 10:35:53     0  22588  -1   2 //.hylarc                                    sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246795243  2007 Oct  9 10:35:53     0  22588  -1   2 //.faxdb                                     sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246795367  2007 Oct  9 10:35:53     0  22588   3   0 /etc/nsswitch.conf                           sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246795579  2007 Oct  9 10:35:53     0  22588   3   0 /lib/nss_files.so.1                          sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246795697  2007 Oct  9 10:35:53     0  22588   3   0 /etc/protocols                               sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246795850  2007 Oct  9 10:35:53     0  22588   3   0 /etc/netconfig                               sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246795990  2007 Oct  9 10:35:53     0  22588   3   0 /dev/udp                                     sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246796140  2007 Oct  9 10:35:53     0  22588   4   0 /etc/services                                sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246802929  2007 Oct  9 10:35:53     0  22588   5   0 /var/run/name_service_door                   sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246803449  2007 Oct  9 10:35:53     0  22588   6   0 /opt/hylafax-5.1.8/lib/fax/typerules         sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246803622  2007 Oct  9 10:35:53     0  22588   6   0 /opt/hylafax-5.1.8/var/spool/etc/dialrules   sendfax -n -T 3 -d 1112222 /etc/hosts\0    <------- dialrules
2598246803917  2007 Oct  9 10:35:53     0  22588   6   0 /opt/hylafax-5.1.8/lib/fax/pagesizes         sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246803984  2007 Oct  9 10:35:53     0  22588   6   0 /etc/hosts                                   sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246813934  2007 Oct  9 10:35:53     0  22588   6   0 /tmp//sndfax9daGhS                           sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246814091  2007 Oct  9 10:35:53     0  22588   6   0 /tmp//sndfax9daGhS                           sendfax -n -T 3 -d 1112222 /etc/hosts\0
2598246816771  2007 Oct  9 10:35:53     0  22588   6   0 /usr/share/lib/zoneinfo/Eire                 sendfax -n -T 3 -d 1112222 /etc/hosts\0
! $Id: dialrules,v 1.2 2006/10/17 22:34:42 faxguy Exp $
!
! HylaFAX (tm) Dialing String Processing Rules.
!
! This file describes how to process user-specified dialing strings
! to create two items:
!
! CanonicalNumber: a unique string that is derived from all dialing
! strings to the same destination phone number.  This string is used
! by the fax server for ``naming'' the destination. 
!
! DialString: the string passed to the modem for use in dialing the
! telephone.  This string should be void of any characters that might
! confuse the modem.
!
Area=${AreaCode}		! local area code
Country=${CountryCode}		! local country code
IDPrefix=${InternationalPrefix}	! prefix for placing an international call
LDPrefix=${LongDistancePrefix}	! prefix for placing a long distance call
!
WS=" 	"			! our notion of white space
!
! Convert a phone number to a canonical format:
!
!    +<country><areacode><rest>
!
! by (possibly) stripping off leading dialing prefixes for
! long distance and/or international dialing.
!
CanonicalNumber := [
%.*			=			! strip calling card stuff
[abcABC]		= 2			! these convert alpha to numbers
[defDEF]		= 3
[ghiGHI]		= 4
[jklJKL]		= 5
[mnoMNO]		= 6
[prsPRS]		= 7
[tuvTUV]		= 8
[wxyWXY]		= 9
[^+0-9]+		=			! strip white space etc.
^${IDPrefix}		= +			! replace int. dialing code
^${LDPrefix}		= +${Country}		! replace l.d. dialing code
^[^+]			= +${Country}${Area}&	! otherwise, insert canon form
]
!
! Process a dialing string according to local requirements.
! These rules do only one transformation: they convert in-country
! international calls to long-distance calls.
!
DialString := [
[-${WS}.]+		=			! strip syntactic sugar
\(			=
\)			=
[abcABC]		= 2			! these convert alpha to numbers
[defDEF]		= 3
[ghiGHI]		= 4
[jklJKL]		= 5
[mnoMNO]		= 6
[prsPRS]		= 7
[tuvTUV]		= 8
[wxyWXY]		= 9
!
! Added by Bruce McAlister
!
^00                          = +
^[1-9][0-9]{6}$              = ${Area}&				! Add area code to local number
^0                           =   				! Strip leadin 0 off long distance calls
^[1-9]                       = ${IDPrefix}${Country}&		! Add internation dial prefix and country code to local number
^\+                          = ${IDPrefix}			! Convert leading + to international dial prefix
]



Project hosted by iFAX Solutions