<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2627" name=GENERATOR>
<STYLE>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=312253606-14072005><FONT face=Arial
color=#0000ff size=2>I may be a little late on this, but what permissions are on
/usr/local/sbin/mailfax?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=312253606-14072005><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=312253606-14072005><FONT face=Arial
color=#0000ff size=2>I have a similar set up to execute a mysql query to grab
the email address based on DNIS (PRI T1 with multiple numbers on one circuit)
and then email the fax to the destination. I set the perm to 755 on the script
so everyone/thing can execute.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=312253606-14072005><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=312253606-14072005><FONT face=Arial
color=#0000ff size=2>Also, what are the perms on
/var/spool/asterisk/asterisk-fax?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=312253606-14072005><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=312253606-14072005><FONT face=Arial
color=#0000ff size=2>Can you run the script from the command line by passing it
the appropriate values (i.e. /usr/local/sbin/mailfax
/var/spool/asterisk/asterisk-fax/#########.#.tiff <A
href="mailto:me@mycompany.com">me@mycompany.com</A>?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=312253606-14072005><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=312253606-14072005><FONT face=Arial
color=#0000ff size=2>In the event that something weird is going on with the
command line parameters, here are some considerations:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=312253606-14072005><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<UL dir=ltr>
<LI>
<DIV align=left><SPAN class=312253606-14072005><FONT face=Arial color=#0000ff
size=2>If the folder for the TIFFs is always the same, you could do a Set (or
SetVar depending on your Asterisk build) to have the UNIQUEID passed only to
the script</FONT></SPAN></DIV></LI>
<LI>
<DIV align=left><SPAN class=312253606-14072005><FONT face=Arial color=#0000ff
size=2>If the email reciepients are always on the same domain, you need to
only pass the name portion of the email address</FONT></SPAN></DIV></LI></UL>
<DIV dir=ltr align=left><SPAN class=312253606-14072005><FONT face=Arial
color=#0000ff size=2>For example:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=312253606-14072005><FONT face=Arial size=2>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT color=#0000ff>Extensions.conf
section ---<o:p></o:p></FONT></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
color=#0000ff>[fax]<o:p></o:p></FONT></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT color=#0000ff>exten =>
s,1,Answer<o:p></o:p></FONT></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT color=#0000ff>exten =>
s,2,Macro(faxreceive)<o:p></o:p></FONT></SPAN></FONT></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
color=#0000ff><SPAN class=312253606-14072005>;</SPAN>exten =>
h,1,system(/usr/local/sbin/mailfax ${FAXFILE} ${EMAILADDR})<SPAN
class=312253606-14072005> <<
This line could go away</SPAN></FONT></SPAN></P>
<P class=MsoNormal><FONT face=Arial color=#0000ff size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=#0000ff size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">[macro-faxreceive]</SPAN></FONT></P>
<P class=MsoNormal><FONT color=#0000ff><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p><SPAN
class=312253606-14072005>exten =>
s,1,Set(FAX_OUT=${UNIQUEID})</SPAN></o:p></SPAN></FONT></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
color=#0000ff>exten => s,<SPAN
class=312253606-14072005>2</SPAN>,Set(FAXFILE=/var/spool/asterisk/asterisk-fax/${<SPAN
class=312253606-14072005>FAX_OUT</SPAN>}.tif)<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal><FONT color=#0000ff><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">exten => s,<SPAN
class=312253606-14072005>3</SPAN>,rxfax(${FAXFILE})</SPAN></FONT></P>
<P class=MsoNormal><FONT color=#0000ff><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p><SPAN
class=312253606-14072005>exten => s,4,system(/usr/local/sbin/mailfax
${FOX_OUT} MyName)</SPAN></o:p></SPAN></FONT></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
color=#0000ff><SPAN class=312253606-14072005>;</SPAN>exten =>
s,3,Set(EMAILADDR=yyyy@zzzzzzzzz.com)<SPAN
class=312253606-14072005> <<
This line could go away</SPAN></FONT></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
color=#0000ff><SPAN class=312253606-14072005></SPAN></FONT></SPAN> </P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
color=#0000ff><SPAN class=312253606-14072005>Assuming #!/bin/bash
;)</SPAN></FONT></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
color=#0000ff><SPAN class=312253606-14072005></SPAN></FONT></SPAN> </P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
color=#0000ff><SPAN
class=312253606-14072005>#!/bin/bash</SPAN></FONT></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
color=#0000ff><SPAN class=312253606-14072005></SPAN></FONT></SPAN> </P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
color=#0000ff><SPAN class=312253606-14072005># $ARG1 is the
TIFF file name</SPAN></FONT></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
color=#0000ff><SPAN class=312253606-14072005># $ARG2 is the
name of the domain email user</SPAN></FONT></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
color=#0000ff><SPAN class=312253606-14072005></SPAN></FONT></SPAN> </P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
color=#0000ff><SPAN
class=312253606-14072005>EMAIL_ADDR=$2"@mycompany.com"</SPAN></FONT></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
color=#0000ff><SPAN
class=312253606-14072005>FAX_FILE="/var/spool/asterisk/asterisk-fax/"$1</SPAN></FONT></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
color=#0000ff><SPAN class=312253606-14072005></SPAN></FONT></SPAN> </P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
color=#0000ff><SPAN class=312253606-14072005># Do the sendmail
thing here</SPAN></FONT></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
color=#0000ff><SPAN class=312253606-14072005></SPAN></FONT></SPAN> </P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
color=#0000ff><SPAN
class=312253606-14072005>#--------------------------------------------------------------------------</SPAN></FONT></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
color=#0000ff><SPAN class=312253606-14072005></SPAN></FONT></SPAN> </P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
color=#0000ff><SPAN class=312253606-14072005>Just my 40
cents.</SPAN></FONT></SPAN></P></FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] <B>On Behalf Of </B>Rob
Danz<BR><B>Sent:</B> Wednesday, July 13, 2005 8:18 AM<BR><B>To:</B>
asterisk-users@lists.digium.com<BR><B>Subject:</B> [Asterisk-Users] SpanDSP
rxfax, no tiff.<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hello,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Let me start by saying I have
checked the wiki and the archives and did find some relative information.
I tried the suggestions in those threads, but still have the same
problem.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I’m using the CVS Asterisk from July
11, 2005.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Redhat
FC2<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">SpanDSP
0.0.2pre18<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Libtiff
3.5.7<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Digium PCI card 1 FXO,
1FXS.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have a single POTS line coming,
but I have 2 numbers and am using distinctive ring detection in
*.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">When you call my “fax” number, the
ring detection does work, and does send it to the fax context
correctly.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The debugs show the call is
answered, rxfax is invoked and it is trying to write to the fax file.
After the sending party hangs up, it tries to execute a script that will
ultimately mail me the fax file. But since the tiff file isn’t there to
begin with, that fails. The permissions on that folder are 777 for now… so
permissions aren’t the problem. <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I saw a post by Steve Underwood from
last year on a similar problem, but it was looking like timing slips on the
T1/E1 for that user … I’m just using a POTS line though. I’ve also done
ztmonitor to look at the Rx and Tx levels. Rx is a little hotter than Tx,
but they’re both well on the right hand side of the scale.
<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Any help is appreciated.
Debugs & extensions.conf excerpt are below.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thanks,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Rob<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Debug output
---<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Jul 13 10:04:34 NOTICE[7975]:
chan_zap.c:5759 ss_thread: Got event 2
(Ring/Answered)...<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> -- Detected ring
pattern: 93,0,0<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> -- Distinctive
Ring matched context fax<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> -- Executing
Answer("Zap/4-1", "") in new stack<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> -- Executing
Macro("Zap/4-1", "faxreceive") in new stack<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> -- Executing
Set("Zap/4-1", "FAXFILE=/var/spool/asterisk/asterisk-fax/1121267067.12.tif") in
new stack<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> -- Executing
RxFAX("Zap/4-1", "/var/spool/asterisk/asterisk-fax/1121267067.12.tif") in new
stack<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> -- Executing
System("Zap/4-1", "/usr/local/sbin/mailfax
/var/spool/asterisk/asterisk-fax/1121267067.12.tif ") in new
stack<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Jul 13 10:05:03 WARNING[7975]:
app_system.c:75 system_exec_helper: Unable to execute '/usr/local/sbin/mailfax
/var/spool/asterisk/asterisk-fax/1121267067.12.tif
'<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> -- Hungup
'Zap/4-1'<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Extensions.conf section
---<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">[fax]<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">exten =>
s,1,Answer<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">exten =>
s,2,Macro(faxreceive)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">exten =>
h,1,system(/usr/local/sbin/mailfax ${FAXFILE}
${EMAILADDR})<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">[macro-faxreceive]<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">exten =>
s,1,Set(FAXFILE=/var/spool/asterisk/asterisk-fax/${UNIQUEID}.tif)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">exten =>
s,2,rxfax(${FAXFILE})<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">exten =>
s,3,Set(EMAILADDR=yyyy@zzzzzzzzz.com)<o:p></o:p></SPAN></FONT></P></DIV></BODY></HTML>