[Freeswitch-users] user access
Michael Collins
msc at freeswitch.org
Wed Aug 6 13:54:10 PDT 2008
I just grepped the entire source tree and "toll_allow" is not a predefined
chan var. In other words, Brian just demonstrated the power and flexibility
of FS by giving you just a few lines of config.
setting toll_allow to a comma-delimited value lets you have have multiple
values that can be checked
the power of the regexp use is made clear - just match for one of the
comma-delimited values
In plain English I'd say that Brian showed us this:
Definite a custom chan var called "toll_allow"
Set the var to an appropriate value for the user in question, i.e.
"local,ld,int"
In the dialplan add a "protection check" by testing the toll_allow variable
This is probably something we need to define as a "how-to" or a "best
practice" or even just as an example of "hey FS is way cool cuz you can do
this..."
I'll mention it on the next weekly conf call and we'll see what response we
get.
-MC
2008/8/6 UV <uv at talknet.com.au>
> I have to agree with Roberto on not understanding what you've done,
> Brian.
>
>
>
> Is toll_allow an undocumented channel variable?
>
> Or did you just define/declare a generic variable on the spot?
>
> If you did, can all user defined variables be in this array format?
>
>
>
>
> ------------------------------
>
> *From:* freeswitch-users-bounces at lists.freeswitch.org [mailto:
> freeswitch-users-bounces at lists.freeswitch.org] *On Behalf Of *Roberto
> Hernandez
> *Sent:* Wednesday, August 06, 2008 11:28 PM
> *To:* freeswitch-users at lists.freeswitch.org
> *Subject:* Re: [Freeswitch-users] user access
>
>
>
>
>
> Thank you. This worked. I added a second context to the dialplan allowing
> PSTN and assigned to user 1010.
>
> /b: I like the simplest method, just don't understand it yet. Where is
> toll_allow defined?
>
>
>
> (conf/dialplan/default.xml):
>
> <include>
>
> <context name="default"
>
> /* extensions */
>
> </context>
>
>
>
> <context name="default_allow_pstn"
>
> /* extensions */
>
> /* extension to allow PSTN */
>
> </context>
>
> </include>
>
>
>
> (conf/directory/default/1010.xml):
>
> <variable name="user_context" value="default_allow_pstn"/>
>
>
>
>
> ------------------------------
>
> *From:* freeswitch-users-bounces at lists.freeswitch.org [mailto:
> freeswitch-users-bounces at lists.freeswitch.org] *On Behalf Of *Brian West
> *Sent:* Wednesday, August 06, 2008 5:36 AM
> *To:* freeswitch-users at lists.freeswitch.org
> *Subject:* Re: [Freeswitch-users] user access
>
>
>
> You all did well but you didn't pick the simplest method:
>
>
>
> Add this to a user:
>
>
>
> <variable name="toll_allow" value="local,ld,int"/>
>
>
>
> Then in your dialplan for the extension you wish to protect from various
> routes:
>
>
>
> <condition field="${toll_allow}" expression="local"/>
>
>
>
> /b
>
>
>
>
>
>
>
>
>
> On Aug 6, 2008, at 12:33 AM, UV wrote:
>
>
>
> I think the proper way of doing that is by assigning users to different
> dialplan user contexts according to their Class of Service.
>
>
>
> For example, an easy way of doing that is to define a user_context
> "Not_Allowed_PSTN" for a specific directory user 1010
> (conf/directory/default/1010.xml):
>
> <variable name="user_context" value=" Not_Allowed_PSTN "/>
>
>
>
> Create a new context called "Not_Allowed_PSTN" and handle those calls as
> you like or just add a prefix 0001 and send to the default context:
>
> <condition field="destination_number" expression="^(.*)$">
>
> <action application="transfer" data="0001$1 XML default"/>
>
> </condition>
>
>
> ------------------------------
>
> *From:* freeswitch-users-bounces at lists.freeswitch.org [
> mailto:freeswitch-users-bounces at lists.freeswitch.org<freeswitch-users-bounces at lists.freeswitch.org>
> ] *On Behalf Of*Roberto Hernandez
> *Sent:* Wednesday, August 06, 2008 2:01 PM
> *To:* freeswitch-users at lists.freeswitch.org
> *Subject:* [Freeswitch-users] user access
>
>
>
>
>
> Anyone have suggestions on how to the enable the following scenario? Allow
> internal but control external per user.
>
> More importantly how to disable or enable PSTN access for a specific user
> in a domain (profile)?
>
>
>
> user1 at domain1.com <--> FS <--> Allowed PSTN
>
> user1 at domain1.com <--> FS <--> user2 at domain1.com
>
>
>
> user2 at domain1.com <--> FS <--> Not Allowed PSTN
>
> user2 at domain1.com <--> FS <--> user1 at domain1.com
>
>
>
> *Thanks,*
>
> *Roberto*
>
>
>
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com
> Version: 8.0.138 / Virus Database: 270.5.12/1594 - Release Date: 05/08/2008
> 21:49
>
>
>
> _______________________________________________
> 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
>
>
>
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com
> Version: 8.0.138 / Virus Database: 270.5.12/1594 - Release Date: 05/08/2008
> 21:49
>
>
> _______________________________________________
> 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/20080806/d76b7dbb/attachment-0002.html
More information about the FreeSWITCH-users
mailing list