How can i use both scripts<br><br><br><div class="gmail_quote">On Mon, Apr 5, 2010 at 4:55 PM, Tiago Geada <span dir="ltr"><<a href="mailto:tiago.geada@gmail.com">tiago.geada@gmail.com</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;">
Hi João.<div><br></div><div>We made up a script that sends received faxes trough a smtp server as an attachment.</div><div><br></div><div>the FAX.ael</div><div><br></div><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
<blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">context FAX</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
{</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> s => {</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
Answer();</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> Set(TIMEOUT(absolute)=600); // 10 min</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
Wait(3);</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> if("${CALLERID(num)}"="") { //</blockquote>
<blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> Set(Number=withhold); // If number is private</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
} //</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> else {</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
Set(Number=${CALLERID(num)}); // If number is NOT private</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> }</blockquote>
<blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> Set(recordFile=${UNIQUEID}_${Number}.tiff); // Record file to RAM first,</blockquote>
<blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> Set(recordPath=/var/log/asterisk/fax/${CALLERID(dnid)}/${STRFTIME(${EPOCH},GMT+0,%F)}); // then run /usr/local/bin/mailfax $1 $2</blockquote>
<blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> ReceiveFax(/ramdrive/${recordFile});</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
Wait(5);</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> Hangup();</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
};</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> h => {</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> System(/usr/local/bin/faxmail "${recordPath}" "${recordFile}");</blockquote>
<blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> };</blockquote><div>}</div></blockquote><div><br></div><div><br></div>and the script @ /usr/local/bin/faxmail has got something like:<div>
<br></div><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"><br><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">#!/bin/sh</blockquote>
<blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">PATH=/usr/sbin:/sbin:/bin:/usr/bin:/usr/local/bin</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
<br></blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">if [ -d "$1" ]; then</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
<span style="white-space: pre;">        </span>mv "/ramdrive/$2" "$1";</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"><span style="white-space: pre;">        </span>chmod a+rx "$1/$2";</blockquote>
<blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">else</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"><span style="white-space: pre;">        </span>mkdir -p "$1";</blockquote>
<blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"><span style="white-space: pre;">        </span>mv "/ramdrive/$2" "$1";</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
<span style="white-space: pre;">        </span>chmod a+rx "$1/$2";</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">fi</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
<br></blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">#chmod a+rx "/ramdrive/$2";</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
<br></blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">{</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
(</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> sleep 1</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
echo "ehlo <a href="http://tretas.eu" target="_blank">tretas.eu</a>"</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> sleep 1</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
echo "AUTH LOGIN"</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> sleep 0</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
echo -n "<a href="mailto:asterisk@tretas.eu" target="_blank">asterisk@tretas.eu</a>"|base64</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> sleep 0</blockquote>
<blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo -n "tretas"|base64</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
echo "MAIL FROM: <<a href="mailto:asterisk@tretas.eu" target="_blank">asterisk@tretas.eu</a>>"</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> sleep 0</blockquote>
<blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo "RCPT TO: <<a href="mailto:tiago.geada@gmail.com" target="_blank">tiago.geada@gmail.com</a>>"</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
echo "RCPT TO: <<a href="mailto:fax@tretas.eu" target="_blank">fax@tretas.eu</a>>"</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> sleep 1</blockquote>
<blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo "data"</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
<br></blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo "Subject: FAX $2"</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
echo "FROM: <<a href="mailto:asterisk@tretas.eu" target="_blank">asterisk@tretas.eu</a>>"</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo "TO: <<a href="mailto:fax@tretas.eu" target="_blank">fax@tretas.eu</a>>"</blockquote>
<blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> sleep 1</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
echo 'Content-Type: multipart/mixed; boundary=Y3VzY28udHJldGFzLmV1'</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo ""</blockquote>
<blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"><br></blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo "--Y3VzY28udHJldGFzLmV1"</blockquote>
<blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo 'Content-Type: multipart/alternative; boundary="Y3VzY28udHJldGFzLmV2"'</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
echo ""</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"><br></blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
echo "--Y3VzY28udHJldGFzLmV2"</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo 'Content-Type: text/plain; charset="ISO-8859-1"'</blockquote>
<blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo ""</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
<br></blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo "Fax em $(date)"</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
echo "$1/$2"</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo ""</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
<br></blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo "--Y3VzY28udHJldGFzLmV2"</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
echo 'Content-Type: text/html; charset="ISO-8859-1"'</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo ""</blockquote>
<blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo "Fax em $(date)<br>$1/$2"</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
echo ""</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"><br></blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
echo "--Y3VzY28udHJldGFzLmV2--"</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo "--Y3VzY28udHJldGFzLmV1"</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
echo 'Content-Type: image/tiff; name="fax.tiff"'</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo 'Content-Disposition: attachment; filename="fax.tiff"'</blockquote>
<blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo "Content-Transfer-Encoding: base64"</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
echo "X-Attachment-Id: 0.1"</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo ""</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
sleep 1;</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"><br></blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
cat "$1/$2"|base64</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> sleep 1;</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
<br></blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo "--Y3VzY28udHJldGFzLmV1--"</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
<br></blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> echo "."</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
# echo "quit"</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;"> ) | telnet <a href="http://smtp.tretas.eu" target="_blank">smtp.tretas.eu</a> 25</blockquote><blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none; padding: 0px;">
}</blockquote><div><br></div></blockquote>Boa sorte!<div><div></div><div class="h5"><div><br></div><div><br><div><div><div><div class="gmail_quote">On 30 March 2010 16:29, Joao Gomes Pereira <span dir="ltr"><<a href="mailto:gomespereira@startel.pt" target="_blank">gomespereira@startel.pt</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;">Hello<br>
Im trying to configure Fax2Mail in my Asterisk 1.4.23.1 server, wich<br>
receievs the Faxes through a SIP trunk.<br>
I found a lot of solutions in <a href="http://voip-info.org" target="_blank">voip-info.org</a><br>
So, I would like to know what's the best free Fax2Mail solution and if I<br>
really need to install Dahdi or Zaptel.<br>
Thanks<br>
Regards<br>
Joao Pereira<br>
<br>
--<br>
StarTel - A Rede Livre<br>
Joao Gomes Pereira<br>
<a href="http://www.startel.pt" target="_blank">www.startel.pt</a><br>
+351 304500650<br>
sip: <a href="mailto:gomespereira@startel.pt" target="_blank">gomespereira@startel.pt</a><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>
</blockquote></div><br></div></div></div></div>
</div></div><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></blockquote></div><br>