[SR-Users] How can I make calls between the two domains?

Daniel Tryba d.tryba at pocos.nl
Fri Dec 6 14:29:05 CET 2019


On Thu, Dec 05, 2019 at 10:38:10PM -0600, Yanko wrote:
> I have two virtual machines with two kamailo domains
> 
> VM1: Domain: 172.16.16.1
...
> VM2: Domain: 172.16.16.2
...
> In each domain I can make calls. For example, user 2000 can call 2001. User
> 3000 can call 3001.
> 
> How can I make calls between the two domains?
> 
> What modules do I need to load?
> How to configure the kamailio.cfg file?

You need to change the domain of the R-URI ($rd) to the other
IP address. You don't need any extra modules. You need to add some
logic, essentially you need to implement areacodes/prefixes. 

I'm not going to show you how, it is really simple and a good piece of
homework to do. ;)
But you need logic like this:
create a numberingplan you'd want to use. eg:
0161 == 172.16.16.1
0162 == 172.16.16.2

If the number ($rU) someone dials doesn't start with 0, it is a local number.
If it starts with 0, you have an areacode to match to figure out where
to send the call:

if($rU starts with 0)
{
	if(areacode is 161)
	{
		$rd="172.16.16.1";
	}
	...
}

if(uri!=myself)
{
	route(RELAY);
	exit;
}
else
{
	do local stuff.
}



More information about the sr-users mailing list