Michel,

The prob field is to set the proportion of a certain entry to be taken when you are load balancing between carriers.

To perform an overflow operation you have to use the domain field.

Check the samples on the module documentation; it's preety clear there; if you have further questions just post them here.

Rgds,
Uriel

On Wed, Jul 29, 2009 at 10:39 AM, michel freiha <michofr@gmail.com> wrote:
Hi all,

I'm using carrierroute module and ie seems that it's not working well...Suppose I have 2 entries in carrierroute table...Entry 1 with scan prefix 00 and prob 0 and a second entry with scan prefix 00 and prob=1...As soon as i make a call, this call will be forwarded to the entry with prob 0 because i guess it appears before the one with prob 1 in the table...

When starting Kamailio I got the below:

Jul 29 12:30:11 [23143] INFO:carrierroute:add_route: adding prefix 1, prob -14931260.000000
Jul 29 12:30:11 [23143] INFO:carrierroute:get_route_tree: domain 0 not found, add it
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route_tree: tree default has 1 trees
Jul 29 12:30:11 [23143] DBG:carrierroute:add_route_tree: tree 0Jul 29 12:30:11 [23143] INFO:carrierroute:get_route_tree: created route tree: 0, with id 0
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route: found route, now adding
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route_rule: no backed up rules
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route: adding prefix , prob -14931260.000000
Jul 29 12:30:11 [23143] INFO:carrierroute:get_route_tree: found domain 0
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route: found route, now adding
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route_rule: no backed up rules
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route: adding prefix 011, prob -14931260.000000
Jul 29 12:30:11 [23143] INFO:carrierroute:get_route_tree: found domain 0
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route: found route, now adding
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route_rule: no backed up rules
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route: adding prefix 00, prob -14931260.000000
Jul 29 12:30:11 [23143] INFO:carrierroute:get_route_tree: found domain 0
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route: found route, now adding
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route_rule: no backed up rules
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route: adding prefix 111, prob -14931260.000000
Jul 29 12:30:11 [23143] INFO:carrierroute:get_route_tree: found domain 0
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route: found route, now adding
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route_rule: no backed up rules
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route: adding prefix 00, prob -14931260.000000
Jul 29 12:30:11 [23143] INFO:carrierroute:get_route_tree: found domain 0
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route: found route, now adding
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route_rule: no backed up rules
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route: adding prefix , prob -14931260.000000
Jul 29 12:30:11 [23143] INFO:carrierroute:get_route_tree: found domain 0
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route: found route, now adding
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route_rule: no backed up rules
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route: adding prefix 011, prob -14931260.000000
Jul 29 12:30:11 [23143] INFO:carrierroute:get_route_tree: found domain 0
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route: found route, now adding
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route_rule: no backed up rules
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route: adding prefix 011, prob -14931260.000000
Jul 29 12:30:11 [23143] INFO:carrierroute:get_route_tree: found domain 0
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route: found route, now adding
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route_rule: no backed up rules
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route: adding prefix , prob -14931260.000000
Jul 29 12:30:11 [23143] INFO:carrierroute:get_route_tree: found domain 0
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route: found route, now adding
Jul 29 12:30:11 [23143] INFO:carrierroute:add_route_rule: no backed up rules

It seems that kamailio is not reading probability entry in carrier route table

Please find below carrierroute table structure:

CREATE TABLE IF NOT EXISTS `carrierroute` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `carrier` int(10) unsigned NOT NULL default '0',
  `domain` varchar(64) NOT NULL default '',
  `scan_prefix` varchar(64) NOT NULL default '',
  `flags` int(11) unsigned NOT NULL default '0',
  `mask` int(11) unsigned NOT NULL default '0',
  `prob` float NOT NULL default '0',
  `strip` int(11) unsigned NOT NULL default '0',
  `rewrite_host` varchar(128) NOT NULL default '',
  `rewrite_prefix` varchar(64) NOT NULL default '',
  `rewrite_suffix` varchar(64) NOT NULL default '',
  `description` varchar(255) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=23 ;


Can someone help me to find this issue?

Regards

_______________________________________________
Kamailio (OpenSER) - Users mailing list
Users@lists.kamailio.org
http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
http://lists.openser-project.org/cgi-bin/mailman/listinfo/users