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] FaxDispatch - routing - based on called number?



><snip>
>
>Look at 'man hylafax-config' for "SHIELDED_DTMF", and you should see a nice example of how to accomplish what you want.  The specific CID mechanism is changing for 4.2.2 (to CallID) from the way it was in 4.2.1, so in 4.2.2 the approach will be like this:
>
>  ModemRingResponse: AT+FCLASS=8;H1
>  CallIDPattern: SHIELDED_DTMF
>  CallIDAnswerLength: 4
>  ModemAnswerCmd: <delay:100>AT+FCLASS=1;A
>
>In 4.2.1 you should use CIDNumber instead of CallIDPattern and CIDNumberAnswerLength instead of CallIDAnswerLength, but I think that it's the same otherwise.
>
>To watch the DID come in you'll need to have you ServerTracing set up high enough, and then you'll have to look at your server log.  Of course, the DID will get passed on to faxrcvd/FaxDispatch.
>
>Lee.
>
><snip>
>	
>
>Many thanks for this, this is looking promising. Just a few questions if I may.
>
>Will I have to modify the faxrcvd script?
>

No.

> To include the DNIS information. Or is this passed to FaxDispatch already?
>  
>

Yes.

>This is 4.2.1, in FaxDispatch I had something like:
>
>case '$SENDER" in
>*123*456*789*) SENDTO=me@xxxxxxxxxxxx;FILETYPE=pdf;
>*987*654*321*) SENDTO=me@xxxxxxxx;filetype=pdf;; esac
>
>What is the equivalent of $SENDER in this case - $CIDNUMBER ?
>  
>

Yes.

In 4.2.2 it will be $CALLIDn where "n" is a number indicating the instance of CallIDPattern in the modem config file that matched the response from the modem.  However, CIDNumber and CIDName still work as expected in 4.2.2, so you should have no worries about upgrading.

Lee.





Hmmmz.
Sorry for this long post.
I am having trouble to get this running. Here is what I have:

In /var/spool/hylafax/etc

# more config

#ContCoverPage:         "etc/cover.templ"
#DestControls:          "etc/destctrls"
#DialStringRules:       "etc/dialrules"
#QualifyCID:            "etc/cid"
#QualifyTSI:            "etc/tsi"
#ServerTracing:         0x08501
ServerTracing:          0x03FFFF
#ServerTracing:         11
InternationalPrefix:    00

# more hfaxd.conf

LogFacility:            daemon          # syslog facility (want this 1st))
#ServerTracing:         0x001           # just server operation
ServerTracing:          0x03FFFF
#IdleTimeout:           900             # initial client idle timeout (secs)
#MaxIdleTimeout:        7200            # max client idle timeout (secs)

The rest is #'ed out.

I read somewhere that this would allow me to debug.

# more config.ttyS0
(just the last part)

# The following to allow routing in FaxDispatch via DNIS
ModemRingResponse:      AT+FCLASS=8;H1
CIDNumber:              SHIELDED_DTMF
CIDNumberAnswerLength:  4
ModemAnswerCmd:         <delay:100>AT+FCLASS=1;A
#
Class1Cmd:              AT+FCLASS=1     # command to enter class 1
Class1PPMWaitCmd:       AT+FTS=7        # command to stop and wait before PPM
Class1TCFWaitCmd:       AT+FTS=7        # command to stop and wait before TCF
Class1EOPWaitCmd:       AT+FTS=9        # command to stop and wait before EOP
Class1MsgRecvHackCmd:   ""      # command to avoid +FCERROR before image
Class1TCFResponseDelay: 75              # 75ms delay between recv TCF & response
Class1SendMsgDelay:     200             # 75ms delay after training
Class1SwitchingCmd:     "<delay:7>"     # silence between HDLC recv and trans
Class1TrainingRecovery: 1500            # 1.5sec delay after training failure
Class1RecvAbortOK:      200             # wait 200ms for abort response
Class1FrameOverhead:    4               # 4 byte overhead in recvd HDLC frames
Class1RecvIdentTimer:   40000           # 35+5secs waiting for ident frames
Class1TCFMaxNonZero:    10              # max 10% of data may be non-zero
Class1TCFMinRun:        1000            # min run is 2/3rds of TCF duration

