Asterisk 15/16 Crashing with CentOS 7 new install

So I recently installed CentOS 7 on my Lenovo Flex 11 laptop/tablet and Asterisk continually crashed with the res_odbc module loading.

Come to find out the issue may be common for most who have upgraded MySQL to MariaDB in my case I have version 10. So the error is the incompatible mysql-connector-odbc

Solved by removing mysql-connector-odbc (yum -y remove mysql-connector-odbc) and downloading the correct driver from http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64//mysql-connector-odbc-8.0.15-1.el7.x86_64.rpm
and editing the odbcinst.ini file as follows:

[MySQL ODBC 8.0 Unicode Driver]
Driver=/usr/lib64/libmyodbc8w.so
UsageCount=1

[MySQL ODBC 8.0 ANSI Driver]
Driver=/usr/lib64/libmyodbc8a.so
UsageCount=1

Hope this helps you guys a lot this is my first post of many more! Will be posting a complete install guide for CentOS 7 with Asterisk 16, FreePBX 15 AvanatFax Hylafax and IAXModem solution!

1 Like

Interested in this bit. So much really old information is out there, but nothing recent.

I’ve actually got it working but Avantfax does not support PHP 7 so right now I’m trying to get PHP 5.6 compiled from source to work with PHP7 but the jist of it is as follows

#Install IAXModem 1.3.0
cd …
wget https://downloads.sourceforge.net/project/iaxmodem/iaxmodem/iaxmodem-1.3.0.tar.gz
tar zxf iaxmodem-1.3.0.tar.gz
cd iaxmodem-1.3.0
./configure --libdir=/usr/lib64
./build static
mkdir -p /etc/iaxmodem
mkdir -p /var/log/iaxmodem
cp iaxmodem /usr/local/sbin/

nano /etc/iaxmodem/ttyIAX1

device /dev/ttyIAX1
owner uucp:uucp
mode 660
port 4570
refresh 300
server 127.0.0.1
peername 1234
secret secret
codec ulaw
cidname Fax Server
cidnumber 5555551212
nojitterbuffer

#Install Hylafax
cd …
wget ftp://ftp.hylafax.org/source/hylafax-6.0.7.tar.gz
tar zxf hylafax-6.0.7.tar.gz
cd hylafax-6.0.7
./configure

make
make install
faxsetup
mysql_upgrade -p

nano /var/spool/hylafax/etc/config.ttyIAX1

CountryCode: 1
AreaCode: 555
FAXNumber: 1.555.555.1212
LongDistancePrefix: 1
InternationalPrefix: 011
DialStringRules: “etc/dialrules”
ServerTracing: 1
SessionTracing: 1
RecvFileMode: 0600
LogFileMode: 0600
DeviceMode: 0600
RingsBeforeAnswer: 1
SpeakerVolume: off
GettyArgs: “-h %l dx_%s”
LocalIdentifier: “Fax Server”
TagLineFont: etc/lutRS18.pcf
TagLineFormat: “From %%l|%c|Page %%P of %%T”
MaxRecvPages: 200
JobReqNoCarrier: 180
JobReqNoAnswer: 180
FaxRcvdCmd: bin/faxrcvd.php
DynamicConfig: bin/dynconf.php
NotifyCmd: bin/notify.php
ModemType: Class1 # use this to supply a hint
ModemResetCmds: “ATH1\nAT+VCID=1” # enables CallID display
ModemReadyCmds: ATH0
Class1AdaptRecvCmd: AT+FAR=1
Class1TMConnectDelay: 400 # counteract quick CONNECT response
Class1RMQueryCmd: “!24,48,72,96” # V.17 fast-train recv doesn’t work well
Class1TMQueryCmd: “!24,48,72,96” # V.17 fast-train recv doesn’t work well
CallIDPattern: “NMBR=”
CallIDPattern: “NAME=”
CallIDPattern: “ANID=”
CallIDPattern: “NDID=”

#Edit HylaFAX Verticle Resolution
nano /usr/local/lib/fax/hyla.conf

JobFmt: “%-5j %1a %15o %-15.15e %5P %5D %5i %7z %.25s”
RcvFmt: “%7o %-10t %-25s %-20f %5p %1z %-40e”
PageSize: na-let
VRes: 196

#ASTERISK MANAGER/DB PASSWORD
faxadduser -a admin [asterisk admin password] from manager.conf
faxdeluser localhost
faxdeluser 127.0.0.1
echo 127.0.0.1 >> /var/spool/hylafax/etc/hosts.hfaxd

cd /usr/lib/systemd/system

nano iaxmodem.service

[Unit]
Description=IAXModem for /dev/ttyIAX1

[Service]
Type=simple
Restart=always
RestartSec=30
ExecStart=/usr/local/sbin/iaxmodem ttyIAX1

