caller lookup not working

nielsl's picture

Hi All,

I have problems with getting my Caller Lookup working. I've got a script which runs on my internal webserver. The script strips some characters from the telephone number and performs an SQL query on my database. That script returns a name if a matching number has been found.

I've configured everything correctly (using the GUI), which resulted in the following configuration in my extentions_addition.conf:

[cidlookup]
include => cidlookup-custom
exten => cidlookup_3,1,Set(CALLERID(name)=${CURL(http://10.0.0.247:80/tel/tel.php?tel=${CALLERID(num)})})
exten => cidlookup_3,n,Return()
exten => cidlookup_return,1,ExecIf($["${DB(cidname/${CALLERID(num)})}" != ""]?Set(CALLERID(name)=${DB(cidname/${CALLERID(num)})}))
exten => cidlookup_return,n,Return()

; end of [cidlookup]

If I surf to the above link using my browser, I get the proper result. If I use curl or lynx on the PBX to surf to the link, I get the proper result. Over here I have the configuration for the inbound route, I blanked out my telephone number (and a second inbound route ;)):

[ext-did-0002]
include => ext-did-0002-custom
exten => 3171XXXXXXX,1,Set(__FROM_DID=${EXTEN})
exten => 3171XXXXXXX,n,Gosub(cidlookup,cidlookup_3,1)
exten => 3171XXXXXXX,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 3171XXXXXXX,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 3171XXXXXXX,n,Set(CALLERPRES()=allowed_not_screened)
exten => 3171XXXXXXX,n(dest-ext),Goto(from-did-direct,602,1)
exten => 3171ZZZZZZZ,1,Set(__FROM_DID=${EXTEN})
exten => 3171ZZZZZZZ,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 3171ZZZZZZZ,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 3171ZZZZZZZ,n,Set(CALLERPRES()=allowed_not_screened)
exten => 3171ZZZZZZZ,n(dest-ext),Goto(ext-group,300,1)

; end of [ext-did-0002]

The call arives at my extention without any problems, but it doesn't tell who is calling, it is only showing the number of my cell phone. What am i doing wrong? Am I doing something wrong?

I'm running Asterisknow and updated Freepbx to 2.8.0.2, the PBX and webserver are in the same subnet and can 'talk' to eachother. Hope somebody can give me a push in the right direction!

Thanks in advance.
Niels
The Netherlands


__________________


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

anybody any

nielsl's picture

anybody any suggestions?

Thanks in advance!


A trace would be nice

mickecarlsson's picture
Quote:
If I surf to the above link using my browser, I get the proper result. If I use curl or lynx on the PBX to surf to the link, I get the proper result.

When you do the above, do you only receive one line with the name? If you do it in a browser and look at the source, your only output is just the name, nothing else?

How about a trace with verbosity set to at least 3?


__________________

Mikael Carlsson
(I am off-line, tinkering with my Chevy and my radios, don't know when I will be back)


Me too

emerysteele's picture

I have the same issue, except I use superfecta to get the cid. I know that superfecta is working because if I browse to http://192.168.1.125/admin/modules/superfecta/bin/callerid.php?thenumber... it will show the name of the person, but when they call the cid just shows their number.


I have same issue

hoolahoous's picture

any solution ?
I get just name (checked the source of resulting page).


Solution

nielsl's picture

I've found the solution to my problem. I can't really blame FreePBX. The solution was the following:

yum install asterisk16-curl

Yeah, it took me a lot of hours before I figured that one out. I use the Asterisknow package (64bit) and it seems that it does come along with CUPS, but without a very usefull curl library.
My suggestion to FreePBX would be to check if the proper curl libraries are installed when someone is using the basic caller ID lookup source through a HTTP request.

I hope my solution helps other people aswell!