How to use inbound route with CID

Hi all,
I am succesfully using directdid and inbound routes based on DID.
Now I would like to add a new inbound route, in order to refuse calls coming from a specific CID.
I tried to create an inbound route exactly as I always did for DID with no chance.
I see that in freepbx 2.2.1, 2.2.2, 2.2.3 the positions for include from-did into from-pstn changed (but this is another story, I think…)

I saw that the rule I created is translated into these lines into extensions_additional.conf (12345 is the CID to “refuse”)

exten => s/12345,1,Set(__FROM_DID=s/12345)
exten => s/12345,n,Goto(app-blackhole,hangup,1)

I also tried several other combination, like
exten => s/_12345.,1,Set(__FROM_DID=s/12345)

None of them were succesful

What am I doing bad ?
I am using a Digium PRI (te110p) card, asterisk svn version
Asterisk SVN-branch-1.2-r74427M

As said, the problem is present in all 2.2.1 2.2.2 and 2.2.3 versions

thanks in advance,
Andrea

I never tried trapping a CID on all did’s, I suspect something like this may work:

DID: NXXNXXXXXX (or what ever the appropriate pattern you require)
CID: 12345

OK, I tried your suggestion and it worked
I had to configure 2 inbound route, the first for exactly the pri destination prefix, the second for _prefix. in order to match any combination of possible DID.
So I think the problem is only a documentation problem staying on the DID field you are said

“Leave this blank to match calls with any or no DID info.”

but it seems not to be true; probably also an _. could work… anyway I didn’t try this

thank you very much, you solved my problem

Andrea

hi everybody.

I’m very interesting by this post.

for me, i want to redirect all numbers beginning by 06 from phone GSM to an extention or ringing groups.

What’s syntax must be put on DID and CID?

I stand put the complet number in CID and it’s ok, but if i put 06XXXXXXXX or 06. , is not work. :cry:

thank’s for your help.

Yesssss…

It’s good.

I put on CID : _06XXXXXXXX and not 06XXXXXXXX.
And now it’s ok.
In DID : leave blank

Ok bye.

hi everybody.

so, now if i want to redirect all incomings calls from anonymous?

Because Any DID / Any CID are full priority! ( if CID is “_06XXXXXXXX”, is not work because any CID are “Any CID” before )

possible, impossible?

[quote=“danardf”]hi everybody.

so, now if i want to redirect all incomings calls from anonymous?

Because Any DID / Any CID are full priority! ( if CID is “_06XXXXXXXX”, is not work because any CID are “Any CID” before )

possible, impossible?[/quote]

The problem with using ‘Any DID’ was a good pickup! thanks :slight_smile:

I’ve tried using any DID / to redirect specific CID’s and
it never worked. However the following works…

  1. Redirect specific CID’s using 'DID: _. / CID: ’
  2. Catch the remaining using 'DID: _. / CID: ’
  3. Direct specific DID’s using 'DID: / CID: ’

As long as you NEVER use a blank DID… it all works. As soon as you
have even a single rule with a blank DID, things break down.

Cheers.
Blacky

Look my post here:

http://www.freepbx.org/forum/freepbx/development/inbound-routing-to-prioritize-cid-matching-over-did-matching#comment-12881

I hope this can help…

Cheers!