[Install]
WantedBy=multi-user.target

nano faxgetty.service

[Unit]
Description=Faxgetty for /dev/ttyIAX1

[Service]
Type=simple
Restart=always
RestartSec=30
ExecStart=/usr/sbin/faxgetty ttyIAX1

[Install]
WantedBy=multi-user.target

nano hfaxd.service

[Unit]
Description=Hylafax hfaxd

[Service]
Type=forking
ExecStart=/usr/local/sbin/hfaxd -i hylafax

[Install]
WantedBy=multi-user.target

nano faxq.service

[Unit]
Description=faxq

[Service]
Type=forking
ExecStart=/usr/local/sbin/faxq

[Install]
WantedBy=multi-user.target

systemctl enable iaxmodem
systemctl enable faxgetty
systemctl enable hfaxd
systemctl enable faxq
systemctl start iaxmodem
systemctl start faxgetty
systemctl start hfaxd
systemctl start faxq

Hope this helps!

1 Like

Actually Avantfax gets grumpy with anything above 5.2 ( or perhaps better said, php > 5.2 gets grumpy with Avantfax :wink: )

https://www.forbespropertygroup.com/blog/avantfax-333-fax-server-php-53-fix-after-update-from-php-52.html

Will get you closer (5.4) but 5.6 will still get lots of ‘deprecated’ warnings

Thank you for the heads up looks like 5.2 it is just trying to figure out how to make it co-exist with 7.2 and either do a fastcgi or compile as fpm and single it out in a directory to run 5.2 alone. Research is in order. Developers, developers, developers, developers! Developers, developers, developers, developers! Developers, developers, developers, developers! Yeahhh!

Developers for Avantfax ? I don’t think so David Mimms is no longer developing it.

You can get older versions of php 5 from

https://museum.php.net/php5/

And all versions will peacefully coexist.

You will however need to override in your webserver to use whatever php in your /var/www/html/avantfax ( or wherever you installed it) directory

OK so perhaps I’m not see the full picture here. Here’s what I see so far:

Asterisk 16 - This is LTS, so good.
FreePBX 15 - This is still BETA so it’s not production ready
Avantifax - A project that hasn’t been touched in 3 years at least
IAXModem - A project that hasn’t been touched in 3 years at least.

There is talk of using PHP7 yet FreePBX is still on PHP5.6 at best but the Avantifax requires something less than 5.6 to run itself properly. There is also talk of installing PHP5.2 and trying to make it play nice with PHP7.2, that’s just not going to happen.

Can FreePBX 15 work with PHP7.2? Yes but you’re going to have to deal with fixing the code as things pop up. I’m not sure how far they got with PHP7 so far but the changes to countable objects in 7.2+ make old checks throw errors. Things like if (count($arr) >0) { } will throw errors/warnings if the $arr is empty or $arr is not a countable object/array. Plus if by 5.6 is was a deprecated function, it’s gone in PHP7.x.

Just keep in mind that FreePBX uses ZendGuard right now to encode their commercial modules and ZendGuard has ZERO PHP7 support they are not moving to PHP7 which means a new encoder is needed for FreePBX to use PHP7. Since v15 still supports commercial modules in the same way as v14 it’s safe to say it’s still on PHP5.6.

So in order to run the AvantFax you would either need to modify that code to bring it up to PHP5.6 so it can run on PHP with FreePBX or you’ll need to have two installations of Apache/PHP to support both PHP5.6 and PHP5.2. FreePBX isn’t going to work properly on PHP5.2 as even v13 was PHP5.3 and between 5.3 and 5.6 things got deprecated.

While on paper this may look conceptually sound in practice it’s going to be a bunch of bubble gum and duct tape holding together out-dated applications/software with current software. Plus until FreePBX v15 is anywhere near ready for production, it’s on a non-production ready core application.

This bit (PHP5.6, not the commercial modules) is why I’m looking hard at VitalPBX. It is not open source, but it is still uses Asterisk. Which I have spent much time learning over the years.

There is no way that a modern product should have such an ancient dependency.

I know it is expensive to update code, that is why I have never complained about the recurring costs of EPM, or something like Zulu. I spent enough years as a programmer to understand how that works. But if you are going to be a software company, you need to plan those costs into the business model.

1 Like

I agree with you on this. This is one of the serious flaws of FreePBX, too much old and out dated dependencies and settings. Not only is PHP out of date, Apache is still on 2.4.6 which is from 2013. SIX YEARS OF ZERO UPDATES! Not that Apache isn’t important or the key service for running your web GUI based application. There are numbers CVE’s that have been reported and fixed by Apache including new ones that have DDoS fixes. So basically the version of Apache with FreePBX is opened every which from Sunday to getting you pwned.

