[Serusers] How SER communicate to other SIP server

Olaf Bergmann Olaf.Bergmann at freenet-ag.de
Tue Jul 3 09:07:15 CEST 2007


roayu wrote:
> Hi, Olaf!
> 
> I've used 'rewritehostport("sipB.net:5060")' under the INVITE message
> handler.
> 
> The following are my configuration, pls correct me if I'm wrong.
> 	if(uri =~ "^sip:[0-9{8}@.*") {
> 		if(!proxy_authorise("","subscriber")){
> 			proxy_challenge("","0");
> 			break;
> 
> 		}else if(!check_from()) {
> 			sl_send_reply("403","Use From ID");
> 			break;
> 		};
> 		
> 		consume_credentials();
> 		rewritehostport("sipB.net:5060");
> 		setflag(1);
> 		route(1);
> 		break;
> 	}
> 
> When I dialed 8-digit of the number, it will pass to another SIP
> server(sipB.net). But on the TO header, I still found that the TO address
> still under the sipSER.net. You may refer to the following.
> 	From 	: <sip:12345 at sipSER.net:5060>
> 	To	: <sip:88888888 at sipSER.net:5060>
> Does that means that it's still looping inside sipSER.net instead of routing
> to sipB.net? If yes, how do I change the TO header or make it route to
> sipB.net?

No, SIP messages are routed according to their request URI. I am not
sure if the regular expression in your if-clause was corrupted by
the E-Mail service (if not, at least a closing bracket is missing).
I suggest, you start with a simplified version of this regexp to be
sure that the then-part is evaluated at all. Use xlog() to add a
couple of debug messages to find out which routing blocks are evaluated.

Regards,
Olaf



More information about the sr-users mailing list