AVANTFAX is a MUST!!!!

ramoncio

Joined
May 12, 2010
Messages
1,663
Likes
0
Points
0
#21
Something has gone wrong again with my avantfax test machine!!!

I did a fresh Elastix install, then configured the network and run my script. Then rebooted.
Everything was fine.
Avanfax was working ok, after configuring the iaxmodem.

But then after a yum -y update I got again the blank page...

I can see in /var/log/httpd/ssl_error_log:

[Fri Jan 18 21:48:20 2008] [error] [client 192.168.160.30] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'ampuser.php' (include_path='.:/usr/share/pear') in /var/www/html/avantfax/includes/classes.php on line 21

But in my first test machine avantfax is working fine after yum -y update!!

This is very weird.
 

saleh

Joined
Apr 18, 2007
Messages
249
Likes
0
Points
0
#22
to fix it:

$ cd /var/www/html/avantfax/includes
$ touch ampuser.php
$ chown asterisk:asterisk ampuser.php

the solution is not elegant, but it works
 

ramoncio

Joined
May 12, 2010
Messages
1,663
Likes
0
Points
0
#23
Yes!!!
It works!!!
Very simple and precise.

The strange thing is that I have 2 test machines working without doing this. There is no ampuser.php in them, but Avantfax works ok.

You are the man!!!

Thanks a lot

PS: I'll include these lines in my installation script<br><br>Post edited by: ramoncio, at: 2008/01/20 00:41
 

ramoncio

Joined
May 12, 2010
Messages
1,663
Likes
0
Points
0
#24
I'm having all kinds of troubles with Avantfax 3.0.5. I can't see the queues, iaxmodem doesn't work well.
I think I'll try my older scripts and older versions.
 

ramoncio

Joined
May 12, 2010
Messages
1,663
Likes
0
Points
0
#25
Here is my last modified script for installing Avantfax 3.0.5 in Elastix.
I have included the installation of ocr support with tesseract. You have to manually enable it in /var/www/html/avantfax/includes/config.php. And you can select the language for ocr in the same file.

Code:
yum install -y php-pear php-mysql php-mbstring netpbm-progs php-pecl-Fileinfo ImageMagick-devel libungif libpng sudo libtiff ghostscript ghostscript-fonts ImageMagick expect
pear channel-update pear.php.net
pear upgrade-all
pear install db MDB2 Mail Net_SMTP Mail_mime MDB2_driver_mysql
cd /usr/src
wget http://dfn.dl.sourceforge.net/sourceforge/avantfax/avantfax-3.0.5.tgz
tar xfvz avantfax-3.0.5.tgz
cd avantfax-3.0.5
chown -R asterisk:asterisk avantfax
chmod 0770 avantfax/includes/templates/admin_theme/templates_c/ avantfax/includes/templates/admin_theme/cache/  avantfax/includes/templates/main_theme/templates_c/ avantfax/includes/templates/main_theme/cache/
chown asterisk:asterisk avantfax/includes/templates/admin_theme/templates_c/ avantfax/includes/templates/admin_theme/cache/  avantfax/includes/templates/main_theme/templates_c/ avantfax/includes/templates/main_theme/cache/
chmod 0755 avantfax/includes/faxcover.php avantfax/includes/faxrcvd.php avantfax/includes/notify.php avantfax/tools/update_contacts.php avantfax/tools/faxcover.php avantfax/includes/avantfaxcron.php
mv avantfax /var/www/html
# Create mysql avantfax user and databse
# mysql --user=root --password=eLaStIx.2oo7 -e "GRANT ALL ON avantfax TO avantfax@localhost IDENTIFIED BY \"d58fe49\"" mysql
# mysqladmin --default-character-set=utf8 --user=avantfax --password=d58fe49 create avantfax
mysql -uroot -peLaStIx.2oo7 < create_user.sql
mysql -uavantfax -pd58fe49 avantfax < create_tables.sql
mysqlshow --user=avantfax --password=d58fe49 avantfax
# Copy default configuration
cd /var/www/html/avantfax/includes/
cp -a local_config-example.php local_config.php
chmod -R 777 /var/www/html/avantfax/tmp
chmod -R 777 /var/www/html/avantfax/faxes
cd /var/spool/hylafax/bin
mv faxrcvd faxrcvd.old
mv notify notify.old
ln -s /var/www/html/avantfax/includes/faxrcvd.php /var/spool/hylafax/bin/faxrcvd.php
ln -s /var/www/html/avantfax/includes/notify.php /var/spool/hylafax/bin/notify.php
mv /usr/bin/faxcover /usr/bin/faxcover.old
ln -s /var/www/html/avantfax/includes/faxcover.php /usr/bin/faxcover
/usr/sbin/faxadduser -a pwd asterisk
/usr/sbin/faxdeluser localhost
/usr/sbin/faxdeluser 127.0.0.1
echo 127.0.0.1 >> /var/spool/hylafax/etc/hosts.hfaxd
echo 'JobFmt: "%-3j %3i %1a %15o %40M %-12.12e %5P %5D %7z %.25s"' >> /etc/hylafax/hyla.conf
echo "Disabling SELinux for Apache"
setsebool -P httpd_disable_trans 1
cat > /etc/httpd/conf.d/avantfax.conf << EOF
NameVirtualHost *:80
<VirtualHost *:80>
    DocumentRoot /var/www/html/avantfax/
    ServerName avantfax
