PHP Bug can cause FreePBX Inbound Routes and Asterisk Phonebook entries to not work as expected


This is an edited version of a post that originally appeared on a blog called The Michigan Telephone Blog, which was written by a friend before he decided to stop blogging. It is reposted with his permission. Comments dated before the year 2013 were originally posted to his blog.

It appears there is a nasty bug in certain versions of PHP (almost certainly in version 5.3.3, and perhaps other versions as well) that can cause SOME inbound and outbound routes in FreePBX to be ignored.  Add this to the list of difficulties to plague some FreePBX users, but for once it’s not something the FreePBX developers did.

The symptom appears to be that you have an inbound route with a DID that starts with the number “2”, or an Asterisk Phonebook entry that starts with a “2”, but it doesn’t work as expected or gets changed to a negative number.  Not all patterns starting with “2” appear to be affected, but ten digit numbers in certain area codes (such as 248 here in Michigan) definitely are.  In the case of inbound routes, it appears that the numbers get stored in the MySQL database correctly, but when they get written out to extensions_additional.conf (the dialplan file that F—PBX generates for Asterisk to use) they get transformed into negative numbers.  Therefore, when a call comes in on that DID, Asterisk doesn’t recognize it and the call gets dropped (or if you accept calls for any DID then it’s handled as such a call, but a warning message is posted to the CLI and the log file).

For a discussion of this issue, see these threads in the PBX in a Flash forum:

Inbound DID routing (only catchall works)
(240) area code in Asterisk Phonebook

Just wanted to alert you to this in case you happen to have the buggy PHP version and things just aren’t working as they should be. The best fix is probably to upgrade PHP to a later version but that can cause other issues, or you may encounter unmet dependencies when trying to upgrade (in fact, if you come across a foolproof way to upgrade PHP on Centos, please let us know). If you are using PBX in a Flash, they’re aware of the issue and one would hope they’ll have a fix real soon now. If you are using any other FreePBX-based distro then you will have to bug the distributors of that distro for a fix. If you rolled your own, then good luck to you in upgrading PHP!

2 thoughts on “PHP Bug can cause FreePBX Inbound Routes and Asterisk Phonebook entries to not work as expected

  1. Remi famillecollet has a repository with newer versions of MySQL and PHP among others. He seems to do a pretty good job. He develops and FusionInventory.

  2. NOTICE: All comments above this one were imported from the original Michigan Telephone Blog and may or may not be relevant to the edited article above.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

Recent Comments




GiottoPress by Enrique Chavez