<div>Hi guys,</div><div><br></div><div>Am a SIP and Opensips newbie and am trying to create a proof of concept on a unique (I think) Opensips and SIPS implementation. Basically am developing a web-based SIP Phone based on PHP and using Opensips. Because of the nature of the application, users will have the same domain and just one proxy server which will process invites and registrations.  Based on my understanding of SIP and Opensip, I have developed a UAC that can send invites and registrations to a proxy server. My problem is coming when I have to route a call from one agent to another. According to RFC 3263 the proxy server needs to determine the sip server for the person receiving the call. Know if the proxy server of the person receiving the call and the person initiating the call is the same and both the caller and callee are on the same domain than how does Opensips route the message? </div>

<div><br></div><div>I&#39;ve worked on this the last few days and below is an excerpt from my log files. For some reason the proxy server is not able to route the message to user2 therefore it sends a message to user1 changing the SIP header from 100 to 407(Proxy authorization needed).</div>

<div><br></div><div><br></div><div>Oct 13 08:26:53 CL-T020-483CL /usr/local/sbin/opensips[19406]: DBG:tm:build_local: using FROM=&lt;From:&lt;<a href="mailto:sip%3Auser1@72.55.133.123">sip:user1@72.55.133.123</a>&gt;;tag=232523</div>

<div> &gt;, TO=&lt;To:&lt;<a href="mailto:sip%3Auser2@72.55.133.123">sip:user2@72.55.133.123</a>&gt; ;tag=9360cfebad69401b0dbd073e6bd6f131.188c</div><div> &gt;, CSEQ_N=&lt;CSeq: 3&gt;</div><div>Oct 13 08:26:53 CL-T020-483CL /usr/local/sbin/opensips[19406]: incoming reply</div>

<div>Oct 13 08:26:53 CL-T020-483CL /usr/local/sbin/opensips[19405]: DBG:core:parse_msg: SIP Request:</div><div>Oct 13 08:26:53 CL-T020-483CL /usr/local/sbin/opensips[19406]: DBG:tm:t_should_relay_response: T_code=100, new_code=407</div>

<div>Oct 13 08:26:53 CL-T020-483CL /usr/local/sbin/opensips[19405]: DBG:core:parse_msg:  method:  &lt;ACK&gt;</div><div>Oct 13 08:26:53 CL-T020-483CL /usr/local/sbin/opensips[19406]: DBG:tm:t_pick_branch: picked branch 0, code 407 (prio=501)</div>

<div>Oct 13 08:26:53 CL-T020-483CL /usr/local/sbin/opensips[19405]: DBG:core:parse_msg:  uri:     &lt;<a href="mailto:sip%3Auser2@72.55.133.123">sip:user2@72.55.133.123</a>&gt;</div><div>Oct 13 08:26:53 CL-T020-483CL /usr/local/sbin/opensips[19406]: DBG:tm:is_3263_failure: dns-failover test: branch=0, last_recv=407, flags=2</div>

<div><br></div><div><br></div><div>Could anyone give me some insights on how to go around this problem? Any help will be appreaciated.</div><div><br></div><div>regards,</div><div>james</div>