</VirtualHost>
EOF
ln -s /usr/share/file/magic* /usr/share/misc/
# SETUP SUDO PERMISSIONS
echo "Setting up sudo"
cat /etc/sudoers | grep -v requiretty > /tmp/sudoers
echo "asterisk ALL= NOPASSWD: /sbin/reboot, /sbin/halt, /usr/sbin/faxdeluser, /usr/sbin/faxadduser -u * -p * *" >> /tmp/sudoers
mv /etc/sudoers /etc/sudoers.orig
mv /tmp/sudoers /etc/sudoers
chmod 0440 /etc/sudoers
# CONFIGURE MODEMS TO USE AVANTFAX
for i in `ls /var/spool/hylafax/etc/config.tty*`; do
if [ ! -L $i ]; then
cat >> $i << EOF
#
## AvantFAX
#
FaxrcvdCmd:     bin/faxrcvd.php
EOF
fi
done
cat >>  /var/spool/hylafax/etc/config << EOF
#
## AvantFAX
#
NotifyCmd:      bin/notify.php
EOF
# ADD MODEMS TO INITTAB
cat >> /etc/inittab << EOF
#
## AvantFAX
#
EOF
# CREATE AN INITTAB ENTRY FOR EACH CONFIGURED MODEM
cnt=0
for i in `ls /var/spool/hylafax/etc/config.tty*`; do
if [ -f $i ]; then
modem=`echo $i | awk -F'/' '{print $6}' | awk -F'.' '{print $2}'`
let "cnt++"
# ADD MODEMS TO AVANTFAX DATABASE
mysql --user=avantfax --password=d58fe49 -e "INSERT INTO Modems SET device='$modem', alias ='$modem'" avantfax
echo "Configuring $modem for AvantFAX"
fi
done
cat > /etc/hylafax/faxmail.conf << EOF 
AutoCoverPage: false
TextPointSize: 12pt
Headers: Message-id Date Subject From
MailUser: faxmail
EOF
# ADD CRONTAB ENTRIES
echo "Setting up crontab"
mkdir /tmp
crontab -l > /tmp/tab
echo -e "0 * * * *\t/var/www/html/avantfax/includes/phb.php" >> /tmp/tab
echo -e "0 0 * * *\t/var/www/html/avantfax/includes/avantfaxcron.php -t 2" >> /tmp/tab
crontab /tmp/tab
rm -f /tmp/tab
# Thanks to Saleh for this solution to the blank page
cd /var/www/html/avantfax/includes
touch ampuser.php 
chown asterisk:asterisk ampuser.php
cd
# Restart services
service httpd restart
service iaxmodem restart
service hylafax restart
amportal restart
# Import existing faxes
cd /var/spool/hylafax; for i in `ls recvq/*`; do bin/faxrcvd.php $i ttyIAX1; done
cd /var/spool/hylafax; for i in `ls doneq/q*`; do bin/notify.php $i done :30; done
# Install OCR support
cd /usr/src
wget http://tesseract-ocr.googlecode.com/files/tesseract-2.01.tar.gz
tar xfvz tesseract-2.01.tar.gz
cd tesseract-2.01
./configure && make 
wget http://tesseract-ocr.googlecode.com/files/tesseract-2.00.spa.tar.gz
wget http://tesseract-ocr.googlecode.com/files/tesseract-2.00.eng.tar.gz
tar xfvz tesseract-2.00.spa.tar.gz
tar xfvz tesseract-2.00.eng.tar.gz
make install
mv /var/www/html/avantfax/includes/local_config.php /var/www/html/avantfax/includes/local_config.php.backup
sed "s/'ENABLE_OCR_SUPPORT', false/'ENABLE_OCR_SUPPORT', true/g" /var/www/html/avantfax/includes/local_config.php.backup > /var/www/html/avantfax/includes/local_config.php
rm -rf /var/www/html/avantfax/includes/local_config.php.backup

