[Freeswitch-users] Setting Restrictions on Default Dialplan

Michael Collins msc at freeswitch.org
Sun Dec 20 19:47:25 PST 2009


On Sun, Dec 20, 2009 at 6:39 PM, Edmar Cruz <darklion11 at yahoo.com> wrote:

>
> Hi Sir,
>
>     How can I allow international calling in the dialing plan but for
> select accounts only?
>
>     For example  i want to restrict 8555555 to call this ip address
> 182.138.252.12 using the default configuration.. Does this command should
> be
> put in the default.xml or in the default folder and the filename is
> 00_restict.xml?
>
>     <extension name="dialsample">
>
>   <condition field="destination_number" expression="^(8555555)$"\>
>     <action application="set"
> data="effective_caller_name=${effective_caller_id_name}"/>
>     <action application="set"
> data="effective_caller_number=${effective_caller_id_number}"/>
>     <action application="set" data="hang_up_after_bridge=true"/>
>     <action application="bridge" data="sofia/default/$1 at 182.138.252.12"/>
>   </condition>
>
>  </extension>
>
> When i tried this command both of them nothing happen 8555555 can call
> 182.138.252.12 i want it to restrict this account for not calling
> 182.138.252.12..
>
> Please help..
>

This functionality already exists in the default dialplan and sample
directory entries, assuming that you are using authorization. First off,
look in 1000.xml (or any of the other sample user files) for this variable
declaration:
<variable name="toll_allow" value="domestic,international,local"/>

For any user whom you wish to restrict to local or domestic calling only
just remove the 'international' from the list:
<variable name="toll_allow" value="domestic,local"/>

Now when that user registers and makes calls he/she won't have
'international' in the ${toll_allow} channel variable. Something like this
in your dialplan could handle both cases:
<extension name="international dialing">
  <condition field="${toll_allow}" expression="international">
    <anti-action application="playfile"
data="misc/you-are-not-authorized.wav"/>
    <anti-action application="hangup"/>
  </condition>
  <condition field="destination_number" expression="^(\d+)$"> <!-- use
whatever value works for you -->
    <action application="bridge" data="sofia/internal/$1 at whatever"/>
  </condition>

Now that I've typed all that, I should go back and ask: are you using digest
authorization? Or are you using an ACL to let your callers in? Anyway,
hopefully the above example will give you some ideas.
-MC


> Thanks,
> Edmar
> --
> View this message in context:
> http://old.nabble.com/Setting-Restrictions-on-Default-Dialplan-tp26868725p26868725.html
> Sent from the Freeswitch-users mailing list archive at Nabble.com.
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20091220/c9c70b29/attachment-0002.html 


More information about the FreeSWITCH-users mailing list