[asterisk-users] Dialplan checkup

Gordon Henderson gordon+asterisk at drogon.net
Sat Feb 10 02:00:36 MST 2007


On Fri, 9 Feb 2007, Barry Fawthrop wrote:

> Hi All
>
> Curious will this work
> Std. PSTN line  ---x------ X100p
>                  |
>                  ------ Fax Machine

> Question is how does asterisk detect the call without answering?
> I'm not wanting Asterisk to handle the call if it is a fax if possible???

As other replys have indicated, it's probably not possible, but have you 
considered using spandsp & rxfax and have asterisk take the fax and email 
it to you?

Crude (but currently working) example here:

FaxFile=/var/tmp/fax
FaxDestinationEmail=kevin at somewhere.com,ken at womewhere.com

office=Zap/4            ; Analogue phone on the TDM400 card.
kevin=IAX2/kevin        ; Kevins laptop
ken=IAX2/ken&SIP/ken    ; Kens laptop
officePhones=${office}&${kevin}&${ken}

[incoming]

exten => s,1,Noop(PSTN CALL from ${CALLERIDNUM})
exten => s,n,Goto(internal,incoming,1)

[internal]

exten => incoming,1,Set(DB(100/lnd)=${CALLERIDNUM})
exten => incoming,n,Answer()
exten => incoming,n,Wait(3)
exten => incoming,n(enter),BackGround(if-u-know-ext-dial)
exten => incoming,n,BackGround(or)
exten => incoming,n,BackGround(pls-hold-while-try)
exten => incoming,n,WaitExten(10)
exten => incoming,n,Ringing()
exten => incoming,n,Dial(${officePhones},15,on)
exten => incoming,n,VoiceMail(100&101&102,us)
exten => incoming,n,Hangup()

exten => fax,1,Set(LOCALSTATIONID=My Fax Machine)
exten => fax,n,RxFax(${FaxFile}.tif)
exten => fax,n,System(/bin/echo ${REMOTESTATIONID} > ${FaxFile}.csid)
exten => fax,n,System(/bin/echo ${CALLERIDNUM}     > ${FaxFile}.cidn)
exten => fax,n,System(/usr/bin/tiff2pdf ${FaxFile}.tif > ${FaxFile}.pdf)
exten => fax,n,System(/usr/bin/mpack -s "FAX From [${REMOTESTATIONID}:${CALLERIDNUM}]" ${FaxFile}.pdf ${FaxDestinationEmail})
exten => fax,n,Hangup()

exten => i,1,Wait(1)
exten => i,n,Playback(pbx-invalid)
exten => i,n,Goto(internal,incoming,enter)

exten => t,1,Hangup()

-- 
Gordon



More information about the asterisk-users mailing list