Hi,
I would like (and a many people here I believe) to have a functional of including a multiple config files like (foe example asterisk's #include "path/to/some/config.conf"). Is it possible to implement a such feature ?
Thanks!
Hello, It is already there, see http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.1.x
On 05/09/2012 06:04 PM, Konstantin M. wrote:
Hi Andrew,
I have missed that. Thank you very much!
2012/5/9 Andrew Pogrebennyk apogrebennyk@sipwise.com
After including a part of main config to included file -- I got a several errors like:
0(1582) ERROR: <core> [cfg.y:3393]: cfg. parser: failed to find command is_method 0(1582) : <core> [cfg.y:3532]: parse error in config file /opt/kamailio/etc/kamailio/debug.cfg, line 4, column 55: unknown command, missing loadmodule?
0(1582) ERROR: <core> [cfg.y:3393]: cfg. parser: failed to find command xlog 0(1582) : <core> [cfg.y:3532]: parse error in config file /opt/kamailio/etc/kamailio/debug.cfg, line 9, column 101: unknown command, missing loadmodule?
...
A part of included file /opt/kamailio/etc/kamailio/debug.cfg: ----------------------------------
route[DEBUG] { if (is_method("PUBLISH|SUBSCRIBE|REGISTER|OPTIONS")) { return; }
xlog("L_INFO", "*** UNHANDLED *** SIP Request: method [$rm], status [$rs] from [$fu] to [$tu]\n"); }
route[DEBUG_FROM] { xlog("L_NOTICE", "[$mi] Received SIP Message (method [$rm]) ($ml[$cl] bytes) from $Ri:$Rp ($si:$sp):\n$mb\n"); }
...
Do I have to duplicate the section of modules to that included file or I'm wrong ?
2012/5/9 Konstantin M. evilzluk@gmail.com
Thank you, I found a logical error in order. Also would be good if lex parser can understand a wildmasks, like: include_file "modules/*.cfg"...
2012/5/9 Andrew Pogrebennyk apogrebennyk@sipwise.com
Kamilio 3.2.0
I'd like to use one gateway as primary gateway and the another gateway as backup for failover.
I could not make it to work. Here is my table entries: Lcr_gw: +----+--------+-------------------------+-----------------+----------+------+--------+------------+-----------+-------+--------+------+-------+---------+ | id | lcr_id | gw_name | ip_addr | hostname | port | params | uri_scheme | transport | strip | prefix | tag | flags | defunct | +----+--------+-------------------------+-----------------+----------+------+--------+------------+-----------+-------+--------+------+-------+---------+ | 1 | 2 | gateway1 | 10.10.1.1 | NULL | 5060 | NULL | 1 | 0 | NULL | NULL | NULL | 0 | NULL | | 2 | 2 | gateway2 | 10.10.1.2 | NULL | 5060 | NULL | 1 | 0 | NULL | NULL | NULL | 0 | NULL |
Lcr_rule:
+-------+--------+--------+----------+---------+--------- | id | lcr_id | prefix | from_uri | stopper | enabled +-------+--------+--------+----------+---------+-------- | 1 | 2 | 1 | NULL | 0 | 1 | 2 | 2 | 011 | NULL | 0 | 1 +-------+--------+--------+----------+---------+--------
Lcr_rule_target: +-------+--------+---------+-------+----------+--------+ | id | lcr_id | rule_id | gw_id | priority | weight | +-------+--------+---------+-------+----------+--------+ | 1 | 2 | 1 | 1 | 9 | 1 | | 2 | 2 | 1 | 2 | 8 | 1 | | 3 | 2 | 2 | 1 | 9 | 1 | | 4 | 2 | 2 | 2 | 8 | 1 |
When making call , it only uses the first gateway. If first gateway failed, it could not find second gateway. What is the correct table entry for this to work?
Thanks.
Gary