[asterisk-users] FAX Installation in Asterisk

mahesh katta maheshkatta at flexydial.com
Thu Jan 12 06:57:27 CST 2012


Thank you for reply.
Can I know which version of Asterisk and what supporting applications are
you currently using.

Best Regards,

Mahesh Katta
*

*
On Thu, Jan 12, 2012 at 6:15 PM, Ruben Rögels <
ruben.roegels at jumping-frog.org> wrote:

> Am 12.01.2012 12:44, schrieb mahesh katta:
> > Hi,
> >
> > Any one give me about FAX in Asterisk.
> >
> > PSTN====>FXO GATEWAY====>ASTERISK-1.4.27(OR)ASTERISK-1.8.X.X
> >
> > whenever some one is Fax to PSTN its convert into pdf format....
> >
> > Help me any links or pdf .. for setup this. ?
> >
> >
> > Best Regards,
> >
> > Mahesh Katta
> > **
>
> Hi Mahesh,
>
> this is my macro in asterisk to handle fax:
>
> [macro-faxin]
> ; Faxe
> ; ARG1 = eMail-Adresse
> exten => s,1,Verbose(${BOUNDARY} Eingehender Ruf von ${CALLERID(num)})
> exten => s,n,Verbose(${BOUNDARY} BCHANNELINFO ${BCHANNELINFO})
> ; nur verarbeiten, wenn B-Kanal frei ist
> exten => s,n,GotoIf($[${BCHANNELINFO} = 2]?hangup:free)
> exten => s,n(free),NoOp()
> exten => s,n,Set(TO=${ARG1})
> exten => s,n,Set(EXT=${MACRO_EXTEN})
> exten => s,n,Verbose(1,${BOUNDARY} Eingehendes Fax ${CDR(uniqueid)})
> exten => s,n,Set(FAXFILE=/tmp/fax-${TO}-${CDR(uniqueid)}.tif)
> exten => s,n,Set(LOCALSTATIONID=jumping frog)
> exten => s,n,Answer()
> exten => s,n,Wait(3)
> exten => s,n,ReceiveFAX(${FAXFILE},d)
>
>
> This is an ugly work-around to handle fax properly becaus I can't catch
> the hang-up event by the macro itself:
>
>
> ;fax oder kein fax, das ist hier die Frage...
> exten => h,1,Verbose(${BOUNDARY} ${EXT})
> exten => h,n,System(/usr/local/bin/fax2mail.sh ${FAXFILE} ${TO})
>
> And this is the bash script to convert tif to pdf and send it via email
> to my users:
>
> #!/bin/bash
>
> FAXFILE=$1
> RECIPIENT=$2
> SUBJECT="[Fax] Sie haben ein Fax erhalten"
> BODYSUCCESS=/usr/local/bin/bodysuccess.txt
> BODYFAILED=/usr/local/bin/bodyfailed.txt
>
> PDF=/tmp/fax-`date +"%s"`.pdf
>
>
>
> tiff2pdf $FAXFILE > $PDF
>
> # Konvertierung okay?
> if [ $? == 0 ]; then
>
>        mutt -s "$SUBJECT" -a $PDF -- $RECIPIENT < $BODYSUCCESS
>
>        # Hats geklappt?
>        if [ $? == 0 ]; then
>
>                exit 0
>
>        else
>
>                exit 1
>
>        fi
>
>
>
> else
>
>
>        mutt -s $RECIPIENT < $BODYFAILED
>
>        exit 1
> fi
>
>
> I hope this helps!
>
> best regards,
> Ruben
>
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>               http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120112/e8521339/attachment.htm>


More information about the asterisk-users mailing list