[SR-Users] Alias database

Paul Smith paul.smith at claritytele.com
Mon Oct 13 09:42:00 CEST 2014


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.


On 12/10/14 21:38, Alberto Llamas wrote:
>
> 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 at test.mydomain.com <mailto:100 at test.mydomain.com>
> 200 at test2.mydomain.com <mailto:200 at test2.mydomain.com>
>
> 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
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20141013/797b1ce3/attachment.html>


More information about the sr-users mailing list