Skip to content

SPEEDDIAL module

This module provides on-server speed dial facilities. An user can store records consisting of pairs short numbers (2 digits) and SIP addresses into a table of OpenSIPS. Then it can dial the two digits whenever it wants to call the SIP address associated with them.

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.

The URL of database where the table containing speed dial records.

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

Set db_url parameter
...
modparam("speeddial", "db_url", "mysql://user:xxx@localhost/db_name")
...

The name of column storing the user name of the owner of the speed dial record.

Default value is “username”.

Set user_column parameter
...
modparam("speeddial", "user_column", "userid")
...

The name of column storing the domain of the owner of the speed dial record.

Default value is “domain”.

Set domain_column parameter
...
modparam("speeddial", "domain_column", "userdomain")
...

The name of the column storing the user part of the short dial address.

Default value is “sd_username”.

Set sd_user_column parameter
...
modparam("speeddial", "sd_user_column", "short_user")
...

The name of the column storing the domain of the short dial address.

Default value is “sd_domain”.

Set sd_domain_column parameter
...
modparam("speeddial", "sd_domain_column", "short_domain")
...

The name of the column containing the URI that will be use to replace the short dial URI.

Default value is “new_uri”.

Set new_uri_column parameter
...
modparam("speeddial", "new_uri_column", "real_uri")
...

If the domain of the owner (From URI) starts with the value of this parameter, then it is stripped before performing the lookup of the short number.

Default value is NULL.

Set domain_prefix parameter
...
modparam("speeddial", "domain_prefix", "tel.")
...

The parameter specifies wheter or not to use the domain when searching a speed dial record (0 - no domain, 1 - use domain from From URI, 2 - use both domains, from From URI and from request URI).

Default value is 0.

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

The function lookups the short dial number from R-URI in ‘table’ and replaces the R-URI with associated address.

Meaning of the parameters is as follows:

  • table - The name of the table storing the speed dial records. This parameter may include pseudovariables.
  • owner - The SIP URI of the owner of short dialing codes. If not pressent, URI of From header is used.

This function can be used from REQUEST_ROUTE.

sd_lookup usage
...
# 'speed_dial' is the default table name created by opensips db script
if(uri=~"sip:[0-9]{2}@.*")
sd_lookup("speed_dial");
# use auth username
if(uri=~"sip:[0-9]{2}@.*")
sd_lookup("speed_dial", "sip:$au@$fd");
...
#
# $Id$
#
# sample config script to use speeddial module
#
# ----------- global configuration parameters ------------------------
check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
# ------------------ module loading ----------------------------------
mpath="/usr/local/lib/opensips/modules"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "maxfwd.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "textops.so"
loadmodule "mysql.so"
loadmodule "speeddial.so"
loadmodule "mi_fifo.so"
# ----------------- setting module-specific parameters ---------------
# -- mi_fifo params --
modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")
# -- usrloc params --
modparam("usrloc", "db_mode", 0)
# ------------------------- request routing logic -------------------
# main routing logic
route{
# initial sanity checks
if (!mf_process_maxfwd_header("10"))
{
sl_send_reply("483","Too Many Hops");
exit;
};
if (msg:len >= max_len )
{
sl_send_reply("513", "Message too big");
exit;
};
if (!method=="REGISTER") record_route();
if (loose_route())
{
if (!t_relay())
{
sl_reply_error();
};
exit;
};
if (!uri==myself)
{
if (!t_relay())
{
sl_reply_error();
};
exit;
};
if (uri==myself)
{
if (method=="REGISTER")
{
save("location");
exit;
};
if(uri=~"sip:[0-9]{2}@.*")
sd_lookup("speeddial");
lookup("aliases");
if (!uri==myself)
{
if (!t_relay())
{
sl_reply_error();
};
exit;
};
if (!lookup("location"))
{
sl_send_reply("404", "Not Found");
exit;
};
};
if (!t_relay())
{
sl_reply_error();
};
}

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

#NameDevScoreCommitsLines++Lines—
1.Bogdan-Andrei Iancu (@bogdan-iancu)2720212269
2.Daniel-Constantin Mierla (@miconda)2116131141
3.Elena-Ramona Modroiu12210631
4.Stefan Darius (@dariusstefan)9436335
5.Henning Westerholt (@henningw)425243
6.Elena-Ramona Modroiu4241
7.Sergio Gutierrez4222
8.Anca Vamanu312022
9.Liviu Chircu (@liviuchircu)311616
10.Andrei Pelinescu-Onciul3193

All remaining contributors: Razvan Crainea (@razvancrainea), Konstantin Bokarius, Edson Gellert Schubert.

(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.Liviu Chircu (@liviuchircu)Mar 2014 - Mar 2014
4.Bogdan-Andrei Iancu (@bogdan-iancu)Oct 2005 - Jan 2013
5.Sergio GutierrezNov 2008 - Dec 2008
6.Daniel-Constantin Mierla (@miconda)May 2006 - Mar 2008
7.Konstantin BokariusMar 2008 - Mar 2008
8.Edson Gellert SchubertFeb 2008 - Feb 2008
9.Henning Westerholt (@henningw)Dec 2007 - Jan 2008
10.Anca VamanuOct 2007 - Oct 2007

All remaining contributors: Elena-Ramona Modroiu, Andrei Pelinescu-Onciul, Elena-Ramona Modroiu.

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

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

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