CNAM issues

I am having an issue where after I define a CID Lookup source (in this case using Metrostat over http, but will eventually migrate to Verisign) and apply it to an inbound route it fails to display the CID Name and instead only displays the CID Number followed by the CID Number again. I have verified that this is NOT an issue of connectivity, source IP-address verification, etc. (see my comment below on CURL).

I believe the issue is that the sip trunk which I am utilizing displays caller ID number in the format of +1NPANxxXXXX. I believe that Metrostat will return nothing unless it is formated exactly as NPANxxXXXX. Is there a way to remove the “+1”? I have tried modifying the CURL entry that the system generates in the “extensions_additional.conf” file, however, no modification I submit seems to work. I know that it is an issue of the preceeding “+1” as if I modify the CURL statement and replace the “${CALLERID(num)}” with a 10 digit number, it returns the correct result (the callers name).

On a separate note, is there a way to globally define a CID Lookup source for extensions. I see how it is easy to define a CID Lookup source for an inbound route, but there seems to be no place to enter a CID Lookup source for individual extensions nor to globally define it?

Any help on both matters would be greatly appreciated.

Create a custom context in extensions_custom.conf for the inbound context of the trunk. It will probably be from-pstn. So, in extensions_custome.conf, create


exten => _X.,1,Noop(Entering from-pstn-custom)
exten => _X.,n, Set(length=${LEN(${CALLERID(num)})})
exten => _X.,n, gotoif($["${length}" != “12”]?leave)
exten => _X.,n,set(CALLERID(num) = ${${CALLERID(num):2}})
exten => _X.,n(leave), Noop(Returning to from-pstn)

This is untested code, so use it at your peril. It should get you started though.