Thank you for reply.<br>Can I know which version of Asterisk and what supporting applications are you currently using.<br><br clear="all"><font face="Verdana, sans-serif"><font><font color="#000000">Best
Regards, <br><br>Mahesh Katta</font><br><font color="#ff9900"><b><br><br></b></font></font></font><br><div class="gmail_quote">On Thu, Jan 12, 2012 at 6:15 PM, Ruben Rögels <span dir="ltr"><<a href="mailto:ruben.roegels@jumping-frog.org">ruben.roegels@jumping-frog.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Am 12.01.2012 12:44, schrieb mahesh katta:<br>
<div><div class="h5">> Hi,<br>
><br>
> Any one give me about FAX in Asterisk.<br>
><br>
> PSTN====>FXO GATEWAY====>ASTERISK-1.4.27(OR)ASTERISK-1.8.X.X<br>
><br>
> whenever some one is Fax to PSTN its convert into pdf format....<br>
><br>
> Help me any links or pdf .. for setup this. ?<br>
><br>
><br>
> Best Regards,<br>
><br>
> Mahesh Katta<br>
</div></div>> **<br>
<br>
Hi Mahesh,<br>
<br>
this is my macro in asterisk to handle fax:<br>
<br>
[macro-faxin]<br>
; Faxe<br>
; ARG1 = eMail-Adresse<br>
exten => s,1,Verbose(${BOUNDARY} Eingehender Ruf von ${CALLERID(num)})<br>
exten => s,n,Verbose(${BOUNDARY} BCHANNELINFO ${BCHANNELINFO})<br>
; nur verarbeiten, wenn B-Kanal frei ist<br>
exten => s,n,GotoIf($[${BCHANNELINFO} = 2]?hangup:free)<br>
exten => s,n(free),NoOp()<br>
exten => s,n,Set(TO=${ARG1})<br>
exten => s,n,Set(EXT=${MACRO_EXTEN})<br>
exten => s,n,Verbose(1,${BOUNDARY} Eingehendes Fax ${CDR(uniqueid)})<br>
exten => s,n,Set(FAXFILE=/tmp/fax-${TO}-${CDR(uniqueid)}.tif)<br>
exten => s,n,Set(LOCALSTATIONID=jumping frog)<br>
exten => s,n,Answer()<br>
exten => s,n,Wait(3)<br>
exten => s,n,ReceiveFAX(${FAXFILE},d)<br>
<br>
<br>
This is an ugly work-around to handle fax properly becaus I can't catch<br>
the hang-up event by the macro itself:<br>
<br>
<br>
;fax oder kein fax, das ist hier die Frage...<br>
exten => h,1,Verbose(${BOUNDARY} ${EXT})<br>
exten => h,n,System(/usr/local/bin/fax2mail.sh ${FAXFILE} ${TO})<br>
<br>
And this is the bash script to convert tif to pdf and send it via email<br>
to my users:<br>
<br>
#!/bin/bash<br>
<br>
FAXFILE=$1<br>
RECIPIENT=$2<br>
SUBJECT="[Fax] Sie haben ein Fax erhalten"<br>
BODYSUCCESS=/usr/local/bin/bodysuccess.txt<br>
BODYFAILED=/usr/local/bin/bodyfailed.txt<br>
<br>
PDF=/tmp/fax-`date +"%s"`.pdf<br>
<br>
<br>
<br>
tiff2pdf $FAXFILE > $PDF<br>
<br>
# Konvertierung okay?<br>
if [ $? == 0 ]; then<br>
<br>
mutt -s "$SUBJECT" -a $PDF -- $RECIPIENT < $BODYSUCCESS<br>
<br>
# Hats geklappt?<br>
if [ $? == 0 ]; then<br>
<br>
exit 0<br>
<br>
else<br>
<br>
exit 1<br>
<br>
fi<br>
<br>
<br>
<br>
else<br>
<br>
<br>
mutt -s $RECIPIENT < $BODYFAILED<br>
<br>
exit 1<br>
fi<br>
<br>
<br>
I hope this helps!<br>
<br>
best regards,<br>
Ruben<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</font></span></blockquote></div><br>