<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hello,<br>
    <br>
    that is only the part to configure the cfg_db module. That creates
    the config variables, but you need to use them somewhere in routing
    blocks, like:<br>
    <br>
    if($sel(cfg_get.my.route_addr)=="some value") ...<br>
    <br>
    Or at least you can use xlog to print the value of this variable:<br>
    <br>
    xlog("my var value is: $sel(cfg_get.my.route_addr)\n");<br>
    <br>
    Then you can see if the right value is loaded.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <br>
    On 8/18/10 7:36 PM, truong ngoc THANH wrote:
    <blockquote cite="mid:308593.83823.qm@web43137.mail.sp1.yahoo.com"
      type="cite">
      <style type="text/css"><!-- DIV {margin:0px;} --></style>
      <div style="font-family: times new roman,new york,times,serif;
        font-size: 12pt;">dear Daniel,<br>
        my configure as :<br>
        <p class="MsoNormal">I add My config in kamalio.cfg</p>
        <p class="MsoNormal">==============</p>
        <p class="MsoNormal">Loadmodule “<a moz-do-not-send="true"
            target="_blank" href="http://cfg_db.so/">cfg_db.so</a>”</p>
        <p class="MsoNormal">modparam("cfg_db", "db_url",
          "mysql://openser:openserrw &lt;at&gt; localhost/kamailio")</p>
        <p class="MsoNormal">modparam("cfg_db", "transl_tbl",
          "cfg_transl")</p>
        <p class="MsoNormal">modparam("cfg_db", "custom_tbl",
          "cfg_custom")</p>
        <p class="MsoNormal">  </p>
        <p class="MsoNormal">I add and insert in mysql as:</p>
        <p class="MsoNormal">===============</p>
        <p class="MsoNormal"><span>cfg_transl table:</span></p>
        <p class="MsoNormal"><span><span>        </span>group_name|name|cfg_table|cfg_table_group_name_field|cfg_table_name_field|cfg_table_value_field</span></p>
        <p class="MsoNormal"><span><span>        </span>core|use_dst_blacklist|cfg_dns|||</span></p>
        <p class="MsoNormal"><span><span>        </span>core|dst_blacklist_mem|cfg_dns|||</span></p>
        <p class="MsoNormal"><span><span>        </span>core|dst_blacklist_expire|||</span></p>
        <p class="MsoNormal"><span><span>        </span>my|route_addr|cfg_my|my_group_name|my_name|my_value<span>  
            </span>; overrides &lt;default&gt; values</span></p>
        <p class="MsoNormal"><span><span>        </span>my|use_rtp_proxy|cfg_my|my_group_name|my_name|my_value</span></p>
        <p class="MsoNormal"><span><span>        </span>*|*||||<span> </span>;
            matches all param ids, points to tables defined in row
            &lt;default&gt;</span></p>
        <p class="MsoNormal"><span><span>        </span>&lt;default&gt;||cfg_var|group_name|name|value<span> 
            </span>; default cfg_table* values</span></p>
        <p class="MsoNormal"><span><span>               </span></span></p>
        <p class="MsoNormal"><span><span>        </span>cfg_custom
            table:</span></p>
        <p class="MsoNormal"><span><span>        </span>group_name|name|value_type|min_value|max_value|description</span></p>
        <p class="MsoNormal"><span><span>        </span>my|route_addr|S|||Routing

            address</span></p>
        <p class="MsoNormal"><span><span>        </span>my|use_rtp_proxy|I|0|1|Use

            RTP proxy</span></p>
        <p class="MsoNormal"><span><span>        </span></span></p>
        <p class="MsoNormal"><span><span>        </span>cfg_var table:</span></p>
        <p class="MsoNormal"><span><span>        </span>group_name|my_name|value</span></p>
        <p class="MsoNormal"><span><span>        </span>core|debug|4</span></p>
        <p class="MsoNormal"><span><span>        </span></span></p>
        <p class="MsoNormal"><span><span>        </span>cfg_my table:</span></p>
        <p class="MsoNormal"><span><span>        </span>my_group_name|my_name|my_value</span></p>
        <p class="MsoNormal"><span><span>        </span>my|route_addr|127.0.0.1</span></p>
        <p class="MsoNormal"><span><span>        </span>my|use_rtp_proxy|1</span></p>
        <p class="MsoNormal"><span><span>        </span></span></p>
        <p class="MsoNormal"><span><span>        </span>cfg_dns table:</span></p>
        <p class="MsoNormal"><span><span>        </span>group_name|name|value</span></p>
        <p class="MsoNormal"><span><span>        </span>dns|use_dst_blacklist|1</span></p>
        <p class="MsoNormal"><span><span>        </span>dns|dst_blacklist_mem|1024</span></p>
        <p class="MsoNormal"><span><span>        </span>dns|dst_blacklist_expire|60</span></p>
        <p class="MsoNormal"><br>
          <span></span></p>
        <p class="MsoNormal"><span>so please suggest me to test or
            insert some </span>variables to make it work.</p>
        <p class="MsoNormal">thanks so much.<br>
        </p>
        <br>
        <br>
        <div> </div>
        TRUONG NGOC THANH<br>
        Telecommunications Engineer<br>
        Tel: 0984 480 646<br>
        Y!M: ngoc217thanh
        <div><br>
        </div>
        <div style="font-family: times new roman,new york,times,serif;
          font-size: 12pt;"><br>
          <div style="font-family: times new roman,new york,times,serif;
            font-size: 12pt;"><font face="Tahoma" size="2">
              <hr size="1"><b><span style="font-weight: bold;">From:</span></b>
              Daniel-Constantin Mierla <a class="moz-txt-link-rfc2396E" href="mailto:miconda@gmail.com">&lt;miconda@gmail.com&gt;</a><br>
              <b><span style="font-weight: bold;">To:</span></b> truong
              ngoc THANH <a class="moz-txt-link-rfc2396E" href="mailto:ngoc217thanh@yahoo.com">&lt;ngoc217thanh@yahoo.com&gt;</a><br>
              <b><span style="font-weight: bold;">Cc:</span></b>
              kamailio <a class="moz-txt-link-rfc2396E" href="mailto:sr-users@lists.sip-router.org">&lt;sr-users@lists.sip-router.org&gt;</a><br>
              <b><span style="font-weight: bold;">Sent:</span></b> Thu,
              August 19, 2010 12:26:27 AM<br>
              <b><span style="font-weight: bold;">Subject:</span></b>
              Re: [SR-Users] help to config cfg_db module in kamailio
              3.0.1<br>
            </font><br>
            <br>
            <br>
            On 8/18/10 7:20 PM, truong ngoc THANH wrote:
            <blockquote type="cite">
              <div style="font-family: times new roman,new
                york,times,serif; font-size: 12pt;">i don`t know, the
                kamailio is start ok,</div>
            </blockquote>
            <br>
            is command 'ps auxw|grep kamailio' showing you some running
            kamailio processes?<br>
            <br>
            <blockquote type="cite">
              <div style="font-family: times new roman,new
                york,times,serif; font-size: 12pt;"> but my configure in
                cfg_db is not work.<br>
                please suggest what i do and what happen ?<br>
              </div>
            </blockquote>
            <br>
            How you figure out is not working? How do you use those
            variables in your config?<br>
            <br>
            Cheers,<br>
            Daniel<br>
            <br>
            <blockquote type="cite">
              <div style="font-family: times new roman,new
                york,times,serif; font-size: 12pt;">thanks for help me.
                <br>
                <div> </div>
                TRUONG NGOC THANH<br>
                Telecommunications Engineer<br>
                Tel: 0984 480 646<br>
                Y!M: ngoc217thanh
                <div><br>
                </div>
                <div style="font-family: times new roman,new
                  york,times,serif; font-size: 12pt;"><br>
                  <div style="font-family: times new roman,new
                    york,times,serif; font-size: 12pt;"><font
                      face="Tahoma" size="2">
                      <hr size="1"><b><span style="font-weight: bold;">From:</span></b>
                      Daniel-Constantin Mierla <a
                        moz-do-not-send="true" rel="nofollow"
                        class="moz-txt-link-rfc2396E"
                        ymailto="mailto:miconda@gmail.com"
                        target="_blank" href="mailto:miconda@gmail.com">&lt;miconda@gmail.com&gt;</a><br>
                      <b><span style="font-weight: bold;">To:</span></b>
                      truong ngoc THANH <a moz-do-not-send="true"
                        rel="nofollow" class="moz-txt-link-rfc2396E"
                        ymailto="mailto:ngoc217thanh@yahoo.com"
                        target="_blank"
                        href="mailto:ngoc217thanh@yahoo.com">&lt;ngoc217thanh@yahoo.com&gt;</a><br>
                      <b><span style="font-weight: bold;">Cc:</span></b>
                      kamailio <a moz-do-not-send="true" rel="nofollow"
                        class="moz-txt-link-rfc2396E"
                        ymailto="mailto:sr-users@lists.sip-router.org"
                        target="_blank"
                        href="mailto:sr-users@lists.sip-router.org">&lt;sr-users@lists.sip-router.org&gt;</a><br>
                      <b><span style="font-weight: bold;">Sent:</span></b>
                      Thu, August 19, 2010 12:16:40 AM<br>
                      <b><span style="font-weight: bold;">Subject:</span></b>
                      Re: [SR-Users] help to config cfg_db module in
                      kamailio 3.0.1<br>
                    </font><br>
                    Hello,<br>
                    <br>
                    On 8/18/10 6:34 PM, truong ngoc THANH wrote:
                    <blockquote type="cite">
                      <div style="font-family: times new roman,new
                        york,times,serif; font-size: 12pt;">Thanks so
                        much,<br>
                        but the log is more.<br>
                        <br>
                        0(2285) DEBUG: &lt;core&gt; [main.c:1800]: read
                        972552225 from /dev/urandom<br>
                         0(2285) DEBUG: &lt;core&gt; [main.c:1806]:
                        seeding PRNG with 2254742755<br>
                         0(2285) DEBUG: &lt;core&gt; [main.c:1810]: test
                        random numbers 1619886338 1418625528 2344803195<br>
                        loading modules under
                        /usr/local/lib/kamailio/modules_k/:/usr/local/lib/kamailio/modules/<br>
                         0(2285) WARNING: &lt;core&gt;
                        [socket_info.c:896]: WARNING: fix_hostname:
                        could not rev. resolve 192.168.1.40<br>
                        Listening on<br>
                                     udp: 192.168.1.40:5060<br>
                        Aliases:<br>
                        <br>
                         0(2285) DEBUG: &lt;core&gt; [cfg/cfg.c:172]:
                        DEBUG: register_cfg_def(): new config group has
                        been registered: 'core' (num=35, size=140)<br>
                         0(2285) DEBUG: &lt;core&gt; [cfg/cfg.c:172]:
                        DEBUG: register_cfg_def(): new config group has
                        been registered: 'tcp' (num=24, size=96)<br>
                         0(2285) DEBUG: &lt;core&gt; [timer.c:270]:
                        init_timer: starting with *ticks=52682242<br>
                         0(2285) DEBUG: &lt;core&gt; [timer.c:312]:
                        init_timer: timer_list between 0xb5f49268 and
                        0xb5f6b268<br>
                         0(2285) INFO: &lt;core&gt; [tcp_main.c:4150]:
                        init_tcp: using epoll_lt as the io watch method
                        (auto detected)<br>
                         0(2289) DEBUG: &lt;core&gt; [daemonize.c:364]:
                        core dump limits set to 4294967295<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:857]:
                        DEBUG: init_mod: db_mysql<br>
                         0(2289) DEBUG: db_mysql [km_db_mysql.c:92]:
                        MySQL client version is 5.0.77<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:871]:
                        DEBUG: init_mod: mi_fifo<br>
                         0(2289) DEBUG: mi_fifo [mi_fifo.c:122]: testing
                        mi_fifo existance ...<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:871]:
                        DEBUG: init_mod: kex<br>
                         0(2289) DEBUG: &lt;core&gt; [statistics.c:105]:
                        statistics manager successfully initialized<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:857]:
                        DEBUG: init_mod: tm<br>
                        [root@appliance kamailio]#  0(2289) DEBUG: tm
                        [tm.c:706]: TM - (sizeof cell=3152, sip_msg=860)
                        initializing...<br>
                         0(2289) DEBUG: tm [callid.c:101]: Call-ID
                        initialization: '5fffff36'<br>
                         0(2289) DEBUG: tm [lock.c:87]: DEBUG:
                        lock_initialize: lock initialization started<br>
                         0(2289) DEBUG: tm [timer.c:242]: tm:
                        tm_init_timers: fr=480 fr_inv=1920 wait=80
                        delete=4 t1=8 t2=64 max_inv_lifetime=2880
                        max_noninv_lifetime=512<br>
                         0(2289) DEBUG: &lt;core&gt; [cfg/cfg.c:172]:
                        DEBUG: register_cfg_def(): new config group has
                        been registered: 'tm' (num=33, size=136)<br>
                         0(2289) DEBUG: &lt;core&gt; [md5utils.c:87]:
                        DEBUG: MD5 calculated:
                        203c2e849e2a007f7c0b097d3f734545<br>
                         0(2289) DEBUG: &lt;core&gt; [md5utils.c:87]:
                        DEBUG: MD5 calculated:
                        78d79373441c680dd4e4ed1a014efb8e<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:871]:
                        DEBUG: init_mod: tmx<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;load_tm&gt; in
                        module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;register_tmcb&gt;
                        in module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;t_newtran&gt; in
                        module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;t_relay_to_tcp&gt;
                        in module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;t_relay_to_udp&gt;
                        in module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;t_relay&gt; in
                        module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found
                        &lt;t_reply_with_body&gt; in module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;t_is_local&gt; in
                        module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found
                        &lt;t_get_trans_ident&gt; in module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;t_lookup_ident&gt;
                        in module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;t_add_blind&gt; in
                        module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found
                        &lt;t_forward_nonack&gt; in module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found
                        &lt;t_request_within&gt; in module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found
                        &lt;t_request_outside&gt; in module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;t_request&gt; in
                        module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;new_dlg_uac&gt; in
                        module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found
                        &lt;dlg_response_uac&gt; in module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;new_dlg_uas&gt; in
                        module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;update_dlg_uas&gt;
                        in module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found
                        &lt;dlg_request_uas&gt; in module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;set_dlg_target&gt;
                        in module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;free_dlg&gt; in
                        module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;print_dlg&gt; in
                        module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;t_gett&gt; in
                        module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found
                        &lt;calculate_hooks&gt; in module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;t_uac&gt; in
                        module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;t_uac_with_ids&gt;
                        in module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;t_release&gt; in
                        module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;t_unref&gt; in
                        module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found
                        &lt;run_failure_handlers&gt; in module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;cancel_uacs&gt; in
                        module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found
                        &lt;cancel_all_uacs&gt; in module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;t_suspend&gt; in
                        module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:506]:
                        find_export_record: found &lt;t_continue&gt; in
                        module tm
                        [/usr/local/lib/kamailio/modules/tm.so]<br>
                         0(2289) DEBUG: &lt;core&gt; [sr_module.c:871]:
                        DEBUG: init_mod: sl<br>
                        <br>
                        <br>
                        more and more....<br>
                        i have just see one error in my cfg_custom
                        table. after i corect it. i start kamailio ok,
                        but i don`t see any change when cfg_db work ?<br>
                      </div>
                    </blockquote>
                    yes, the log is more, and I do not see the error
                    message here. What do you mean with last question,
                    does it start ok now?<br>
                    <br>
                    Cheers,<br>
                    Daniel<br>
                    <pre class="moz-signature">-- 
Daniel-Constantin Mierla
<span><span><a moz-do-not-send="true" target="_blank" href="http://www.asipto.com/">http://www.asipto.com/</a></span></span>
</pre>
                  </div>
                </div>
              </div>
              <br>
            </blockquote>
            <br>
            <pre class="moz-signature">-- 
Daniel-Constantin Mierla
<a moz-do-not-send="true" rel="nofollow" class="moz-txt-link-freetext" target="_blank" href="http://www.asipto.com/">http://www.asipto.com/</a>
</pre>
          </div>
        </div>
      </div>
      <br>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://www.asipto.com/">http://www.asipto.com/</a>
</pre>
  </body>
</html>