[OpenSIPS-Users] Forwarding REGISTER messages to Asterisk

Alex Balashov abalashov at evaristesys.com
Fri Sep 5 08:20:39 CEST 2008

Simon Shaw wrote:
> I would like to use OpenSIPS as a pure router between some of my SIP UAs 
> and Asterisk such that when one of these UAs registers with OpenSIPS the 
> REGISTER message will be redirected to Asterisk where it will be 
> handled.   When a UA that is connected directly to the Asterisk box 
> dials one of the OpenSIPS UAs I would like the SIP INVITE to be sent 
> from the Asterisk box via OpenSIPS.
> I have managed to forward the REGISTER messages to Asterisk using 
> rewritehost(<IPofAsterisk>), however when a UA that is registered 
> directly with the Asterisk dials a UA that registered via OpenSIPS the 
> INVITE message is sent directly from Asterisk to the UA.
> I guess this is happening because Contact header in the REGISTER message 
> has the IP of the UA and not that of OpenSIPS.
> If this assumption is correct what is the correct method to change the 
> IP in the contact header?  Could the NATHelper be useful here?

The easiest thing might be to use the externip= setting if Asterisk is 
always the calling UA.  Otherwise, you will have to mangle the Contact, 

The nathelper module won't help because the Contact URI needs to be 
rewritten to the address of your proxy, not the external network IP 
detected from the UA.

Alex Balashov
Evariste Systems
Web    : http://www.evaristesys.com/
Tel    : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599

More information about the Users mailing list