Skip to main content

Block Inbound Call From Certain Caller ID At Inbound Route Level

Posted by dozment on Wed, 09/23/2009

We've got a customer who is using the multi-extension script to ring all of his extensions when a call comes in. They asked us to block all calls from a certain caller ID. We tried blocking it at each extension, but it doesn't seem to work (not sure why yet, but I suspect multi-extension is breaking it). Is there a way to block calls at the inbound route level so that I don't have to set it at each extension?


Submitted by dozment on Thu, 09/24/2009 Permalink

Oh, come on, Erik! You're supposed to say, "Yes, if you write it yourself. All you have to do is......" The "...."s are replace by exactly what I need to do in the script! ;->

I will think about this a little more. Maybe the other solutions is to understand why we aren't able to block calls with the multi-extension script. Is anyone doing that?

Submitted by eeman on Thu, 09/24/2009 Permalink

I dont see why the multi-exten script does not observe call blocking, trace the dialplan and compare the lines to see if something is returning 0 when it should be a 1 :)

The only time i have _ever_ used call blocking was on installations at schools so that parents cant call into the classrooms. We block everyone then put the administration office phones into the allow list so they can get calls from secretary or principal etc.

Submitted by dozment on Thu, 09/24/2009 Permalink

The multi-exten script uses tl-userexten-rg-base, and it doesn't call tl-userexten-base which seems to be where the call block/screen logic lives. I wonder if it would be easy to add the call block code to tl-userexten-rg-base. I guess the first obstacle would be where does it get the block info. tl-userexten-base gets it from BLOCK_NUM=${DB(${THISEXT}/BLOCKN${i})}. But, will that work when there are multiple extensoins?

This is the first time we've had a request for it.

Submitted by eeman on Thu, 09/24/2009 Permalink

well yes, the only difference between calling 1 extension and calling 5 is in the Dial() command. Instead of Dial(SIP/101) it's Dial(SIP/101&SIP/102&SIP/103). So it would be possible to create a multi-device script that called userexten-base instead of userexten-rg-base. You simply would have to pass all the extensions onto the dial command. The other handlers like blocking forwarding etc occur before this dial so if they activate the handsets simply don't ring (an expected behavior)

Submitted by moshe on Thu, 09/24/2009 Permalink

You could setup a extension as a multi device extension, and point the inbound reoute to that extension, and play around with that extension to set call blocikng

No need to write any code

Submitted by eeman on Fri, 09/25/2009 Permalink

[macro-tl-multidevice-exten]

exten => s,1,Set(__DIALED_NUMBER=${MACRO_EXTEN})

exten => s,n,Set(RING_DEVICES=${IF($["${ARG3}" != ""]?${ARG1}&${ARG3}:${ARG1})})

exten => s,n,GotoIf($["${RINGGROUP_TIMEOUT}" != "" & "${BLINDTRANSFER}" = ""]?doingringgroup)

exten => s,n,Macro(tl-userexten-base,${RING_DEVICES},${ARG2},${ARG4})

exten => s,n,MacroExit

exten => s,n(doingringgroup),Macro(tl-userexten-rg-base,${RING_DEVICES},${RINGGROUP_TIMEOUT})

confirmed, if you're somehow arriving at userexten-rg-base it is because you have a RINGGROUP_TIMEOUT channel variable set.

Submitted by dozment on Sat, 09/26/2009 Permalink

Moshe, that seems to solve my problem. Thanks! I don't think I've ever created a multi-device extension like that.

Erik, it looks like RINGGROUP_TIMEOUT is getting set in the scripts somewhere. I'm not setting it via an ARG. Would it make sense to consider adding the call block code to tl-userexten-rg-base?

Submitted by mattdarnell on Wed, 02/24/2010 Permalink

If I have blocking on ext 101, I can have a route that goes directly to ext 101 and the blocking works as expected.

If I have the same blocking on ext 101, I set the inbound route as Multi-device-extension, have 101 as the “Phone to ring” and 102 & 103 as the “Additional phones to ring”, it does not use the call blocking programming, ext 101 rings.

What is different?

-Matt

Submitted by eeman on Thu, 02/25/2010 Permalink

multi-device-exten is only for extensions, not routes...

go to ext 101... change its script to multi-device-exten

select a 2nd phone device to be exten 101 also

go to inbound route... change that script to 'go to user extension' and select 101