Caller's name lookup

Catalog of dial plans
johnnx
Posts: 10
Joined: Tue Nov 02, 2010 10:28 am

Re: Caller's name lookup

Post by johnnx » Sat Dec 25, 2010 7:10 pm

Thank you for all your help, Mike.

Feedback concerning special characters: works flawless on softphones PhonerLite and NinjaLite (both Windows) and on Sipdroid (Android). I cannot test it on my "real" phones as feature not supported by my DSL/VoIP router. Neither does fring support sending of additional information.

MikeTelis
Posts: 1582
Joined: Wed Jul 30, 2008 6:48 am

Re: Caller's name lookup

Post by MikeTelis » Sat Dec 25, 2010 7:28 pm

It works fine with Bria. I also tried AGEphone under Windows Mobile, it wouldn't properly display umlauts and other fancy chars (this doesn't affect the calls, though). Yet I noticed that fancy chars appear as '?' (single question mark) in the Console.

I'm hoping to get a word of advice (how to deal with UTF-8 fancy chars) from the guru (Aaron). Will update the code, if necessary.

uhf
Posts: 26
Joined: Sat Oct 30, 2010 3:05 am

Re: Caller's name lookup

Post by uhf » Fri Jan 28, 2011 1:48 am

Mike,
I have an issue with a local CLEC that doesn't register CNAM info and instead sends "CITY ST". These numbers generally show the callers name in Whitepages searches. I'd like to add a way to your script to search for the specific CITY ST pattern in the CNAM and if found, search Whitepages. Would you be willing to help me with this?
Thanks

MikeTelis
Posts: 1582
Joined: Wed Jul 30, 2008 6:48 am

Re: Caller's name lookup

Post by MikeTelis » Fri Jan 28, 2011 3:00 am

I'll try. Add this debug line:

sys.Log("** Call from #{req.Header.From} to #{req.URI.User} **")

to your "In" dialplan and show me what you get in the Console on incoming calls.

uhf
Posts: 26
Joined: Sat Oct 30, 2010 3:05 am

Re: Caller's name lookup

Post by uhf » Sat Jan 29, 2011 2:53 am

thanks, Mike.
I've added the line now I have to wait for someone to call that uses that provider.

uhf
Posts: 26
Joined: Sat Oct 30, 2010 3:05 am

Re: Caller's name lookup

Post by uhf » Mon Jan 31, 2011 4:58 pm

Mike, here's what I get:

DialPlan 16:57:14:162 sip1(27616): ** Call from "INDEPENDENCE IA" <sip:1319334xxxx@xx.xxx.xxx.xx>;tag=3505481831-311232 to username **

Thanks for your help

MikeTelis
Posts: 1582
Joined: Wed Jul 30, 2008 6:48 am

Re: Caller's name lookup

Post by MikeTelis » Wed Feb 02, 2011 4:27 pm

If 1319334xxxx number is listed (in the White Pages), my code should be able to return caller's name. If it didn't happen then I suspect it can't be done with existing code (see this page). In a nutshell, some parts of the White Pages database are not available via API, you only can get this information online.

uhf
Posts: 26
Joined: Sat Oct 30, 2010 3:05 am

Re: Caller's name lookup

Post by uhf » Thu Feb 03, 2011 9:18 pm

Mike,
I misunderstood for some reason thinking that if the SIP provider sent CNAM info that would be passed, and the lookup would occur only if no CNAM was sent. I'm not sure why I was thinking that. Disregard!

MikeTelis
Posts: 1582
Joined: Wed Jul 30, 2008 6:48 am

Re: Caller's name lookup

Post by MikeTelis » Tue Feb 08, 2011 1:26 pm

"Display name" portion of URI is always substituted: by Caller's name, if we can retrieve it from CNAM hash or WhitePages db, or by caller's number. The reason we always do that is that some providers (IPKall, for example) supply Display name in "City, State" format and some programs (e.g. Bria, X-Lite) do not tolerate a comma in this field.

Of course, it's possible to keep original Display name for some incoming calls (for example, if caller's number matches a certain pattern, such as "begins with 1319").

uhf
Posts: 26
Joined: Sat Oct 30, 2010 3:05 am

Re: Caller's name lookup

Post by uhf » Mon Nov 14, 2011 10:15 pm

Old thread, and it's been awhile since I've posted here, but CNAM has gone downhill fast. Many numbers are no longer available from WhitePages, but I found a paid service that works great. However, I don't understand Ruby or the White Pages API enough to make the change.

Here's the API query:

Code: Select all

http://cnam.calleridservice.com/query?u=[USER]&k=[APIKEY]&n=[5555551212]
It simply returns:
SUBSCRIBER NAME
and nothing else.

Any help appreciated.

Post Reply