# asterisk -rexten => 5611,1,Answer()
ubuntu*CLI> core show applications like FAX
-= Matching Asterisk Applications =-
ReceiveFAX: Receive a Fax
SendFAX: Send a Fax
-= 2 Applications Matching =-
# apt-get update
# apt-get upgrade
# apt-get install libtiff-tools sharutils mailutils
exten => 5611,n,Wait(3)
exten => 5611,n,SET(FAX="/tmp/fax-${STRFTIME()}.tiff")
exten => 5611,n,ReceiveFAX(${FAX})
exten => 5611,n,System( tiff2pdf -p a4 -z ${FAX} | uuencode - | mail -s "FAX" faxuser && rm -f ${FAX} )
UPDATE: еще пример:
; FAX exten => 199,1,Answer() exten => 199,n,Wait(3) exten => 199,n,SET(FAX="FAX_${STRFTIME(${EPOCH},,%Y%m%d_%H%M)}_${CDR(uniqueid)}") exten => 199,n,ReceiveFAX(/tmp/${FAX}.tiff) exten => 199,n,System( tiff2pdf -o /media/${FAX}.pdf /media/${FAX}.tiff ) exten => 199,n,System( cat /media/${FAX}.pdf | uuencode ${FAX}.pdf | mail -s "FAX from ${REMOTESTATIONID}" faxuser ) exten => 199,n,System( test -s /media/${FAX}.pdf && rm /media/${FAX}.tiff ) exten => 199,n,NoOp(### FAXSTATUS: ${FAXSTATUS}) exten => 199,n,NoOp(### FAXERROR: ${FAXERROR}) exten => 199,n,NoOp(### FAXMODE: ${FAXMODE}) exten => 199,n,NoOp(### FAXPAGES: ${FAXPAGES}) exten => 199,n,NoOp(### FAXBITRATE: ${FAXBITRATE}) exten => 199,n,NoOp(### FAXRESOLUTION: ${FAXRESOLUTION}) exten => 199,n,Hangup
Комментариев нет:
Отправить комментарий