When I send a fax to a number on the pbx,I route it to the fax station, pause, and send 4 digits. The fax station is 025. This looks like this:

Route-to number 025~p1234

The ~p is a pause. If I route it to my phone, and pick it up, I hear the 4 DTMF signals (1234).

The Fax is received fine, but in the log (which I assume is /var/spool/hylafax/log) I see this:

#more c000000026 (this is latest test)

Jun 29 12:01:03.28: [ 1920]: SESSION BEGIN 000000031 31534810025
Jun 29 12:01:03.28: [ 1920]: HylaFAX (tm) Version 4.2.1
Jun 29 12:01:03.29: [ 1920]: DELAY 1000 ms
Jun 29 12:01:04.29: [ 1920]: <-- [14:AT+FCLASS=1;A\r]
Jun 29 12:01:07.32: [ 1920]: --> [7:CONNECT]
Jun 29 12:01:07.32: [ 1920]: ANSWER: FAX CONNECTION  DEVICE '/dev/ttyS0'
Jun 29 12:01:07.32: [ 1920]: RECV FAX: begin
Jun 29 12:01:07.32: [ 1920]: <-- data [32]
Jun 29 12:01:07.32: [ 1920]: <-- data [2]
Jun 29 12:01:09.19: [ 1920]: --> [7:CONNECT]
Jun 29 12:01:09.19: [ 1920]: <-- data [23]
Jun 29 12:01:09.19: [ 1920]: <-- data [2]
Jun 29 12:01:09.95: [ 1920]: --> [7:CONNECT]
Jun 29 12:01:09.95: [ 1920]: <-- data [10]
Jun 29 12:01:09.95: [ 1920]: <-- data [2]
Jun 29 12:01:10.36: [ 1920]: --> [2:OK]
Jun 29 12:01:10.36: [ 1920]: <-- [9:AT+FRH=3\r]
Jun 29 12:01:10.43: [ 1920]: --> [7:CONNECT]
Jun 29 12:01:12.16: [ 1920]: --> [2:OK]
Jun 29 12:01:12.16: [ 1920]: REMOTE TSI "0534810022"
Jun 29 12:01:12.16: [ 1920]: <-- [9:AT+FRH=3\r]
Jun 29 12:01:12.19: [ 1920]: --> [7:CONNECT]
Jun 29 12:01:12.43: [ 1920]: --> [2:OK]
Jun 29 12:01:12.43: [ 1920]: REMOTE wants 9600 bit/s
Jun 29 12:01:12.43: [ 1920]: REMOTE wants A4 page width (215 mm)
Jun 29 12:01:12.43: [ 1920]: REMOTE wants unlimited page length
Jun 29 12:01:12.43: [ 1920]: REMOTE wants 3.85 line/mm
Jun 29 12:01:12.43: [ 1920]: REMOTE wants 2-D MMR
Jun 29 12:01:12.43: [ 1920]: REMOTE wants T.30 Annex A, 256-byte ECM
Jun 29 12:01:12.43: [ 1920]: RECV training at v.29 9600 bit/s
Jun 29 12:01:12.43: [ 1920]: <-- [10:AT+FRM=96\r]
Jun 29 12:01:12.76: [ 1920]: --> [7:CONNECT]
Jun 29 12:01:14.27: [ 1920]: RECV: TCF 1792 bytes, 0% non-zero, 1778 zero-run
Jun 29 12:01:14.27: [ 1920]: --> [10:NO CARRIER]
Jun 29 12:01:14.27: [ 1920]: DELAY 75 ms
Jun 29 12:01:14.35: [ 1920]: TRAINING succeeded
Jun 29 12:01:14.35: [ 1920]: <-- [9:AT+FTH=3\r]
Jun 29 12:01:14.39: [ 1920]: --> [7:CONNECT]
Jun 29 12:01:14.39: [ 1920]: <-- data [3]
Jun 29 12:01:14.39: [ 1920]: <-- data [2]
Jun 29 12:01:15.60: [ 1920]: --> [2:OK]
Jun 29 12:01:15.60: [ 1920]: <-- [10:AT+FRM=96\r]
Jun 29 12:01:16.22: [ 1920]: --> [7:CONNECT]
Jun 29 12:01:18.04: [ 1920]: RECV received frame number 0
Jun 29 12:01:18.36: [ 1920]: RECV received frame number 1
Jun 29 12:01:18.68: [ 1920]: RECV received frame number 2
Jun 29 12:01:19.00: [ 1920]: RECV received frame number 3
Jun 29 12:01:19.32: [ 1920]: RECV received frame number 4
Jun 29 12:01:19.64: [ 1920]: RECV received frame number 5
Jun 29 12:01:19.96: [ 1920]: RECV received frame number 6
Jun 29 12:01:20.17: [ 1920]: RECV received frame number 7
Jun 29 12:01:20.49: [ 1920]: RECV received frame number 8
Jun 29 12:01:20.81: [ 1920]: RECV received frame number 9
Jun 29 12:01:21.13: [ 1920]: RECV received frame number 10 # Actually this goes on to frame number 255.
Jun 29 12:02:17.77: [ 1920]: RECV received RCP frame
Jun 29 12:02:17.88: [ 1920]: --> [10:NO CARRIER]
Jun 29 12:02:17.88: [ 1920]: <-- [9:AT+FRH=3\r]
Jun 29 12:02:17.92: [ 1920]: --> [7:CONNECT]
Jun 29 12:02:19.16: [ 1920]: --> [2:OK]
Jun 29 12:02:19.16: [ 1920]: RECV recv PPS (partial page signal)
Jun 29 12:02:19.16: [ 1920]: RECV recv NULL (more blocks, same page)
Jun 29 12:02:19.16: [ 1920]: RECV received 256 frames of block 1 of page 1
Jun 29 12:02:19.36: [ 1920]: RECV: 65536 bytes of data, 0 total lines
Jun 29 12:02:19.36: [ 1920]: <-- [9:AT+FTH=3\r]
Jun 29 12:02:19.40: [ 1920]: --> [7:CONNECT]
Jun 29 12:02:19.40: [ 1920]: <-- data [3]
Jun 29 12:02:19.40: [ 1920]: <-- data [2]
Jun 29 12:02:20.60: [ 1920]: --> [2:OK]
Jun 29 12:02:20.60: [ 1920]: RECV send MCF (message confirmation)
Jun 29 12:02:20.60: [ 1920]: <-- [10:AT+FRM=96\r]
Jun 29 12:02:21.24: [ 1920]: --> [7:CONNECT]
Jun 29 12:02:23.17: [ 1920]: RECV received frame number 11 # And continues here with frame 1 again.
Jun 29 12:02:23.49: [ 1920]: RECV received frame number 12
Jun 29 12:02:23.81: [ 1920]: RECV received frame number 13
Jun 29 12:02:24.13: [ 1920]: RECV received frame number 14
Jun 29 12:03:42.34: [ 1920]: RECV assumed RCP frame with block end
Jun 29 12:03:42.34: [ 1920]: --> [10:NO CARRIER]
Jun 29 12:03:42.34: [ 1920]: <-- [9:AT+FRH=3\r]
Jun 29 12:03:42.39: [ 1920]: --> [7:CONNECT]
Jun 29 12:03:43.61: [ 1920]: --> [2:OK]
Jun 29 12:03:43.61: [ 1920]: RECV recv PPS (partial page signal)
Jun 29 12:03:43.61: [ 1920]: RECV recv EOP (no more pages or documents)
Jun 29 12:03:43.61: [ 1920]: RECV received 67 frames of block 3 of page 1
Jun 29 12:03:43.68: [ 1920]: RECV: 17036 bytes of data, 1125 total lines
Jun 29 12:03:43.69: [ 1920]: DELAY 70 ms
Jun 29 12:03:43.75: [ 1920]: <-- [9:AT+FTH=3\r]
Jun 29 12:03:43.80: [ 1920]: --> [7:CONNECT]
Jun 29 12:03:43.80: [ 1920]: <-- data [3]
Jun 29 12:03:43.80: [ 1920]: <-- data [2]
Jun 29 12:03:45.00: [ 1920]: --> [2:OK]
Jun 29 12:03:45.00: [ 1920]: RECV send MCF (message confirmation)
Jun 29 12:03:45.00: [ 1920]: <-- [9:AT+FRH=3\r]
Jun 29 12:03:45.00: [ 1920]: RECV FAX (000000031): from 555-555-5555, page 1 in 2:31, INF, 3.85 line/mm, 2-D MMR, 9600 bit/s
Jun 29 12:03:45.00: [ 1920]: RECV FAX (000000031): recvq/fax000000010.tif from 0534810022, route to <unspecified>, 1 pages in 2:38
Jun 29 12:03:45.05: [ 1920]: --> [7:CONNECT]
Jun 29 12:03:46.24: [ 1920]: --> [2:OK]
Jun 29 12:03:46.24: [ 1920]: RECV FAX: bin/faxrcvd "recvq/fax000000010.tif" "ttyS0" "000000031" "" "" ""
Jun 29 12:03:46.24: [ 1920]: RECV FAX: end
Jun 29 12:03:46.26: [ 1920]: SESSION END

