Nedi,

Without any error logs or a description of what doesn't work, it is hard to 
help. Possibly log /mnt/kd/email_in_FAX14.sh errors to a file, for testing edit:
--
- background&
+ background 2>/tmp/email_in_FAX14-error.log &
--

Possible problem, are you creating the "/tmp/usb/fax14/" directory beforehand ? 
 Not sure if ReceiveFAX() would create the directory tree (doubt it).  This 
would do it:
--
mkdir -p /tmp/usb/fax14
--

Also the background() function seems to run forever, I don't see how it ever 
exits.

Lonnie


On Sep 1, 2016, at 4:41 PM, Nedi <n...@gmx.ch> wrote:

> Hi 
> I use newest Astlinux-1.2.6.1 - Asterisk 1.8.32.3  and Runix  on my alix 
> board .
> Since some time i noticed Fax recive don’t work anymore. I nothing changend 
> since 2 years, I only made some astlinux update.
> what can I doo to fix this.
> 
> in my extensions.conf  i have this:
> 
> exten =>14,1,System(/mnt/kd/email_in_FAX14.sh "${CALLERID(name)}" 
> "${CALLERID(num)}")
> exten =>14,n,Gosub(fax14-rx,s,1)
> exten =>14,n,Hangup()
> 
> [fax14-rx]
> exten = s,1,NoOp(Receive FAX)
> exten = 
> s,n,Set(FAXFILE=/tmp/usb/fax14/fax~${CALLERID(NUM)}~n...@gmx.ch~${FILTER(0123456789,${UNIQUEID})})
> exten = s,n,Set(LOCALHEADERINFO=My Name)
> exten = s,n,Set(LOCALSTATIONID=My Name)
> exten = s,n,ReceiveFAX(${FAXFILE}.tiff)  ;Asterisk 1.8
> exten = s,n,Log(NOTICE,New FAX: ${FAXPAGES} page(s) from 
> ${CALLERID(NUM)}(${REMOTESTATIONID}) to ${CALLERID(dnid)})
> exten = s,n,Hangup()
> exten = s,n,Return()
> 
> to convert fax to pdf and send I use this script:
> #!/bin/bash
> #
> background () {
>   while true;
>     do
>     for f in /tmp/usb/fax14/*.tiff
>     do
>       if [ -f $f ]
>       then
>         fuser -s $f
>         if [ $? -ne 0 ]
>         then
>           tiff2pdf -o "${f%\.*}".pdf "$f"
>           mv -f "$f" /tmp/usb/fax14/lastFaxBackup14
>          fi
>       fi
>     done
>     for f in /tmp/usb/fax14/*.pdf
>     do
>       if [ -f $f ]
>       then
>         cidemail="${f%~*}"
>         cidemail="${cidemail#*~}"
>         email="${cidemail#*~}"
>         cid="${cidemail%~*}"
>         shortf="${f##*~}"
>         mv -f "$f" "/tmp/usb/fax14/fax-$shortf"
>         echo "Subject: New FAX from $cid
> From: n...@gmx.ch
> To: $email" | \
> mime-pack "New FAX received from $cid" "/tmp/usb/fax14/fax-$shortf" 
> "application/pdf" | \
> sendmail -t
>         rm -f "/tmp/usb/fax14/fax-$shortf"
>       fi
>     done    
>     sleep 30
>   done
> }
> background&
> echo $! > /tmp/usb/fax14/check_fax14.pid
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Astlinux-users mailing list
> Astlinux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/astlinux-users
> 
> Donations to support AstLinux are graciously accepted via PayPal to 
> pay...@krisk.org.


------------------------------------------------------------------------------
_______________________________________________
Astlinux-users mailing list
Astlinux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to 
pay...@krisk.org.

Reply via email to