Hi,
when using sip.js websocket client i got this sequence
REGISTER sip:mysip.com SIP/2.0Via: SIP/2.0/WSS 1pds95dm7slp.invalid;branch=z9hG4bK1393343Max-Forwards: 70To: <sip:1096@mysip.com>From: <sip:1096@mysip.com>;tag=99i9ka9951Call-ID: 1agj9ujebn5k2006qvosg7CSeq: 82 REGISTERAuthorization: Digest algorithm=MD5, username="1096", realm="mysip.com", nonce="VHiXFFR4legH+zdoSro9zybQQclvFtcR", uri="sip:mysip.com", response="2d9843d09d94f295d0ebfa323233783c"Contact: <sip:n7o5lk6u@1pds95dm7slp.invalid;transport=ws>;reg-id=1;+sip.instance="<urn:uuid:d68a53c4-37e7-4f5c-87f2-68d7cca14b93>";expires=600Allow: ACK,CANCEL,BYE,OPTIONS,INFO,NOTIFY,INVITE,MESSAGESupported: path,gruu,100rel,outboundUser-Agent: SIP.js/0.6.3Content-Length: 0
SIP/2.0 200 OKVia: SIP/2.0/WSS sg6h3at19h29.invalid;branch=z9hG4bK4876180;rport=65377;received=X.X.X.XTo: <sip:1096@mysip.com>;tag=78e678a5264e254e660865f4df24edf3.e69bFrom: <sip:1096@mysip.com>;tag=j39lvle827Call-ID: c0ofajiui4u2vtem662rdhCSeq: 86 REGISTERContact: <sip:8umlvk34@sg6h3at19h29.invalid;transport=ws>;expires=600;pub-gruu="sip:1096@mysip.com;gr=urn:uuid:876de649-281f-4f7f-9a3e-7b2a7e11f3cc";temp-gruu="sip:uloc-5478bf26-4504-1-7fd4326@mysip.com;gr";+sip.instance="<urn:uuid:876de649-281f-4f7f-9a3e-7b2a7e11f3cc>";reg-id=1Content-Length: 0
INVITE sip:2134@mysip.com SIP/2.0Via: SIP/2.0/WSS sg6h3at19h29.invalid;branch=z9hG4bK1752419Max-Forwards: 70To: <sip:2134@mysip.com>From: <sip:1096@mysip.com>;tag=6vii55tc02Call-ID: i3hndju3tgsge7ctnvo2CSeq: 4782 INVITEContact: <sip:1096@mysip.com;gr=urn:uuid:876de649-281f-4f7f-9a3e-7b2a7e11f3cc>Allow: ACK,CANCEL,BYE,OPTIONS,INFO,NOTIFY,INVITE,MESSAGEContent-Type: application/sdpSupported: gruu,100rel,outboundUser-Agent: SIP.js/0.6.3Content-Length: 2585
i issued kamctl show to view the registered userAOR:: 1096@mysip.comContact:: sip:8umlvk34@sg6h3at19h29.invalid;transport=ws Q=Expires:: 177Callid:: c0ofajiui4u2vtem662rdhCseq:: 86User-agent:: SIP.js/0.6.3Received:: sip:X.X.X.X:65377;transport=WSState:: CS_SYNCFlags:: 0Cflag:: 6Socket:: tls:Y.Y.Y.Y:8443Methods:: 927Ruid:: uloc-5478bf26-4504-1Instance:: <urn:uuid:876de649-281f-4f7f-9a3e-7b2a7e11f3cc>Reg-Id:: 1Last-Keepalive:: 1417200609Last-Modified:: 1417200609
what is the best way to check if the INVITE is from a registered user and how to get usrloc properties for the registered user ?
i tried this
reg_fetch_contacts("location", "$fu", "caller");$var(i) = 0;$var(found) = 0;$var(contact) = $(ct{nameaddr.uri});while($var(found) == 0 && $var(i) < $(ulc(caller=>count))){xlog("L_INFO", "$ci|log| checking against $(ulc(caller=>addr)[$var(i)])");if($var(contact) == $(ulc(caller=>addr)[$var(i)])){$var(found) = 1;$var(caller_idx) = $var(i);$var(userlocid) = $(ulc(caller=>ruid)[$var(i)]);}else$var(i) = $var(i) + 1;}
the problem i see is that the INVITE Contact doesn't match the one registered.
is this a problem with sip.js or am i missing something in kamailio.cfg or should kamailio save the contact info as sip.js is sending?
Thank you
_______________________________________________
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev