SER module group
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"'
- "table" specifies the database table to use. Default 'grp'
- "user_column" specifies the column which conatins the username. Default 'username'
- "domain_column" specifies the column which contains the SIP domain. Default 'domain'
- "group_column" specifies the column which contains the group name. Default 'grp'
- "use_domain" is an integer. '1' specifies match "user@domain", while '0' specifies match 'user'
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

Page Changes

