[OpenSIPS-Users] Change Via-port based on Destination-port

joel.oliveira joel.oliveira at interacesso.pt
Thu Jun 9 14:10:44 CEST 2011


Hello Bogdan,

Thanks for your reply. Yes, I had already the force_rport in the beginning
of the script.

After some more analisys I found out that my problem wasn't with the first
Invite but with the one that is branched to the client, the one that is
generated by OpenSIPs and that is the one that has differences between the
ports in the request and the destination part of the message.

After some time I figured out a way on doing this by changing the
branch_route to:

branch_route[2] {

	xlog("New branch at $ru\n");
	
	if(is_method("INVITE") && $du != NULL)
	{
		# if RURI-domain is equal to the destination-domain and their ports are
different substitute RURI-port with the destination-port
		if( $(du{uri.host}) == $rd && $(du{uri.port}) != $rp )
			$rp = $(du{uri.port});
	}
	
}

By this I managed to imitate the Asterisk's behaviour :)

Best Regards,
Joel Oliveira

--
View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Change-Via-port-based-on-Destination-port-tp6454274p6457531.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.



More information about the Users mailing list