I mean the Macro() function was deprecated in Asterisk 16, it’s no-load now. It’s been in deprecated status for years (I mean a lot of years) and almost everything in FreePBX is dependent of Macro()'s, very few GoSub()'s comparatively.

So in addition to the Apache/PHP being out dated, so the GUI interfacing/management but the dialplan in FreePBX is also out dated in Asterisk terms due to the amount of deprecated functions/settings it has in it. Perhaps when v15 is stable that will all be addressed, however, it’s been almost 12 months since the announcement of v15 and we’re still waiting.

So I can see why you are looking at alternatives.

Oh and imagine the poor souls still stuck on v13 for HA support. That release hasn’t seen love or barely anything from the system level in years.

Shouldn’t Fanboys be more proactive than just bitching ?

Well I guess they could be more proactive. In what way shall they be more proactive? Go through and clean up all the code to bring it up to standards for PHP7.x? Could but then all the commercial modules still would need to be done. Fanboys don’t have access to that. Get it up to a current version of Apache in the distro? Fanboys can’t do that either.

This isn’t 2005 and FreePBX isn’t being developed and supported by a handful of guys living off nothing, banging out code and contributions had real weight in the life/death of the project. FreePBX has full time and paid developers working on it now. What is being discussed is beyond that of volunteer contributors. The entire thing needs to be addressed as it just has been years of things being piled on top of each other, development wise.

There’s also the fact that the project is a PITA to contribute in some ways. There’s almost no developer documents, nothing that lays out the different class, functions or methods that you can hook into or call on. It’s a lot of digging and guessing because the code itself is poorly documented and has no real standards to it. One function will be commented and formatted perfectly and the next function has zero comments and someone smashed it all together in one line with no breaks or spacing.

A project of this size with outside contributors should have some rules, guidelines and some standards of how the code show be done, documented and handled. You shouldn’t be able to tell that numerous developers touch Page.class.php (for example) because all the code should be commented and formatted the same, not that five different people with five different versions of coding and methods wrote it because nothing follows any logic.

And there is nothing wrong of being critical of a project of this size with its resources to be on versions of things that are highly out of date, unsupported and leaves your system open with vulnerabilities that can get it pwned. I guess if you want to label that as bitching, then I guess we’re bitching.

Exactly, but its not “they” that needs to be more proactive, it is you :slight_smile: (it is hard to identify as yet any tentative ‘they’ )

FreePBX as an opensource project works fine, the simple act of adding sysadmin from that point on limits , you have been blinded from many operations that should be completely in your control as an admin and all pretty trivial IMHO

What does it add for you?
Their way-back concept of IDS was just Fail2ban which was not at the time acknowledged.

The attempt to sell you HA for about 3K was a un-verifiable sneaky reuse of so many recipes using opensource drbd and corosync/heartbeat, some of which I wrote.

Ultimately, unless you are a propeller head (which I am) then any two node HA is going to kill you when it split-brains and that WILL happen, a simple addition of a tiny third node providing quora does work, but nowadays, with evolving cloud stuff , recovery is a one minute api call away, so why bother?

This thread was about Avantfax, nice as it is it was written for php 5.2, it can be cleaned up to 5.4, 5.6 needs a mbd2/mysqli rewrite, that’s just not going to happen. so you can partition your webserver directory to use an appropriate php version as appropriate.

The efforts that FreePBX made so far is partially successful on php 7.1 but fails on php 7.3 (current), it is happy at 5.6 though @lgaetz has identified many patches and offered them with tiny to zero results,all the devs are gone so let the fanboys standup and be counted

JM2CWAE

Absolutely it was. In fact my original post to this thread was about that very subject of cross PHP versions and the fact you would need multiple instances of Apache in order to support both FreePBX and AvantiFax. I just was agreeing and responding to @sorvani’s post about the dependencies being out of date.

If that is collective use of “you” (as in community members), sure. If it was meant as me personally, not so much. I barely use FreePBX myself, I don’t sell PBX systems, I spend more time supporting people who install it themselves. The few FreePBX systems I do have are so customized that they really only use the Backup and Firewall modules. Everything else is done outside of FreePBX because as is it doesn’t meet my needs.

Not multiple instances of Apache, multiple instances of php and the proper use particularly of php-fpm. But if you barely use FreePBX, then it is all probably moot.

Whoa I like the response but lets calm down lol. So what I’ve come up for as a solution is to do this which im about to do in a moment, Re-install CentOS 7 minimal. Remove php initially and source install apache 2.4.41 and php 5.6.40 then install freepbx and avantfax on top. It does work with 5.6 I have it on another server. I just messed up along the way installing packages via yum which caused things to get a little jumbled say the least. Its time consuming but I will update you on my progress. This should work. I did try the fcgi method, it was a bust and the fastcgi as well.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.