Chris,
The best way to do it is to use the aliases table. Set aliase for chris@domain.com as chris@sip.domain.com.
Then, in your route block, do
lookup("aliases"); t_relay(); /* or forward(sip.domain.com, 5060) if you want stateless */
The function forward() does not make any changes to the URI. It simply send the request to the destination inside the function. In your case, the server sip.domain.com will see incoming URI as chris@domain.com. Unless you configure sip.domain.com to accept requests for domain.com, it will relay back to domain.com and form a loop or drop completely depending on your configuration.
With lookup("aliases"), the URI will be rewritten to chris@sip.domain.com. Then t_relay() will automatically forward the request to sip.domain.com statefully. If you desire stateless handling, use forward() instead.
Zeus
-----Original Message----- From: serusers-bounces@lists.iptel.org [mailto:serusers-bounces@lists.iptel.org] On Behalf Of Chris Bond Sent: Tuesday, 13 July 2004 6:11 AM To: serusers@lists.iptel.org Subject: [Serusers] SIP Forwarding?
Hi,
I currently have the following setup and working chris@sip.domain.com incoming sip calls work fine. I want to be able to setup SER to forward incoming packets for chris@domain.com to chris@sip.domain.com.
I've tried the following but it didn't work.
route{ if (uri=~"sip:chris@domain.com") { forward(sip.domain.com, 5060); }
Can anybody help?
Kind Regards, Chris Bond
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers