[Kamailio-Users] Kamailio in Red Hat 4 with mysql and carrierroute

Henning Westerholt henning.westerholt at 1und1.de
Tue Dec 16 15:22:57 CET 2008


On Tuesday 16 December 2008, Juan Asencio wrote:
> [..]
> I need to test the carrierroute module in Kamailio and I been reading the
> documentation about it.
>
> http://www.kamailio.org/docs/modules/devel/carrierroute.html#id2506610
>
> But this something entirely new for me. So I have a couple of questions
> that I hope you can answer or guide me to where I could found an answer.
>
> I need to test it with two Asterisk gateways. So I guess I need to edit my
> kamailio.cfg file as the example on "Example 1.19. Configuration example -
> module configuration" My question is: On prefix 49 and prefix NULL, are
> these the two routes available? If the prefix is 49, so the call go
> through proxy1.localdomain or proxy2.localdomain and if the prefix is NULL
> it would go through register1.localdomain or register2.localdomain?
>
> It is proxy and register the gateways?

Hi Juan,

please write this questions to the user list.
The config in question is probably: 

domain proxy {
   prefix 49 {
...
   }
}

domain register {
   prefix NULL {
...
   }
}

This defines two "domains" in the default carrier tree. The 'proxy' domain 
will be used if you specify 'proxy' in the cr_route calls, the same applies 
to the 'register' case. So if you want to distribute traffic between two 
asterisk, just use one domain, and a empty (NULL) prefix. See the following 
example config:

domain foobar {
   prefix 49 {
     max_targets = 2
      target box1.localdomain {
         prob = 0.500000
         hash_index = 1
         status = 1
         comment = "test target 1"
      }
      target box2.localdomain {
         prob = 0.500000
         hash_index = 2
         status = 1
         comment = "test target 2"
      }
   }
   prefix NULL {
     max_targets = 1
      target box3.localdomain {
         prob = 1.000000
         hash_index = 1
         status = 1
         comment = "test target 3"
      }
   }
}

This way all traffic with the prefix '49' will be equally distributed between 
box1 and box2, and all other prefixes will be routed to box3. Hope this is 
now more clear.

> Could you suggest me what to read in order to get a better understanding
> of this module?

You probably need to experiment a bit. If you increase the log level to INFO, 
then the module will report what it does, increase to DEBUG to get even more 
informations, e.g. about domain searching. Take a look to the mailing list 
archives, if you get stuck just ask at the user list.

Cheers,

Henning




More information about the sr-users mailing list