#mv /var/www/html/avantfax/includes/local_config.php /var/www/html/avantfax/includes/local_config.php.backup2
#sed "s/'OCR_LANGUAGE', "eng"/'OCR_LANGUAGE', "spa"/g" /var/www/html/avantfax/includes/local_config.php.backup2 > /var/www/html/avantfax/includes/local_config.php
#rm -rf /var/www/html/avantfax/includes/local_config.php.backup2

cd /var/www/html/avantfax/tools
./ocr_import.php

echo "********************************************************************************"
echo "*"
echo "*"
echo "*"
echo "* Now you can go to https://yourserver/avantfax/admin  and login with:"
echo "* username: admin"
echo "* password: password"
echo "* and configure users for AVANTFAX"
echo "*"
echo "* Then go to https://yourserver/avantfax/"
echo "* and login with one of the users you just created."
echo "*"
echo "* Good web faxing!!"
echo "*"
echo "*"
echo "*"
echo "*******************************************************************************"
 

gabriel

Joined
Jun 9, 2007
Messages
31
Likes
0
Points
0
#26
I tried the script and here are the errors that I got :))

Disabling SELinux for Apache
setsebool: SELinux is disabled.
ls: /var/spool/hylafax/etc/config.tty*: No such file or directory
ls: /var/spool/hylafax/etc/config.tty*: No such file or directory
ls: recvq/*: No such file or directory
ls: doneq/q*: No such file or directory

can you post the fixed script including the last version ?

Thank you
Gabriel
 

ramoncio

Joined
May 12, 2010
Messages
1,663
Likes
0
Points
0
#27
Sorry Gabriel I did not see your post till now.
The problem is that you must create the hylafax modems before running the script. You can add the modems in the Fax label from main Elastix gui.
Then you have to create a IAX2 extension with same user/pass as the fax created before.

I have done a new script to install Avantfax 3.0.9.
I have used it in 3 machines and it works great. It also installs tesseract for ocr support.

Here it is:

# Download and extract the program to /usr/src/
cd /usr/src
wget http://garr.dl.sourceforge.net/sourcefo ... -3.0.9.tgz
tar xfvz avantfax-3.0.9.tgz
cd avantfax-3.0.9
# Change preferences to work with Elastix
mv rh-prefs.txt rh-prefs.txt.backup
echo "FAXDOMAIN=fax.mydomain.com" >> rh-prefs.txt
echo "INSTDIR=/var/www/html/avantfax" >> rh-prefs.txt
echo "HYLADIR=/usr" >> rh-prefs.txt
echo "SPOOL=/var/spool/hylafax" >> rh-prefs.txt
echo "USER=avantfax" >> rh-prefs.txt
echo "PASS=d58fe49" >> rh-prefs.txt
echo "DB=avantfax" >> rh-prefs.txt
echo "ROOTMYSQLPWD=eLaStIx.2oo7" >> rh-prefs.txt
echo "HTTPDUSER=asterisk" >> rh-prefs.txt
echo "HTTPDGROUP=asterisk" >> rh-prefs.txt
# Run the installation scripts
chmod +x rh-install.sh
./rh-install.sh
chmod +x setup-postfix.sh
./setup-postfix.sh
# Import existing faxes
cd /var/spool/hylafax; for i in `ls recvq/*`; do bin/faxrcvd.php $i ttyIAX1; done
cd /var/spool/hylafax; for i in `ls doneq/q*`; do bin/notify.php $i done :30; done
# Install OCR support
cd /usr/src
wget http://tesseract-ocr.googlecode.com/fil ... .01.tar.gz
tar xfvz tesseract-2.01.tar.gz
cd tesseract-2.01
./configure && make
wget http://tesseract-ocr.googlecode.com/fil ... spa.tar.gz
wget http://tesseract-ocr.googlecode.com/fil ... eng.tar.gz
tar xfvz tesseract-2.00.spa.tar.gz
tar xfvz tesseract-2.00.eng.tar.gz
make install
mv /var/www/html/avantfax/includes/local_config.php /var/www/html/avantfax/includes/local_config.php.backup
sed "s/'ENABLE_OCR_SUPPORT', false/'ENABLE_OCR_SUPPORT', true/g" /var/www/html/avantfax/includes/local_config.php.backup > /var/www/html/avantfax/includes/local_config.php
rm -rf /var/www/html/avantfax/includes/local_config.php.backup
# Run ocr_import to OCR existing faxes
cd /var/www/html/avantfax/tools
./ocr_import.php
echo "********************************************************************************"
echo "*"
echo "*"
echo "*"
echo "* Now you can go to https://yourserver/avantfax/admin and login with:"
echo "* username: admin"
echo "* password: password"
echo "* and configure users for AVANTFAX"
echo "*"
echo "* Then go to https://yourserver/avantfax/"
echo "* and login with one of the users you just created."
echo "* Have a look at the config in /var/www/html/avantfax/includes/local_config.php"
echo "* Good web faxing!!"
echo "*"
echo "*"
echo "*"
echo "*******************************************************************************"
 

gabriel

Joined
Jun 9, 2007
Messages
31
Likes
0
Points
0
#28
ramoncio tnx buddy :) can you send me an email at missnebun@gmail.com with your private email. I want to work with you in some stuff :)

I tried to create a fax on elastix but I got error

Validation Error
The following fields contain errors:
Secret (IAX),


ohh well. I am not a fax fun but I will love to see this working :)


Gabe
 

DaveD

Joined
Nov 12, 2007
Messages
597
Likes
0
Points
16
#29
ramoncio

Thankyou for your latest install script it works great
 

ramoncio

Joined
May 12, 2010
Messages
1,663
Likes
0
Points
0
#30
Your wellcome.
Rememeber that you must create the fax iax extension and the virtual fax (iaxmodem) before running the script.
Now I'm working on a script to easily install a drbd+heartbeat high availability cluster.<br><br>Post edited by: ramoncio, at: 2008/03/18 19:44
 

Usuarioforum

Joined
Nov 15, 2007
Messages
93
Likes
0
Points
0
#31
Hi Ramoncio:

It works for me too in 0.9. Great job.

Do you think that it will work in 1.0?

Are elastix team talking with you to include avantfax in elastix? I don't undertand why avantfax is not included in elastix...

Cheers.
 

DaveD

Joined
Nov 12, 2007
Messages
597
Likes
0
Points
16
#32
Yes it is working the same in version 1.0 just used same script to install
 

ramoncio

Joined
May 12, 2010
Messages
1,663
Likes
0
Points
0
#33
Edgar told me that they are planning to release a rpm with Avantfax.
This is great news!
 

zenny

Joined
Jan 20, 2008
Messages
65
Likes
0
Points
0
#34
This news gave me a huge smile on my face! :laugh:

But I am not understanding why elastix consumes so much of memory (84+% of 1GB from the very first install?

top - 12:34:19 up 19:56, 1 user, load average: 0.12, 0.14, 0.16
Tasks: 107 total, 1 running, 97 sleeping, 0 stopped, 9 zombie
Cpu(s): 0.2%us, 0.0%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1027064k total, 1011024k used, 16040k free, 152012k buffers
Swap: 2097136k total, 0k used, 2097136k free, 708864k cached
 

odigan

Joined
Mar 27, 2008
Messages
4
Likes
0
Points
0
#35
Hi,

For what I understand, Linux will use all the memory available and release some when it's needed.

Contrary to Win..., Linux makes much better use of the memory.

FWW
 

techieg

Joined
Oct 8, 2007
Messages
81
Likes
0
Points
0
#36
odigan said:
Hi,
For what I understand, Linux will use all the memory available and release some when it's needed.
FWW
If linux is supposed to release the memory, I guess its not doing so well enough. This is known to crash linux systems, not an Elastix issue. Several people here including myself have had our systems crashing due to memory hogging even when there are no calls on the system. IMHO, unnecessary memory hogging is not the best solution. On weekends when there is nothing happening on the systems it has crashed and rebooted, hopefully this does not happen on important conference calls. This needs to be fixed so that linux systems do not hog beyond half the memory size unnecessarily until a process actually needs it and when done release it again.<br><br>Post edited by: techieg, at: 2008/04/03 01:28
 

DaveD

Joined
Nov 12, 2007
Messages
597
Likes
0
Points
16
#37
I just use a work around to release the memory till those issues get sorted

Make sure you have webmin installed and create a cron job
echo 3 > /proc/sys/vm/drop_caches

Mine runs every hour and keeps my memory usage around 23%
 

zenny

Joined
Jan 20, 2008
Messages
65
Likes
0
Points
0
#38
Can't this be achieved like this without webmin?

#crontab -e
then add the following line:

0 * * * * w echo 3 > /proc/sys/vm/drop_caches / >> /dev/null 2>&1
then press :wq (semicolon + w + q) and enter.<br><br>Post edited by: zenny, at: 2008/04/05 17:37
 

saleh

Joined
Apr 18, 2007
Messages
249
Likes
0
Points
0
#39

bulgarion

Joined
Feb 22, 2008
Messages
38
Likes
0
Points
0
#40
The ramoncio's script for installing Avantfax works for the latest 3.1.0 release too.
Does anybody know how to attach other documents than usual PS/PDF/TIFFs, like DOC or XLS? It should be just a matter of frontend, since hylafax manages correctly this kind of files.
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,942
Messages
130,964
Members
17,638
Latest member
washingtongomez
Top