Anyone having else having issues with enum script?

I have not modified the stock version. I have submitted as bug and would like to know if anyone else is having issues.

ENUM Lookup runs but does not perform function correctly. I have confirmed lookup information is valid with email list. FreePBX All updated exccept for version to Beta. (if bug is confirmed as fixed in Beta I will upgrade to beta)

I have a dial pattern matching on the enum trunk 1+NXXXXXXXXX

When the number 555-555-1212 is dialed (replaced my number for this post not for test) it matches the pattern but returns result of 0 even though it does exists. I also checked to make sure the uri was valid in with sip uri dialing.

My only guess is either the lookups are not working at all or it is looking up the number before the outgoing string is adjusted,



– Executing [[email protected]:6] Set(“SIP/200-a02ad9e0”,
“DIAL_NUMBER=5555551212”) in new stack
– Executing [[email protected]:7] Set(“SIP/200-a02ad9e0”,
“DIAL_TRUNK=7”) in new stack
– Executing [[email protected]:8] ExecIf(“SIP/200-a02ad9e0”,
“1|AGI|fixlocalprefix”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/fixlocalprefix
== fixlocalprefix: Dialpattern 1+NXXXXXXXXX matched. 5555551212 ->
– AGI Script fixlocalprefix completed, returning 0
– Executing [[email protected]:9] AGI(“SIP/200-a02ad9e0”,
“enumlookup.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/enumlookup.agi
– AGI Script enumlookup.agi completed, returning 0
– Executing [[email protected]ut-enum:10] GotoIf(“SIP/200-a02ad9e0”,
“1?end”) in new stack
– Goto (macro-dialout-enum,s,18)
– Executing [[email protected]:18] NoOp(“SIP/200-a02ad9e0”,
“Exiting macro-dialout-enum”) in new stack
– Executing [[email protected]:6]
Macro(“SIP/200-a02ad9e0”, “dialout-trunk|8|5555551212||”) in new stack

Type agi debug on in an asterisk CLI, do your call and post the result.
There have been some work on enumlookup.agi for 2.6, but I haven’t tested it as I don’t use ENUM (yet)

Hi there I copied the output per your requirment to which will expire in 60 days from this posting.

I dialed the 10 digit number for the station. The alias of the station has 11 digits. I use enum lookup since multiple aliases are not supported. (or information is not given on how to use multiple aliases)

Thank you

I’m using this agi instead that is using the settings that you have in your enum.conf and can exclude some gateways you don’t like (ie some non functional toll free)

Its too bad with all these technical workings that no intelligence is built into the system. It would be nice if the system had an option to alert or remove bad performing gateways (which the toll free gateways are known for) I usually use wither Vitelity or Voicepulse for free toll free termination.

kieranmullen3, there was no agi debug info in the pastebin. Try to set set debug 5 and set verbose 5 together with agi debug on and put it on pastebin.

Sorry I hope this is more useful. It is interesting things are being destroyed.

And of course, I made a mistake, the command for agi debug is agi debug not agi debug on.

Try with agi debug and dial again, paste the output to pastebin.

Sorry for that.

AGI Debugging Enabled

And we have a winner

AGI Rx << Fatal error:
Call to a member function get_variable() on a non-object in /var/lib/asterisk/agi-bin/enumlookup.agi on line 152

Looks like your enumlookup.agi is broken or there is another error in there somewhere.

What version of FreePBX are you running? I see that you mention above, is that the version you are using?

yes I am running

Line 152 = XXX

// helper functions
function get_var( $agi, $value)
XXX $r = $agi->get_variable( $value );

    if ($r['result'] == 1)
            $result = $r['data'];
            return $result;
    else return '';


What distro are you using?
What version of php (php -version in a shell)?

[email protected] [~]# cat /etc/redhat-release
CentOS release 4.8 (Final)
[email protected] [~]#
[email protected] [~]# php -v
PHP 5.2.8 (cli) (built: Feb 5 2009 22:01:06)
Copyright © 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright © 1998-2008 Zend Technologies
with the ionCube PHP Loader v3.1.34, Copyright © 2002-2009, by ionCube Ltd., and
with Zend Extension Manager v1.2.2, Copyright © 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.3, Copyright © 1998-2007, by Zend Technologies
[email protected] [~]#


It worked for me, after I did the following 2 modifications to the following file:


Modification 1:

At the beginnen of function get_enum_providers(), add the following line

162: function get_enum_providers() {
163: global $AGI; // <— add this line
165: // parse enum.conf config file
166: $localprefix_file = get_var($AGI, “ASTETCDIR”)."/enum.conf";
167: if (file_exists($localprefix_file)) {

Modification 2:

At the end of function get_enum_providers() nothing is returned
So at line 190, add a “return statement”

188: } // else, this isn’t the section we want
189: } // else, no config for this section
190: return $enums; // <— add this line
193:function parse_conf($filename, &$conf, &$section) {

… hope this helps.

Regards, George