[SOLVED] Anyone get http CLID lookup working with metrostat?

I’ve been trying to get metrostat caller id lookup services working for a few days now and all though it should be simple, it seems to “not” work… Also, my provider is sending a ‘+1’ with the incoming caller id number. Any idea how to chop off the ‘+1’ for the caller id lookup only if it exists in the passed in string from the itsp? I have several incoming providers and one sends the +1 while another doesn’t.

Metrostat expects the following http string: http://cnam1.edicentral.net/getcnam?q=C&dn=8285871000

where (8285871000) = the number i’m passing for lookup.

Here’s how I have it setup in my caller id lookup sources config:

Source Type: http

Caching turned off.

host: cnam1.edicentral.net
path: /getcnam
query: q=C&f=S&dn=[NUMBER]

everything else is blank as they use ip access control lists. Obviously, I’m setting the caller id lookup source to the metrostat caller id lookup source in the incoming route.

All I’m getting is the telephone number in the caller name field rather than the looked up name. I’ve verified this works with my browser. Any ideas ppl?

Just so you all know, the 8285871000 telephone number is their test number and it seems to work as a trial number.

Thanks In Advance.

Percy

****** Update **********

ok… the following works, but now i need to figure out how to chop off the +1 prepended from one itsp while leaving the string alone from others that don’t provide the +1. I’m not a coder, otherwise, i’m sure this would be quick and easy. I’m more an admin type… . Anybody willling to give this a shot for me?

For those of you who are struggling to get metrostat working, here’s what worked for me:

Source Type: http

Caching turned off.

host: cnam1.edicentral.net
path: /getcnam
query: ?q=C&f=S&dn=[NUMBER]

********* Update 2 **********

ok… I figured this one out. Basically, go to extensions_custom.conf and create the following context:

[removeplusone]
exten => _X.,1,Set(CALLERID(num)=${IF($[LEN(CALLERID(num))=12]${CALLERID(num)}:?${CALLERID(num):2:10})})
exten => _X.,n,Goto(from-pstn,${EXTEN},1)

now go into your trunk configuration and for the trunks that provide the +1 prepended, just define the context as: ‘removeplusone’. This will strip out the prepended +1 and pass the call back to the from-pstn context. Meh… Hopefully this helps someone else (the only reason why i’m bothering to post the solutions)…

Cheers.

-pk

Thank you very much for this fix (update 2). The wife was getting frustrated by not having the phone number on caller id. I’m using flow route and this fixed the issue. Thanks again.