Caller ID Lookup stopped working with FreePBX 2.6.0.0

Hi,

after the last upgrade to 2.6-release (including the upgrade of all modules) the “Caller ID Lookup”-modules stopped working.

For every inbound route with a CIDlookup-config I stopped receiving calls and seeing messages like these in my logfile:

pbx.c: Channel ‘Zap/2-1’ sent into invalid extension ‘cidlookup_1’ in context ‘cidlookup’, but no invalid handler

pbx.c: Channel ‘SIP/XXXXXXXX-08c061f0’ sent into invalid extension ‘cidlookup_1’ in context ‘cidlookup’, but no invalid handler

I couldn’t find any hints in the documentation for a changed behavior, so I asume it’s some sort of bug.

Please advice
Klaus

After reconfiguering some stuff …

Hi,

I’ve tried that now but without success :frowning:

I’ve also deinstalled the cidlookup-modules and reinstalled it - messages for installation:
Migrating channel routing to Zap DID routing…Not Needed
Checking for cidlookup field in core’s incoming table…not present
cidlookup installed successfully

And it’s still not working.

After the deletion I only get an incrementing version of this messages:

sent into invalid extension 'cidlookup_3' in context 'cidlookup', but no invalid handler

Other hints?

thanks Klaus

reference: http://www.freepbx.org/trac/ticket/3979

OK, first look in your /etc/asterisk/extensions_additional.conf for the presence of the string ‘cidlookup_3’.

If found, then check your database, do this in a shell:
mysql -uasteriskuser -pamp109, then type use asterisk, then type select cidlookup_id,description,sourcetype from cidlookup;

You should get something like:

+--------------+--------------+------------+
| cidlookup_id | description  | sourcetype |
+--------------+--------------+------------+
|            3 | Intern-koll  | internal   |
|            4 | Egen databas | mysql      |
|            5 | TestHTTP     | http       |
+--------------+--------------+------------+

Then check which one of your incoming routes use cidlookup by select * from cidlookup_incoming;
You should get something like:

+--------------+------------+-------------+
| cidlookup_id | extension  | cidnum      |
+--------------+------------+-------------+
|            4 | 040123456  |             |
|            4 | 7777       |             |
|            3 | 0197614518 |             |
+--------------+------------+-------------+
10 rows in set (0.00 sec)

Note the cidlookup_id, that tells incoming route to use the cidlookup_id in the cidlookup table to detect what source to use for cidlookup. If those does not match you get the error you are seeing.
Post the outcome of your selects here and I will trace it from there.
Please, remember, mask of any phone numbers with X or bogus numbers before you post them here.

Hi,

ich I grep for cidlookup the only lines that are matching are these:
/etc/asterisk/extensions_additional.conf:[cidlookup]
/etc/asterisk/extensions_additional.conf:include => cidlookup-custom
/etc/asterisk/extensions_additional.conf:exten => cidlookup_return,1,LookupCIDName
/etc/asterisk/extensions_additional.conf:exten => cidlookup_return,n,Return()
/etc/asterisk/extensions_additional.conf:; end of [cidlookup]
/etc/asterisk/extensions_additional.conf:exten => 000387815659,n,Gosub(cidlookup,cidlookup_1,1)

If I remove the “CID Lookup Source” the last line won’t appear in the grep-output.

The incoming-table looks like this:
±-------------±-------------±-------+
| cidlookup_id | extension | cidnum |
±-------------±-------------±-------+
| 1 | 000387815659 | |
±-------------±-------------±-------+

cu
Klaus

OK, so if you remove “CID Lookup Source” the system runs OK?

That’s right.

OK, to clean up the leftover do this with mysql: delete from cidlookup_incoming where cidlookup_id = ‘1’;.

Then you can setup a new CID Lookup Source and add it to your inbound routes.

that didn’t change anything. I’ve also tried the truncate-way on those two tables.

