Upgrade 3CX to v18 and get it hosted free!

SER module group

Author image

group: This module export functions necesarry for group membership checking. There is a database table that contains list of users and groups they belong to. The table is used by functions of this module.

A typical use is to check whether the user is the member of a particular group (such as LongDistance), in order to control access to a particular facility.

The is_user_in(URI, group) function allows checking whether the user is a member of a specifiic group. The ‘URI’ parameter specifies the field which contains the URI. It can be one of the following values:

  • Request-URI
  • To
  • From
  • Credentials

Configuration

The Group module must be loaded after a database module (such as mysql). It nneds to be told the tables and columns to use when checking group membership.

  • “db_url” specifies the database connection to use. Default ‘sql://serro:47serro11@localhost/ser”‘

modparam("group", "db_url", "sql://username:password@dbhost/ser")

  • “table” specifies the database table to use. Default ‘grp’

modparam("group", "table", "grp")

  • “user_column” specifies the column which conatins the username. Default ‘username’

modparam("group", "user_column", "username")

  • “domain_column” specifies the column which contains the SIP domain. Default ‘domain’

modparam("group", "domain_column", "domain")

  • “group_column” specifies the column which contains the group name. Default ‘grp’

modparam("group", "group_column", "grp")

  • “use_domain” is an integer. ‘1’ specifies match “user@domain”, while ‘0’ specifies match ‘user’

modparam("group", "use_domain", 1)

Example

Check whether a user is allowed access to long-distance calls. Since the user URI is being extracted from “credentials” it means that they have already been authenticated.

if (!is_user_in("credentials", "ld")) {
sl_send_reply("403", "Local calls only");
break;
};


Back to SIP Express Router


Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.
Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.