But when does the proxy create a location record? When the callee phone registers it gets an authenticate challenge and after the challenge it gets a 200 Ok header.
When the caller phone calls it gets a 407 proxy challenge and after verification gets a 100 response. According to my understanding the proxy creates a location record for the person being called, however this is not entered into the database so where is it? Below is a snippet of my invite and register code in opensips.cfg if (!(method=="REGISTER") && from_uri==myself) /*no multidomain version*/ ##if (!(method=="REGISTER") && is_from_local()) /*multidomain */ ## { if (!proxy_authorize("", "subscriber")) { proxy_challenge("", "0"); exit; } if (!db_check_from()) { sl_send_reply("403","Forbidden auth ID"); exit; } consume_credentials(); ## # caller authenticated } if (is_method("REGISTER")) { # authenticate the REGISTER requests (uncomment to enable auth) if (!www_authorize("", "subscriber")) { www_challenge("", "0"); exit; } ## if (!db_check_to()) { sl_send_reply("403","Forbidden auth ID"); exit; } if (!save("location")) sl_reply_error(); exit; } } The proxy does not save the location details under the location table however sending an invite before the callee has been registered results in a 405. So, where does the proxy save the callee location if its not saving on the database? And how do I need to go around that? On 10/13/10, Bogdan-Andrei Iancu <bog...@voice-system.ro> wrote: > Right, and before that, when receiving a request, a proxy looks at the > domain part of RURI to see if that domain is a SIP domain that can be > locally handled or a it is a foreign SIP domain that need to forward to > another SIP server. > > So, check if the domain RURI is a local domain - see the default > opensips.cfg for an example how to do it. > > Regards, > Bogdan > > Duane Larson wrote: >> >> I could be wrong but does your phone register with the proxy and then >> the proxy create a location record for each user? That would be how >> opensips would know how to route it. >> >>> On Oct 13, 2010 1:04 PM, "James Mbuthia" <jmmbut...@gmail.com >>> <mailto:jmmbut...@gmail.com>> wrote: >>> >>> Hi guys, >>> >>> 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? >>> >>> I'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). >>> >>> >>> Oct 13 08:26:53 CL-T020-483CL /usr/local/sbin/opensips[19406]: >>> DBG:tm:build_local: using FROM=<From:<sip:us...@72.55.133.123 >>> <mailto:sip%3aus...@72.55.133.123>>;tag=232523 >>> >, TO=<To:<sip:us...@72.55.133.123 >>> <mailto:sip%3aus...@72.55.133.123>> >>> ;tag=9360cfebad69401b0dbd073e6bd6f131.188c >>> >, CSEQ_N=<CSeq: 3> >>> Oct 13 08:26:53 CL-T020-483CL /usr/local/sbin/opensips[19406]: >>> incoming reply >>> Oct 13 08:26:53 CL-T020-483CL /usr/local/sbin/opensips[19405]: >>> DBG:core:parse_msg: SIP Request: >>> 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 >>> Oct 13 08:26:53 CL-T020-483CL /usr/local/sbin/opensips[19405]: >>> DBG:core:parse_msg: method: <ACK> >>> 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) >>> Oct 13 08:26:53 CL-T020-483CL /usr/local/sbin/opensips[19405]: >>> DBG:core:parse_msg: uri: <sip:us...@72.55.133.123 >>> <mailto:sip%3aus...@72.55.133.123>> >>> 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 >>> >>> >>> Could anyone give me some insights on how to go around this problem? >>> Any help will be appreaciated. >>> >>> regards, >>> james >>> >>> _______________________________________________ >>> Users mailing list >>> Users@lists.opensips.org <mailto:Users@lists.opensips.org> >>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users >>> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users@lists.opensips.org >> http://lists.opensips.org/cgi-bin/mailman/listinfo/users >> > > > -- > Bogdan-Andrei Iancu > OpenSIPS Bootcamp > 15 - 19 November 2010, Edison, New Jersey, USA > www.voice-system.ro > > > _______________________________________________ > Users mailing list > Users@lists.opensips.org > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > _______________________________________________ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users