UA ---------- SER --------- Asterisk (with registration, authentication, etc) -------- PSTN gateway

                                                  (redirects)

Now when I want my UA to register to asterisk I send I register request to SER, the SER then gives back a 302 message and give the ip address of the Asterisk indicates redirection. Then the UA should directly contact Asterisk and get it self register and SER should not be involved. But I am unable to register and asterisk gives me back 407  proxy authentication required. Though I can make call with right credentials I can not receive calls since the Asterisk does not know where the UA is and thus I cant have incoming calls. Also both my asterisk and Ser are in different domain. Can that be the problem or not???

Here is what I hv configured
 if (method="REGISTER"){
        rewritehostport('ip address of asterisk:5060");
        sl_send_reply("302" , "moved");
        }      

Is there any error in this
Pls folks help me out, I hv to get this working

Thanks
Dipen K Gala
Fidelity Investments System Company - Telecom
Phone: (617) 563-2729
Email: Dipen.Gala@FMR.com