Hello Daniel,
I was looking where is problem, and I see call is looping meaning coming back to caller.
I putted couple xlog to see where is breaks.


        $avp(oexten) = $rU;
        xlog("L_INFO", "This is $avp(oexten)");
        if (!lookup("location")) {
            xlog("L_INFO", "This $rU and this $du");

this is log

Mar 28 18:16:46 dsm01 /usr/sbin/kamailio[1754]: INFO: <script>: This is 1240.

In main routing logic I tried use on save location 0x04 to store last registrar for external users. Also tried use MULTIDOMAIN.

Here config file http://fpaste.org/89673/60456311/

And here debug,  I see 486 busy

http://fpaste.org/89676/46038139/


In mysql I see record in location table.

| 146 | uloc-5335f27e-6da-2 | 1240     | networklab.loc | sip:1200@192.168.100.1:57967;transport=UDP                            | NULL     | NULL | 2014-03-28 19:16:46 | -1.00 | YmRiZmE0MzQ5YTU0NjkwNTFiMmM0NDFmOGQzNTljZDg. |    2 | 2014-03-28 18:16:46 |     0 |      0 | Z 3.2.21368 r21103 | udp:192.168.100.145:5060 |    5087 | NULL     |      0 |

Slava.


From: "Daniel-Constantin Mierla" <miconda@gmail.com>
To: "Kamailio (SER) - Users Mailing List" <sr-users@lists.sip-router.org>
Sent: Thursday, March 27, 2014 2:47:38 PM
Subject: Re: [SR-Users] kamailio db

Hello,

the invite is replied with 200ok by kamailio, that should not happen. You have some wrong logic inside kamailio.cfg.

You can load debugger module and set cfgtrace parameter of it to 1, then watch the logs to see which actions from kamailio.cfg are executed for the invite.

Cheers,
Daniel

On 27/03/14 17:34, Slava Bendersky wrote:
Hello Alex,

After some testing I see on SDP call stack after first INVITE,
.


U 2014/03/27 12:29:32.680559 10.237.236.150:56892 -> 10.237.236.207:5060
INVITE sip:1200@networklab.loc;transport=UDP SIP/2.0.
Via: SIP/2.0/UDP 10.237.236.150:56892;branch=z9hG4bK-d8754z-4ac013f010b101fe-1---d8754z-.
Max-Forwards: 70.
Contact: <sip:1240@10.237.236.150:56892;transport=UDP>.
To: <sip:1200@networklab.loc;transport=UDP>.
From: "John Couch"<sip:1240@networklab.loc;transport=UDP>;tag=270d1828.
Call-ID: ZGNhMDdmOGQ1MWFhZTA2NGYwMTE1YThlM2UwNTQxYzI..
CSeq: 2 INVITE.
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE.
Content-Type: application/sdp.
Proxy-Authorization: Digest username="1240",realm="networklab.loc",nonce="UzRTGFM0Uezw+Q1ZC/KUq4LDqr7BFZZ/",uri="sip:1200@networklab.loc;transport=UDP",response="0373158cea6615a4bca50401ace5af75",cnonce="4dfbe915fff3e822e9bc5ac7c3b526f8",nc=00000001,qop=auth,algorithm=MD5.
Supported: replaces, norefersub, extended-refer, timer, X-cisco-serviceuri.
User-Agent: Z 3.2.21357 r21367.
Allow-Events: presence, kpml.
Content-Length: 165.
.
v=0.
o=Z 0 0 IN IP4 10.237.236.150.
s=Z.
c=IN IP4 10.237.236.150.
t=0 0.
m=audio 8000 RTP/AVP 0 101.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-15.
a=sendrecv.


U 2014/03/27 12:29:32.682376 10.237.236.207:5060 -> 10.237.236.150:56892
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 10.237.236.150:56892;branch=z9hG4bK-d8754z-4ac013f010b101fe-1---d8754z-.
To: <sip:1200@networklab.loc;transport=UDP>;tag=b27e1a1d33761e85846fc98f5f3a7e58.eb89.
From: "John Couch"<sip:1240@networklab.loc;transport=UDP>;tag=270d1828.
Call-ID: ZGNhMDdmOGQ1MWFhZTA2NGYwMTE1YThlM2UwNTQxYzI..
CSeq: 2 INVITE.
Server: kamailio (4.1.2 (x86_64/linux)).
Content-Length: 0.
.


U 2014/03/27 12:29:35.462838 10.237.236.150:56892 -> 10.237.236.207:5060
.



From: "Alex Balashov" <abalashov@evaristesys.com>
To: sr-users@lists.sip-router.org
Sent: Wednesday, March 26, 2014 3:24:38 PM
Subject: Re: [SR-Users] kamailio db

On 03/26/2014 03:23 PM, Slava Bendersky wrote:

> Hello Alex,
> Here config in pastebin
>
> http://pastebin.com/hKDZC1iY

I'll take a look and get back to you as soon as I can. Right now, I need
to catch a flight to Kamailio World.  :)

--
Alex Balashov - Principal
Evariste Systems LLC
235 E Ponce de Leon Ave
Suite 106
Decatur, GA 30030
United States
Tel: +1-678-954-0670
Web: http://www.evaristesys.com/, http://www.alexbalashov.com/

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users



_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference - April 2-4, 2014, Berlin, Germany
http://www.kamailioworld.com

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users