[Serusers] numbering/routing without strip()

Socrates Varakliotis S.Varakliotis at cs.ucl.ac.uk
Wed Oct 27 15:19:57 CEST 2004


Hi All:

I have SER listening to both IPv4 and IPv6 interfaces. With my current 
config, when an IPv4 soft phone wants to talk to an IPv6 soft phone I 
have to prefix the dialed number with 6, and vice-versa with prefix 4.

(Assume that my soft phones are registered with a 4-digit numbers)

The routing logic looks like this in ser.cfg:


if (uri=~"^sip:6[0-9]{4}") {
	log(0, "*****Forward to IPv6 G/W (6xxxx)*****\n");
	strip(1);
	rewritehostport("ser.xxx:5060");
	forward("46gw.xxx",5062);
	log(0, **************************************\n");
	break;
};

if (uri=~"^sip:4[0-9]{4}") {
	log(0, "*****Forward to IPv4 G/W (4xxxx)******\n");
	strip(1);
	rewritehostport("ser.xxx:5060");
	forward("64gw.xxx",5062);
	log(0, **************************************\n");
	break;
};


Ideally, I would like to not strip out the leading 6 or 4 in order to 
make a call, and use the 4-digit number the end-users have registered with.

Any ideas welcome.
--
Socrates.




More information about the sr-users mailing list