FreePBX CallerID Matching in Inbound Routes

dallas

Well-Known Member
Joined
Oct 21, 2007
Messages
1,034
Reaction score
332
From CallerID Number hover help...
Leave this field blank to match any or no CID info. In addition to standard dial sequences, you can also put Private, Blocked, Unknown, Restricted, Anonymous, Unavailable and Withheld in order to catch these special cases if the Telco transmits them.
Looking through my CDRs I'm think that the Private, Blocked, Unknown, Restricted, Anonymous, Unavailable and Withheld options might just be case sensitive.

I have an inbound route to send CID number = "anonymous" to Lenny. This works fine, but today I had a call where CID number was "Anonymous" and the call got through to a ring group. Actually the CID number was also in quotes. The CDR search is not case as can be seen from this screen capture of a search for anonymous.
1604381598860.png

Has anyone come across this?
 
I played with that a bit recently and also couldn't get the special terms working. You might be right about case, I did not try cap case or all caps versions of the terms.
 
So I have changed my inbound route to use the special term Anonymous (with upper case A) rather than lower case and will wait and see if anything changes. I’m hopeful after a CDR search for Anonymous returned both CID names.
 
Last edited:
I didn't have to wait long... got a call today and it fell through to the Any CID. :(
How do I sort Inbound Routes in FreePBX?

Edit. A bit more testing and I find that the special case 'Anonymous' doesn't work. If I enter 'anonymous' it routes the call correctly but it IS case sensitive and if the Telco sends 'Anonymous' it falls throught to the catch all.

Unfortunately FreePBX won't let me create a route for 'Anonymous' if 'anonymous' exists.
 
Last edited:
Sounds like it's a little buggy.
Or at the very least like the Help text needs more info on how it's intended to work..
 
Special caller id number transmission technique has evolved when it needed to be adapted to wireless/cell technology, then to VOIP/SIP technology. Originally it was well defined specific numeric codes because POTS switches could only transmit numeral values. The latest is anybody does what he wants and things largely depend on who's your upstream originator.

Then with Asterisk/FreePBX you have some quirks to take into account.
First, make sure that those labels (anonymous, private, etc.) are not defined in your phone book. If they are the test priorities are altered which adds up to the problem.

Next check to see if those labels come in as unquoted anonymous, or as "anonymous" <anonymous>. Your OP shows that you have both. You need to figure out why you have both versions. A given trunk should produce only one type of labels.

If the label shown is unquoted anonymous then things are simple. You can use the CID field in FreePBX's WebGui to process them like any phone number.

If you are dealing with "anonymous" <anonymous> type labels you are out of luck with the webgui and you need to make manual modifications in the settings file because the tests need to be done on caller id name and not caller id number. You can actually operate on caller id number too if you are willing to do deeper surgery in the settings (and software).

Now, what I'm describing here is my own experience on a quite old version of FreePBX/Asterisk. I am not an asterisk or freepbx developer and certainly not an authority in the matter. But I have extensive experience in hacking both codes and quite good understanding about the programming logic/structure used.

And God knows how much pain my neck experiences every time I go seek some information in those source files, as I can't stop shaking my head in front of such spaghetti code. This is not said out of disrespect to the developers, but just to state that those software belong to the yesteryear of software development. AND it's very possible that things have changed/improved in the newer versions of the software. (I'm still on FreePBX 12 / Asterisk 13 - as a hobbyist - because I'm past the age of rediscovering the wheel every other year and I moved to FreeSwitch for professional use)

My advice to you is to operate in /etc/asterisk/extensions_override_freepbx.conf under the section app-blacklist-check. Look at how basic processing is done. It will give you the understanding on how to proceed with your own modifications. If there is no such section fetch it from extensions_additional.conf (do a search for blacklist).
 
Thanks for your insight.
You need to figure out why you have both versions. A given trunk should produce only one type of labels.
That's not true. It depends on the originating exchange not the incoming trunk.
I can create a call that is "Anonymous" <anonymous> by calling from my mobile while blocking my callerID. It arrives with a CNAM of Anonymous and CNUM of anonymous.

My Blacklist was empty so I've added Anonymous to the list. I'll see what happens, but I suspect it won't help.
 
Last edited:
... That's not true. It depends on the originating exchange not the incoming trunk. ...
That's actually what I meant as I was thinking about trunk in the traditional POTS sense where trunk and local exchange circuitry are one and the same.
After I wrote my post the other day, it gave me the idea of revisiting some bookmarked code that I had found quite intriguing some time ago. Some FreePBX modules which deal with CID may also reset/remove the CID name and make it look like there is only CID number.
You might want to keep the incoming call path to the strict minimum, like Trunk > Incoming Route > Extension during your tests, as Ring Groups, IVR, FollowMe, etc, all massage those fields and could make some drastic changes in limit conditions.
 
Some FreePBX modules which deal with CID may also reset/remove the CID name and make it look like there is only CID number.
I was looking through extensions_additional.conf and this line is in every inbound route. Admittedly it's after the blacklist check but it doesn't help when looking at CDR records trying to find what cid information was actually recieved.
exten => 09564351,n(callerid),ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))

When I added Anonymous to the blacklist the call from my mobile went to app-nv-itslenny.
 
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top