Skip to content

ALIAS_DB module

ALIAS_DB module can be used as an alternative for user aliases via usrloc. The main feature is that it does not store all adjacent data as for user location and always uses database for search (no memory caching).

Having no memory caching, search speed might decrease but provisioning is easier. With very fast databases like MySQL, speed penalty can be lowered. Also, the search can be performed on different tables in the same script.

The following modules must be loaded before this module:

  • database module (mysql, dbtext, …).

The following libraries or applications must be installed before running OpenSIPS with this module loaded:

  • None.

Database URL.

Default value is “mysql://opensipsro:opensipsro@localhost/opensips”.

Set db_url parameter
...
modparam("alias_db", "db_url", "dbdriver://username:password@dbhost/dbname")
...

Name of the column storing username.

Default value is “username”.

Set user_column parameter
...
modparam("alias_db", "user_column", "susername")
...

Name of the column storing user’s domain.

Default value is “domain”.

Set domain_column parameter
...
modparam("alias_db", "domain_column", "sdomain")
...

Name of the column storing alias username.

Default value is “alias_username”.

Set alias_user_column parameter
...
modparam("alias_db", "alias_user_column", "auser")
...

Name of the column storing alias domain.

Default value is “alias_domain”.

Set alias_domain_column parameter
...
modparam("alias_db", "alias_domain_column", "adomain")
...

Specifies whether to use or not the domain from R-URI when searching for alias. If set to 0, the domain from R-URI is not used, if set to 1 the domain from R-URI is used.

Default value is “0”.

Set use_domain parameter
...
modparam("alias_db", "use_domain", 1)
...

Specifies the prefix to be stripped from the domain in R-URI before doing the search.

Default value is “NULL”.

Set domain_prefix parameter
...
modparam("alias_db", "domain_prefix", "sip.")
...

If the alias resolves to many SIP IDs, the first is replacing the R-URI, the rest are added as branches.

Default value is “0” (0 - don’t add branches; 1 - add branches).

Set append_branches parameter
...
modparam("alias_db", "append_branches", 1)
...

The function takes the R-URI and search to see whether it is an alias or not. If it is an alias for a local user, the R-URI is replaced with user’s SIP uri.

The function returns TRUE if R-URI is alias and it was replaced by user’s SIP uri.

Meaning of the parameters is as follows:

  • table_name - the name of the table where to search for alias. It can include pseudo-variables.

This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.

alias_db_lookup() usage
...
alias_db_lookup("dbaliases");
alias_db_lookup("dba_$(rU{s.substr,0,1})");
...

Top contributors by DevScore(1), authored commits(2) and lines added/removed(3)

#NameDevScoreCommitsLines++Lines—
1.Bogdan-Andrei Iancu (@bogdan-iancu)1812161205
2.Daniel-Constantin Mierla (@miconda)15122864
3.Stefan Darius (@dariusstefan)7324225
4.Elena-Ramona Modroiu7314289
5.Henning Westerholt (@henningw)645152
6.Sergio Gutierrez3133
7.Razvan Crainea (@razvancrainea)3122
8.Konstantin Bokarius3125
9.Edson Gellert Schubert310104

(1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits)

(2) including any documentation-related commits, excluding merge commits

(3) ignoring whitespace edits, renamed files and auto-generated files

#NameCommit Activity
1.Stefan Darius (@dariusstefan)Jun 2026 - Jul 2026
2.Razvan Crainea (@razvancrainea)Jun 2026 - Jun 2026
3.Sergio GutierrezFeb 2009 - Feb 2009
4.Bogdan-Andrei Iancu (@bogdan-iancu)Oct 2005 - Jul 2008
5.Henning Westerholt (@henningw)Dec 2007 - Jun 2008
6.Elena-Ramona ModroiuOct 2005 - May 2008
7.Daniel-Constantin Mierla (@miconda)Jun 2005 - Mar 2008
8.Konstantin BokariusMar 2008 - Mar 2008
9.Edson Gellert SchubertFeb 2008 - Feb 2008

(1) including any documentation-related commits, excluding merge commits

Last edited by: Razvan Crainea (@razvancrainea), Sergio Gutierrez, Bogdan-Andrei Iancu (@bogdan-iancu), Henning Westerholt (@henningw), Elena-Ramona Modroiu, Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert.

All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0