Help with blocking ext to ext calling

Hi guys,
I know this topic has a lot of threads, but I can’t find the one I need…
All (or most) of them are to block an ext or range to call another ext or range with no exceptions.
Like this 1 -
And this -
I need to block ext 2033 from all internal, except from a few (2030,2035,2040,2000,2078 - this is to show that the ext are not in order)
And block 2040 from all except from a different few…

Thanks for any advice I can get…

A custom context like this one.

Let me test my understanding here…
I add in the custom context:
2030 exten => 2033,1,Goto(from-internal,${EXTEN},1)
2035 exten => 2033,1,Goto(from-internal,${EXTEN},1)
_2XXX exten => 2033,1,Hangup()

Is this correct?

This looks a lot like multi-tenant. If it is, then be aware that asterisk is probably not your best choice. If it is not, then disregard my comment.

@arielgrin, no it is not a multi-tenant.
It’s a school…
The principals don’t want peoples to call them directly, but to go through the secretary…

There are many reasons for this need. Specifically house phones. As in the thread I linked.

Then, you don’t tell anyone the principal’s extension.

Just give the secretary a BLF to transfer to.

Make his number a ring group. Then anyone who tries to call him actually gets that.

Make his outbound, internal, caller ID show the ring group extension.

Or, enable follow me with a zero ring time. And the secretary as the members. And give him a second extension also registered to his phone that the secretary can transfer to.

Lots of options.

1 Like

@sorvani, I thought about some of what you mentioned…

She has, but when she transfers a call to him, the caller sees him ext num…

I’ll see if that works…
But to have about 7-10 ring groups is a lot to configure…

Same as the BLF answer…

I need a way to do this without ring groups, follow me or “hidden” extensions…
I just want to block all internal calls (except from specific extensions) to reach some extensions…

It might be the fever or the Taco Bell, but I just had an idea on this.

Instead of handling it at the source end, change the extension behavior at the principal’s office end.

Use a custom context that includes his phone number as the destination, but redirect all calls away from his phone unless they are coming from a specific (set of) phone(s). This way, you don’t control the ‘outbound’, you control who can dial direct and who has to go through one of the ‘dial direct enabled’ numbers.

Remember, I might be completely out of here on this, but think about it and see if that might help.

I don’t know what Taco Bell has to do with anything… :grin:
But you might be up to something here…

The problem is, I don’t know how to do that…

OK, this is what I got so far…
In extensions_custom.conf:

exten => 2033,1,Dial(SIP/2030)

This forwards all calls coming into 2033 to 2030
This works, but how do I allow lets say 2035 to call 2033?

Use an If to check the CID Number. Jump to “(from-internal,s,1)” if the number matches otherwise, call through to the Dial() command.

Here is what I have so far:

; Forward all calls from 2033 to 2030 except allowed extensions
exten => 2033,1,GotoIf($["${CALLERID(num)}" = “2035”]?dial1)
exten => 2033,n,GotoIf($["${CALLERID(num)}" = “2030”]?dial1)
exten => 2033,n,GotoIf($["${CALLERID(num)}" = “2040”]?dial1)
exten => 2033,n,GotoIf($["${CALLERID(num)}" = “2021”]?dial1)
exten => 2033,n,GotoIf($["${CALLERID(num)}" != “7070”]?dial2)

exten => 2033,n(dial1),Dial(SIP/2033)
exten => 2033,n,Hangup()

exten => 2033,n(dial2),Dial(SIP/2030)
exten => 2033,n,Hangup()

It works perfectly except when 2030 transfers (blind transfer) to 2033, the call goes back to 2030, but regular transfer works…

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.