Where and in what form should this “cidlookup_1” (or cidlookup_2, cidlookup_3) be present in the configfiles? What script is responsible for writing this to the config.
Maybe thee are some permission-issues or a out-of-date (broken) script…

thanks
Klaus

All config files are generated by FreePBX and are stored in /etc/asterisk.
The MySQL database contains all settings for how to generate the .conf file.

After you have removed the entries from the database you should go into FreePBX and save some settings to trigger the Apply configurations so that FreePBX generate new config files.

After that check the extensions_additional.conf if you have any leftover cidlookup settings

Ok, I’ve removed every entry in the cidlookup-tables.
And I’ve triggered the config-changes.

Now the only entries with cidlookup are those in the extensions_additional.conf:
[cidlookup]
include => cidlookup-custom
exten => cidlookup_return,1,LookupCIDName
exten => cidlookup_return,n,Return()

; end of [cidlookup]

Those entries are OK. Now you can add a new CallerID Lookup Source and add it to one of your Inbound routes and it will work.

It’s still not working :frowning:

I’ve even uninstalled, removed and completly reinstalled the cidlookup-module. It’s still not working :frowning:

Because I’m not so into the asterisk-config-files I’m not able to figue out if there might be something else thats missing… a module, a include-file, …

Where should “cidlookup_1” be located?

Ok, after searing a little bit the cidlookup_1 should be placed within the [cidlookup]-block. So I’ve searched the part in the module where it should be returned and added a trigger_error() - no entry in the php-error-logfile.

So I figured it’s prevented somewhere earlier. I’ve added this in line 269 to the extensions.class.php:

if($section==‘cidlookup’){trigger_error(‘includes’.print_r($this->_includes[$section],true)); trigger_error(‘switches’.print_r($this->_switches[$section],true)); trigger_error(‘exec’.print_r($this->_exec[$section],true)); trigger_error(‘exts’.print_r($this->_exts[$section],true));}

And the return in the php-error-log:
[21-Dec-2009 20:31:24] PHP Notice: includes in /var/www/admin/extensions.class.php on line 269
[21-Dec-2009 20:31:24] PHP Notice: switches in /var/www/admin/extensions.class.php on line 269
[21-Dec-2009 20:31:24] PHP Notice: exec in /var/www/admin/extensions.class.php on line 269
[21-Dec-2009 20:31:24] PHP Notice: extsArray
(
[cidlookup_return] => Array
(
[0] => Array
(
[basetag] => 1
[tag] =>
[addpri] =>
[cmd] => ext_lookupcidname Object
(
[data] =>
)

            )

        [1] => Array
            (
                [basetag] => n
                [tag] => 
                [addpri] => 
                [cmd] => ext_return Object
                    (
                        [data] => 
                    )

            )

    )

)
in /var/www/admin/extensions.class.php on line 269

So most of it is empty.
I’m now not sure where to dig next…

The only other entry in the php-error is this (before inserting my debugline):
[21-Dec-2009 20:13:20] PHP Warning: array_keys(): The first argument should be an array in /var/www/admin/extensions.class.php on line 292
[21-Dec-2009 20:13:20] PHP Warning: Invalid argument supplied for foreach() in /var/www/admin/extensions.class.php on line 292

Maybe that helps a bit.

There must be something else that is broken in your setup. I have tried different scenarios and I can’t duplicate the error.

Could you download the following and compare the files with your setup?
http://www.freepbx.org/trac/browser/modules/release/2.6/core-2.6.0.0.tgz
and
http://www.freepbx.org/trac/browser/modules/release/2.6/framework-2.6.0.0.tgz

Hi,

I’ve diff’ed the two archives with the installed ones and came up with no difference.
After that I made the upgrade to 2.6.0.1. Didn’t change anything ether.

I’ve also disabled the “Custom Contexts” module, that seems to be not officially supported anymore - but that as well did not fix the problem.

I think i write down all the basics of my config and set up everything completly from scratch - might take a while.

