Discussion:
[SR-Users] Alias database
Alberto Llamas
2014-10-12 20:38:20 UTC
Permalink
Hello kamailio gurus,

Thanks if somebody can help me answering nex question:

I have a kamailio server as registrar server with asterisk behind. For
register porpouse the UA are using subdomain like:

100-cMK4fKSNuL9WVPTZF4YnfwC/***@public.gmane.org
200-Z2dj/***@public.gmane.org

I have to add each alias in the kamailio.cfg file an restart the sevice.

Alias="test.mydomain.com"
Alias="test2.mydomain.com"

Is there some option to add it in the database? Then i don't have to
restart the server each time i have to add/edit/delete each subdomain.

Thanks a lot,

Albert
Paul Smith
2014-10-13 07:42:00 UTC
Permalink
Hi Alberto
The magic you are looking for is in the "domain" module. The example
configuration files in the distribution have it set up and ready to use
if you add the line "#!define WITH_MULTIDOMAIN"

The important bit for your scenario is in the example config:

# ----- domain params -----
#!ifdef WITH_MULTIDOMAIN
modparam("domain", "db_url", DBURL)
# register callback to match myself condition with domains list
modparam("domain", "register_myself", 1)
#!endif

That section tells the domain module to use the database, and to include
the domains loaded from there when matching the special keyword
"myself". The example config files also set up other modules (like user
location module) to be domain aware as well.

In this setup you do not need to restart kamailio when you add or remove
domains.... but you do need to tell it to reload the domains from
database as Kamailio holds a cached copy of the list in memory.... so
when you make a database change then do "kamctl domain reload". You can
also run "kamctl domain show" to see what domains are currently listed
in memory.
Post by Alberto Llamas
Hello kamailio gurus,
I have a kamailio server as registrar server with asterisk behind. For
I have to add each alias in the kamailio.cfg file an restart the sevice.
Alias="test.mydomain.com <http://test.mydomain.com>"
Alias="test2.mydomain.com <http://test2.mydomain.com>"
Is there some option to add it in the database? Then i don't have to
restart the server each time i have to add/edit/delete each subdomain.
Thanks a lot,
Albert
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Paul Smith
2014-10-14 08:32:41 UTC
Permalink
Thanks for the feedback.
Hello Paul,
That was amazing. Thanks a lot !
On Mon, Oct 13, 2014 at 3:42 AM, Paul Smith
Hi Alberto
The magic you are looking for is in the "domain" module. The
example configuration files in the distribution have it set up and
ready to use if you add the line "#!define WITH_MULTIDOMAIN"
# ----- domain params -----
#!ifdef WITH_MULTIDOMAIN
modparam("domain", "db_url", DBURL)
# register callback to match myself condition with domains list
modparam("domain", "register_myself", 1)
#!endif
That section tells the domain module to use the database, and to
include the domains loaded from there when matching the special
keyword "myself". The example config files also set up other
modules (like user location module) to be domain aware as well.
In this setup you do not need to restart kamailio when you add or
remove domains.... but you do need to tell it to reload the
domains from database as Kamailio holds a cached copy of the list
in memory.... so when you make a database change then do "kamctl
domain reload". You can also run "kamctl domain show" to see what
domains are currently listed in memory.
Post by Alberto Llamas
Hello kamailio gurus,
I have a kamailio server as registrar server with asterisk
I have to add each alias in the kamailio.cfg file an restart the sevice.
Alias="test.mydomain.com <http://test.mydomain.com>"
Alias="test2.mydomain.com <http://test2.mydomain.com>"
Is there some option to add it in the database? Then i don't have
to restart the server each time i have to add/edit/delete each
subdomain.
Thanks a lot,
Albert
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Alberto Llamas
TelecommunicationsEngineer
Digium Certified Asterisk Professional (dCap)
Linux Administrator
Loading...