[asterisk-users] Problem with ReceiveFAX app from FFA

Bryant Zimmerman BryantZ at zktech.com
Tue Jun 21 08:33:43 CDT 2011



----------------------------------------
 From: "khalid touati" <khalidtouati at gmail.com>
Sent: Tuesday, June 21, 2011 9:12 AM
To: "Asterisk Users Mailing List - Non-Commercial Discussion" 
<asterisk-users at lists.digium.com>
Subject: Re: [asterisk-users] Problem with ReceiveFAX app from FFA

Ok, for the variables, I can retrieve some of them like the caller number 
and so on (I would assume that all the variables that last for duration of 
call are there), but I still think that I sould not use the h extension to 
continue after ReceiveFAX use, it's like not a lot of people use FFA, 
moreover very few came accross such an issue which is fine.

 
----------------------------------------

Here is a receivefax example. Note this is not a complete example just a 
snip. You have to use the "h" extension if you really want to make it all 
work. Don't fight it just do it. This is a standard process very similar to 
how you need to handle returns from "Dial" comands.  

f/F option is a special patch written by Kevin @ digium and will not be in 
the distro unitl 10.x
FAX-MASTER_CHK-FAILED(${CALLERID(number)) FAX-MASTER_DO-FAILED()  are 
database storage macro that stores and get's failed fax attempts so I can 
force a roll back. Store the fax vars in a database on success and fail. 
This lets me notify the user for either case.  

[fax_inbound_efax]
exten => PFax,1,Set(SIP_CODEC=ulaw)
exten => PFax,n,Set(l_faxoptions=f)
exten => 
PFax,n,Set(l_faxhasfailed=${FAX-MASTER_CHK-FAILED(${CALLERID(number)},${p_Ca
llSrcTrunk})})
exten => PFax,n,GotoIf($[${l_faxhasfailed}>0]?audioonly:tryt38)
exten => PFax,n(audioonly),Set(l_faxoptions=F)
exten => PFax,n(tryt38),Answer()
exten => PFax,n,Wait(2)
exten => PFax,n,Set(l_faxFile_Base=${STRFTIME(,,%Y%m%d-%H%M)}_${RAND(1)})
exten => PFax,n,Set(l_faxFile_Path=/var/spool/fax_in/)
exten => PFax,n,Set(l_faxFile_FullName=fax_${l_faxFile_Base}.tiff)
exten => PFax,n,Set(l_faxFile=${l_faxFile_Path}${l_faxFile_FullName})
exten => PFax,n,ReceiveFAX(${l_faxFile},${l_faxoptions}) 

exten => h,1,NoOp(Do Fax Hangup)
exten => h,n,Goto(Do-${FAXOPT(status)},1) 

exten => Do-SUCCESS,1,NoOp(Fax Success)
exten => Do-SUCCESS,n,Goto(Do-Store,1)
exten => Do-SUCCESS,n,NoOp(Return from System) 

exten => Do-FAILED,1,NoOp(Fax Failed)
exten => 
Do-FAILED,n,GotoIf($[${l_faxoptions}=f]?DoLogFallback:DoNoFallback)
exten => 
Do-FAILED,n(DoLogFallback),Set(FAX-MASTER_DO-FAILED()=${CALLERID(number)},${
p_CallSrcTrunk})
exten => Do-FAILED,n(DoNoFallback),Goto(Do-Store,1) 

exten => Do-Store,1,NoOp(Store Fax Data)
exten => Do-Store,n,GotoIf($["${FAXOPT(rate)}"=""]?DoRate0:DoRate)
exten => Do-Store,n(DoRate0),Set(l_storeRate=0)
exten => Do-Store,n,Goto(DoDisplay)
exten => Do-Store,n(DoRate),Set(l_storeRate=${FAXOPT(rate)})
exten => Do-Store,n(DoDisplay),NoOp(DT = ${STRFTIME(,,%Y-%m-%d %H:%M:%S)})
exten => Do-Store,n,NoOp(Fax Base = ${l_faxFile_Base})
exten => Do-Store,n,NoOp(Switch ID = ${gbl_switchid})
exten => Do-Store,n,NoOp(Account Code = ${gbl_actnumber})
exten => Do-Store,n,NoOp(Line Code  = ${gbl_actlineid})
exten => Do-Store,n,NoOp(Caller ID Num = ${CALLERID(number)})
exten => Do-Store,n,NoOp(Caller ID Name = ${CALLERID(name)})
exten => Do-Store,n,NoOp(File Path = ${l_faxFile_Path})
exten => Do-Store,n,NoOp(File Name = ${l_faxFile_FullName})
exten => Do-Store,n,NoOp(opt emc = ${FAXOPT(ecm)})
exten => Do-Store,n,NoOp(opt filename = ${FAXOPT(filename)})
exten => Do-Store,n,NoOp(opt localstationid = ${FAXOPT(localstationid)})
exten => Do-Store,n,NoOp(opt headerinfo = ${FAXOPT(headerinfo)})
exten => Do-Store,n,NoOp(opt remotestationid = ${FAXOPT(remotestationid)})
exten => Do-Store,n,NoOp(opt maxrate = ${FAXOPT(maxrate)})
exten => Do-Store,n,NoOp(opt minrate = ${FAXOPT(minrate)})
exten => Do-Store,n,NoOp(opt rate = ${l_storeRate})
exten => Do-Store,n,NoOp(opt pages = ${FAXOPT(pages)})
exten => Do-Store,n,NoOp(opt resolution = ${FAXOPT(resolution)})
exten => Do-Store,n,NoOp(opt error = ${FAXOPT(error)})
exten => Do-Store,n,NoOp(opt status = ${FAXOPT(status)})
exten => Do-Store,n,NoOp(opt statusstr = ${FAXOPT(statusstr)})
exten => Do-Store,n,"Run some kind of macro or storage/email script here" 
Good luck

Bryant
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110621/aea47ffe/attachment.htm>


More information about the asterisk-users mailing list