Thanks so far. If you come up with another idea, please let me know.

cu
Klaus

That is strange. If you feel like it you can zip your asterisk database and mail to me so that I can check it out if I can spot something strange in it.

You can also install the Bulkextensions module and the Bulk DID module and export the extensions and the inbound routes for an easier install.

Hi,

I’m experiencing the same problem with my setup. Fresh installation with 2.5.3 then upgraded to 2.6 through the tool. Everything is working except the caller id.
Followed instructions above. Everything looks normal, it is just not working.
Can you help?

thanks
Sam

mysql> select cidlookup_id,description,sourcetype from cidlookup;
±-------------±------------±-----------+
| cidlookup_id | description | sourcetype |
±-------------±------------±-----------+
| 1 | cnam | internal |
| 2 | cnampikarde | http |
±-------------±------------±-----------+
2 rows in set (0.01 sec)

mysql> select * from cidlookup_incoming;
±-------------±------------±-------------+
| cidlookup_id | extension | cidnum |
±-------------±------------±-------------+
| 2 | 1904507xxxx | |
| 2 | 1904507xxxx | |
| 2 | 1904596xxxx | |
| 2 | 1718475xxxx | +1904962xxxx |
±-------------±------------±-------------+

the values are good, i masked the numbers manually with xxxx.

