SEGFault on FAX Receive - Scary Bug but I am not sure what is causing it

Ok - As always, this will be a slightly long post with a question at the end.

I use Elastix as a base, but of course they are not up to the Asterisk version that I want to use - 10.6.1 so I am improvising - here is what I am using:

Asterisk 10.6.1
Dahdi 2.6.1
LibPRI 1.4.12
SpanDSP 0.0.6pre20

All of these are compiled from source and then installed.

So here is the hangup - From a Cold-Boot - “shutdown now -r” - when the box comes back up, DAHDI, Asterisk and everything else load just fine - but the first time (and everytime) you try to receive a FAX, you get a Segfault and a quick reload…


If you do an “amportal stop” and then an “amportal start” then it receives faxes just fine.

Just tested this with Asterisk 10.7 and it’s the same thing.

Here is the work-around I came up with:



This script will be executed after all the other init scripts.

You can put your own initialization stuff in here if you don’t

want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
/usr/local/sbin/ > /etc/motd
/usr/sbin/fxotune -s
/usr/sbin/amportal start
/usr/sbin/amportal stop
/usr/sbin/amportal start

I don’t know if the wait is necessary, but I was being cautious - this is completely reproducible - fully patched Elastix with Asterisk 10.6.1/10.7 installed over top and it happens every time the machine reboots.

Has anyone else seen this? The hack on rc.local works, but it seems kludgy.


Unfortunately, Elastix does not distribute a legitimate FreePBX, so no-one can really help you here. (amportal is a wrapper around FreePBX)

Sorry, but I suggest you will have to go to them for help.

Good Luck

p.s. I’ll bet a dollar to a donut thought that something somewhere in the

Asterisk 10.6.1
Dahdi 2.6.1
LibPRI 1.4.12
SpanDSP 0.0.6pre20

bit blew it up (This not elastix, so can’t blame them.)


service dahdi reload
service asterisk restart

in rc.local
compile order is usually better spandsp,(libpr,)dahdi,asterisk. Or your ./congure scripts might well get confused

Elastix uses a wrapped FreePBX in it’s default config, but I always upgrade the FreePBX to the current standard 2.10 and that is what I am using.

As far as problems with the compiling, if that were the case, it would crash every time I tried to fax - it’s only on a fresh startup and until an amportal stop and an amportal start is done.

Could very well be something that is left over from Elastix that is unhappy, but the fact that an amportal stop and then start removes the problem completely tends to push me away from Elastix as the cause…

I am going to try it this weekend with a couple other distro’s and see if I can duplicate the problem.