Block Some Extension to Call other Extension

Status
Not open for further replies.

jtarga

New Member
Dec 27, 2021
25
0
1
42
Hi

How can i block some extension to call other extension?

Like:

Extension 3000 is not able to receive call from extension, 2000, 2001, 2002

It is possible?

Best regards
 

agree

Member
Aug 26, 2018
135
24
18
You can do it with a simple dialplan like this.

XML:
<extension name="extension_call_permissions" continue="true">
    <!--block if caller is 2006 and calls 2000,1,2-->
    <condition field="${sip_from_user}" expression="2006"/>
    <condition field="destination_number" expression="^200[0-2]$">   
        <action application="respond" data="403 Called extension forbidden"/>
    </condition>
</extension>
 
Last edited:

jtarga

New Member
Dec 27, 2021
25
0
1
42
You can do it with a simple dialplan like this.

XML:
<extension name="extension_call_permissions" continue="true">
    <!--block if caller is 2006 and calls 2000,1,2-->
    <condition field="${sip_from_user}" expression="2006"/>
    <condition field="destination_number" expression="^200?[0-2]$">   
        <action application="respond" data="403 Called extension forbidden"/>
    </condition>
</extension>
Unfortunately it didn't work.
 

agree

Member
Aug 26, 2018
135
24
18
There was a slight error in the regex of the snippet I gave you. If it doesn't work, can you show your dialplan and logs?
 
Status
Not open for further replies.