[cidlookup]
include => cidlookup-custom
exten => cidlookup_1,1,LookupCIDName
exten => cidlookup_1,n,Return()
exten => cidlookup_2,1,Set(CALLERID(name)=${CURL(http://MYDOMAIN.net:80/cid.aspx?number=${CALLERID(num)})})
exten => cidlookup_2,n,Return()
exten => cidlookup_return,1,LookupCIDName
exten => cidlookup_return,n,Return()
; end of [cidlookup]

cidlookup_1 is a dummy, cidlookup_2 is the one that will work.

[ext-did]
include => ext-did-custom
include => ext-did-0001
include => ext-did-0002
exten => fax,1,Goto(ext-fax,in_fax,1)

(I dont see ext-did-custom in any file)

[ext-did-0001]
include => ext-did-0001-custom
exten => fax,1,Goto(ext-fax,in_fax,1)
exten => 1718475xxxx/+1904962xxxx,1,Set(__FROM_DID=${EXTEN})
exten => 1718475xxxx/+1904962xxxx,n,Gosub(cidlookup,cidlookup_2,1)
exten => 1718475xxxx/+1904962xxxx,n,Gosub(app-blacklist-check,s,1)
exten => 1718475xxxx/+1904962xxxx,n,ExecIf($[ “${CALLERID(name)}” = “” ] ,Set,CALLERID(name)=${CALLERID(num)})
exten => 1718475xxxx/+1904962xxxx,n,Set(_CALLINGPRES_SV=${CALLINGPRES${CALLINGPRES}})
exten => 1718475xxxx/+1904962xxxx,n,SetCallerPres(allowed_not_screened)
exten => 1718475xxxx/+1904962xxxx,n,Goto(disa,1,1)

; end of [ext-did-0001]

[ext-did-0002]
include => ext-did-0002-custom
exten => fax,1,Goto(ext-fax,in_fax,1)
exten => 1718475xxxx,1,Set(__FROM_DID=${EXTEN})
exten => 1718475xxxx,n,Gosub(app-blacklist-check,s,1)
exten => 1718475xxxx,n,ExecIf($[ “${CALLERID(name)}” = “” ] ,Set,CALLERID(name)=${CALLERID(num)})
exten => 1718475xxxx,n,Set(_CALLINGPRES_SV=${CALLINGPRES${CALLINGPRES}})
exten => 1718475xxxx,n,SetCallerPres(allowed_not_screened)
exten => 1718475xxxx,n,Goto(ext-group,605,1)
exten => 1904507xxxx,1,Set(__FROM_DID=${EXTEN})
exten => 1904507xxxx,n,Gosub(cidlookup,cidlookup_2,1)
exten => 1904507xxxx,n,Gosub(app-blacklist-check,s,1)
exten => 1904507xxxx,n,ExecIf($[ “${CALLERID(name)}” = “” ] ,Set,CALLERID(name)=${CALLERID(num)})
exten => 1904507xxxx,n,Set(_CALLINGPRES_SV=${CALLINGPRES${CALLINGPRES}})
exten => 1904507xxxx,n,SetCallerPres(allowed_not_screened)
exten => 1904507xxxx,n,Goto(ext-group,601,1)
exten => 1904507xxxx,1,Set(__FROM_DID=${EXTEN})
exten => 1904507xxxx,n,Gosub(cidlookup,cidlookup_2,1)
exten => 1904507xxxx,n,Gosub(app-blacklist-check,s,1)
exten => 1904507xxxx,n,ExecIf($[ “${CALLERID(name)}” = “” ] ,Set,CALLERID(name)=${CALLERID(num)})
exten => 1904507xxxx,n,Set(_CALLINGPRES_SV=${CALLINGPRES${CALLINGPRES}})
exten => 1904507xxxx,n,SetCallerPres(allowed_not_screened)
exten => 1904507xxxx,n,Goto(ext-group,600,1)
exten => 1904596xxxx,1,Set(__FROM_DID=${EXTEN})
exten => 1904596xxxx,n,Gosub(cidlookup,cidlookup_2,1)
exten => 1904596xxxx,n,Gosub(app-blacklist-check,s,1)
exten => 1904596xxxx,n,ExecIf($[ “${CALLERID(name)}” = “” ] ,Set,CALLERID(name)=${CALLERID(num)})
exten => 1904596xxxx,n,Set(_CALLINGPRES_SV=${CALLINGPRES${CALLINGPRES}})
exten => 1904596xxxx,n,SetCallerPres(allowed_not_screened)
exten => 1904596xxxx,n,Goto(ext-group,604,1)
exten => 904421xxxx,1,Set(__FROM_DID=${EXTEN})
exten => 904421xxxx,n,Gosub(app-blacklist-check,s,1)
exten => 904421xxxx,n,ExecIf($[ “${CALLERID(name)}” = “” ] ,Set,CALLERID(name)=${CALLERID(num)})
exten => 904421xxxx,n,Set(_CALLINGPRES_SV=${CALLINGPRES${CALLINGPRES}})
exten => 904421xxxx,n,SetCallerPres(allowed_not_screened)
exten => 904421xxxx,n,Goto(from-did-direct,1904421xxxx,1)

Here is some info from the CLI.
This is very frustrating and my clients are not happy with broken callerid.

– Goto (from-trunk,1718475xxxx,1)
– Executing [[email protected]:1] Set(“SIP/Flowroute-000007d2”, “__FROM_DID=1718475xxxx”) in new stack
– Executing [[email protected]:2] Gosub(“SIP/Flowroute-000007d2”, “cidlookup|cidlookup_2|1”) in new stack
– Executing [[email protected]:1] Set(“SIP/Flowroute-000007d2”, “CALLERID(name)=”) in new stack
– Executing [[email protected]:2] Return(“SIP/Flowroute-000007d2”, “”) in new stack

Execute from a shell the following:
http://MYDOMAIN.net:80/cid.aspx?number=123456789

Where 123456789 is a number that you want to lookup. What is the output?

When you upgraded FreePBX did you upgrade Asterisk as well?

Has anyone solved this issue? I have had the same problem for a couple of months now. The users really want caller lookup working again.

There is no issue with CallerID in 2.6 that we know of.
Bowskill, if you have read the thread and follow some of the suggestions that I have made and you still have an issue, please provide more details of your setup.

What version of Asterisk?
What version of FreePBX?
How have you set up the CallerID Lookup?
Is it Internal, MySQL or http?
Provide an Asterisk CLI with at least verbose lever 3

After that we might be able to help you.