In syslog I have this:

# tail /var/log/syslog

Jun 29 12:00:31 localhost HylaFAX[2063]: LIST status
Jun 29 12:00:31 localhost HylaFAX[2063]: <--- 150 Opening new data connection for "status".
Jun 29 12:00:31 localhost HylaFAX[2063]: <--- 226 Transfer complete.
Jun 29 12:00:48 localhost FaxQueuer[1910]: FIFO RECV "+ttyS0:B"
Jun 29 12:00:48 localhost FaxQueuer[1910]: MODEM ttyS0: BUSY
Jun 29 12:01:03 localhost FaxQueuer[1910]: FIFO RECV "+ttyS0:I000000031"
Jun 29 12:01:03 localhost FaxQueuer[1910]: MODEM ttyS0: COMID 000000031
Jun 29 12:01:07 localhost FaxGetty[1920]: ANSWER: FAX CONNECTION  DEVICE '/dev/ttyS0'
Jun 29 12:01:07 localhost FaxQueuer[1910]: FIFO RECV "@ttyS0:B"
Jun 29 12:01:14 localhost FaxQueuer[1910]: FIFO RECV "@ttyS0:S0,0,3ffe7f,recvq/fax000000010.tif,000000031,"","","","","","""
Jun 29 12:03:45 localhost FaxGetty[2072]: RECV FAX (000000031): from 555-555-5555, page 1 in 2:31, INF, 3.85 line/mm, 2-D MMR, 9600 bit/s
Jun 29 12:03:45 localhost FaxQueuer[1910]: FIFO RECV "@ttyS0:P97,1,21e018,recvq/fax000000010.tif,000000031,"555-555-5555","<UNSPECIFIED>","","","","""
Jun 29 12:03:45 localhost FaxQueuer[1910]: FIFO RECV "@ttyS0:D9e,1,21e018,recvq/fax000000010.tif,000000031,"555-555-5555","<UNSPECIFIED>","","","","""
Jun 29 12:03:45 localhost FaxGetty[2073]: RECV FAX (000000031): recvq/fax000000010.tif from 555-555-5555, route to <unspecified>, 1 pages in 2:38
Jun 29 12:03:46 localhost FaxGetty[1920]: RECV FAX: bin/faxrcvd "recvq/fax000000010.tif" "ttyS0" "000000031" "" "" ""
Jun 29 12:03:46 localhost FaxQueuer[1910]: FIFO RECV "@ttyS0:E"
Jun 29 12:03:46 localhost FaxQueuer[1910]: FIFO RECV "+ttyS0:I"
Jun 29 12:03:46 localhost FaxQueuer[1910]: MODEM ttyS0: COMID
Jun 29 12:03:56 localhost FaxGetty[1920]: MODEM MD56XX 57600/
Jun 29 12:03:56 localhost FaxQueuer[1910]: FIFO RECV "+ttyS0:RPcaf9c77f:ff"
Jun 29 12:03:56 localhost FaxQueuer[1910]: MODEM ttyS0: READY, capabilities Pcaf9c77f:ff
Jun 29 12:17:01 localhost /USR/SBIN/CRON[2098]: (root) CMD (   run-parts --report /etc/cron.hourly)

In /var/spool/hylafax/etc

# more FaxDispatch

case "$CIDNUMBER" in
1234) SENDTO=me@xxxxxxxxxxxx;FILETYPE=pdf;;
esac

What am I doing wrong - or rather, what did I miss out? Anybody got any idea?

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.6/33 - Release Date: 6/28/2005
 

____________________ 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*




Project hosted by iFAX Solutions