#include <string.h>
#include "../../dprint.h"
#include "../../db/db.h"
#include "../../ut.h"
#include "../../parser/digest/digest.h"
#include "../../parser/hf.h"
#include "../../parser/parse_from.h"
#include "../../parser/parse_uri.h"
#include "group.h"
#include "group_mod.h"

Go to the source code of this file.
Functions | |
| int | get_username_domain (struct sip_msg *msg, group_check_p gcp, str *username, str *domain) |
| Extract the username and domain from the SIP message. | |
| int | group_db_bind (const str *db_url) |
| Bind the DB connection. | |
| void | group_db_close (void) |
| Close the DB connection. | |
| int | group_db_init (const str *db_url) |
| Initialize the DB connection. | |
| int | is_user_in (struct sip_msg *_msg, char *_hf, char *_grp) |
| Check if username in specified header field is in a table. | |
Definition in file group.c.
| int get_username_domain | ( | struct sip_msg * | msg, | |
| group_check_p | gcp, | |||
| str * | username, | |||
| str * | domain | |||
| ) |
Extract the username and domain from the SIP message.
Set the username and domain depending on the value of the SIP message and the group check structure.
Definition at line 59 of file group.c.
References sip_msg::authorization, auth_body::digest, _pv_value::flags, get_authorized_cred(), GET_REALM, sip_uri::host, _group_check::id, _str::len, LM_ERR, NULL, parse_from_uri(), parse_sip_msg_uri(), parse_to_uri(), parse_uri(), hdr_field::parsed, sip_msg::parsed_uri, sip_msg::proxy_auth, pv_get_spec_value(), PV_VAL_NULL, _pv_value::rs, _str::s, _group_check::sp, username::user, sip_uri::user, and dig_cred::username.
Referenced by get_user_group(), and is_user_in().
| int group_db_bind | ( | const str * | db_url | ) |
Bind the DB connection.
| db_url | database URL |
Definition at line 220 of file group.c.
References db_bind_mod(), DB_CAP_QUERY, DB_CAPABILITY, group_dbf, and LM_ERR.
Referenced by mod_init().
| void group_db_close | ( | void | ) |
Close the DB connection.
Definition at line 239 of file group.c.
References db_func::close, group_dbf, and group_dbh.
Referenced by destroy(), and mod_init().
| int group_db_init | ( | const str * | db_url | ) |
Initialize the DB connection.
| db_url | database URL |
Definition at line 198 of file group.c.
References group_dbf, group_dbh, db_func::init, LM_CRIT, and LM_ERR.
Referenced by child_init(), and mod_init().
| int is_user_in | ( | struct sip_msg * | _msg, | |
| char * | _hf, | |||
| char * | _grp | |||
| ) |
Check if username in specified header field is in a table.
| _msg | SIP message | |
| _hf | Header field | |
| _grp | checked table |
Definition at line 140 of file group.c.
References DB_STR, domain_column, db_func::free_result, get_username_domain(), group_column, group_dbf, group_dbh, len, LM_DBG, LM_ERR, NULL, db_func::query, RES_ROW_N, s, table, use_domain, db_func::use_table, user_column, VAL_NULL, VAL_STR, VAL_TYPE, vals, and ZSW.
1.5.6