[SR-Users] Cannot get message routing for websockets "invalid" URI
Sergey Safarov
s.safarov at gmail.com
Wed Feb 13 17:29:03 CET 2019
I have configured websocket usage using this module description
https://kamailio.org/docs/modules/devel/modules/websocket.html
Added registrar and usrloc modules
Registration saved using this block
route[REGISTRAR] {
if(!is_method("REGISTER"))
return;
if (!save("location")) {
xlog("L_INFO", "Location save error\n");
sl_reply_error();
}
}
Now in database i can see WebRTC client registration
{
"jsonrpc": "2.0",
"result": {
"Domains": [{
"Domain": {
"Domain": "location",
"Size": 1024,
"AoRs": [{
"Info": {
"AoR": "1000",
"HashID": 924766747,
"Contacts": [{
"Contact": {
"Address": "sips:1000 at df7jal23ls0d.invalid
;rtcweb-breaker=no;transport=wss",
"Expires": 155,
"Q": -1,
"Call-ID": "0c818ac1-5e77-bd4c-b7fe-a135d6c6a4bf",
"CSeq": 61442,
"User-Agent": "IM-client/OMA1.0 sipML5-v1.2016.03.04",
"Received": "[not set]",
"Path": "[not set]",
"State": "CS_SYNC",
"Flags": 0,
"CFlags": 0,
"Socket": "tls:192.168.2.10:7443",
"Methods": -1,
"Ruid": "uloc-5c643a67-4b56-1",
"Instance": "[not set]",
"Reg-Id": 0,
"Server-Id": 0,
"Tcpconn-Id": 2,
"Keepalive": 0,
"Last-Keepalive": 1550074434,
"Last-Modified": 1550074434
}
}]
}
}
],
"Stats": {
"Records": 1,
"Max-Slots": 1
}
}
}]
},
"id": 19493
}
Now I try deliver call to WebRTC client. Kamailio receives message
INVITE sip:1001 at 192.168.30.2 SIP/2.0
Via: SIP/2.0/UDP 192.168.30.2:45060;rport;branch=z9hG4bK5gaK3B38egZQH
Route: <sip:192.168.2.10>
Max-Forwards: 70
From: "" <sip:0000000000 at 192.168.30.2>;tag=8e7Za8pD6pcKg
To: <sip:1001 at 192.168.30.2>
Call-ID: 989274f0-aa4d-1237-08a1-94b86deaeed5
CSeq: 483510 INVITE
Contact: <sip:mod_sofia at 192.168.30.2:45060>
User-Agent:
FreeSWITCH-mod_sofia/1.8.4+git-20181228T070140Z~a0377e9677~64bit
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE,
REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: timer, path, replaces
Allow-Events: talk, hold, conference, presence, as-feature-event,
dialog, line-seize, call-info, sla, include-session-description,
presence.winfo, message-summary, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 621
X-FS-Support: update_display,send_info
Remote-Party-ID: <sip:0000000000 at 192.168.30.2
>;party=calling;screen=yes;privacy=off
Expected that Kamailio using follow config block route message to WEbRTC
client via websocket.
route[FROM_FS] {
record_route();
if (!lookup("location")) {
$var(rc) = $rc;
t_newtran();
switch ($var(rc)) {
case -1:
case -3:
send_reply("404", "Not Found");
exit;
case -2:
send_reply("405", "Method Not Allowed");
exit;
}
}
route(RELAY);
exit;
}
But really Kamailio try resolve "sips:1000 at df7jal23ls0d.invalid" URI via
DNS and deliver for non locally connected device
3(19341) exec: *** cfgtrace:request_route=[DEFAULT_ROUTE]
c=[/usr/local/etc/kamailio/kamailio.cfg] l=238 a=16 n=if
3(19341) exec: *** cfgtrace:request_route=[DEFAULT_ROUTE]
c=[/usr/local/etc/kamailio/kamailio.cfg] l=231 a=41 n=isflagset
3(19341) exec: *** cfgtrace:request_route=[DEFAULT_ROUTE]
c=[/usr/local/etc/kamailio/kamailio.cfg] l=232 a=5 n=route
3(19341) exec: *** cfgtrace:request_route=[FROM_FS]
c=[/usr/local/etc/kamailio/kamailio.cfg] l=266 a=24 n=record_route
3(19341) exec: *** cfgtrace:request_route=[FROM_FS]
c=[/usr/local/etc/kamailio/kamailio.cfg] l=281 a=16 n=if
3(19341) exec: *** cfgtrace:request_route=[FROM_FS]
c=[/usr/local/etc/kamailio/kamailio.cfg] l=267 a=25 n=lookup
3(19341) DEBUG: registrar [lookup.c:255]: lookup_helper(): contact for
[1000] found by address
3(19341) exec: *** cfgtrace:request_route=[FROM_FS]
c=[/usr/local/etc/kamailio/kamailio.cfg] l=281 a=5 n=route
3(19341) exec: *** cfgtrace:request_route=[RELAY]
c=[/usr/local/etc/kamailio/kamailio.cfg] l=289 a=16 n=if
3(19341) exec: *** cfgtrace:request_route=[RELAY]
c=[/usr/local/etc/kamailio/kamailio.cfg] l=286 a=24 n=t_relay
3(19341) DEBUG: tm [t_lookup.c:1326]: t_newtran(): msg id=2 , global msg
id=2 , T on entrance=0
3(19341) DEBUG: tm [t_lookup.c:483]: t_lookup_request(): start searching:
hash=7468, isACK=0
3(19341) DEBUG: tm [t_lookup.c:441]: matching_3261(): RFC3261 transaction
matching failed - via branch [z9hG4bK72v4614F91BXr]
3(19341) DEBUG: tm [t_lookup.c:666]: t_lookup_request(): no transaction
found
3(19341) DEBUG: tm [t_hooks.c:348]: run_reqin_callbacks_internal():
trans=0x7fbb0b1d0d40, callback type 1, id 0 entered
3(19341) DEBUG: <core> [core/md5utils.c:67]: MD5StringArray(): MD5
calculated: 07ad473ba02a6d3a4f8753a378c102e8
3(19341) DEBUG: tm [t_funcs.c:324]: t_relay_to(): new INVITE
3(19341) DEBUG: tm [t_reply.c:596]: _reply_light(): reply sent out.
buf=0x7fbb0f256750: SIP/2.0 100 trying -..., shmem=0x7fbb0b1e75d8: SIP/2.0
100 trying -
3(19341) DEBUG: tm [t_reply.c:607]: _reply_light(): finished
3(19341) DEBUG: <core> [core/dns_cache.c:527]: _dns_hash_find():
(_sips._tcp.df7jal23ls0d.invalid(31), 33), h=232
3(19341) DEBUG: <core> [core/resolve.c:967]: get_record(): skipping 1 NS
(p=0x561007b83e71, end=0x561007b83ebc)
3(19341) DEBUG: <core> [core/resolve.c:980]: get_record(): parsing 0 ARs
(p=0x561007b83ebc, end=0x561007b83ebc)
3(19341) DEBUG: <core> [core/dns_cache.c:761]: dns_cache_mk_bad_entry():
(_sips._tcp.df7jal23ls0d.invalid, 33, 60, 1)
3(19341) DEBUG: <core> [core/dns_cache.c:701]: dns_cache_add(): adding
_sips._tcp.df7jal23ls0d.invalid(31) 33 (flags=1) at 232
3(19341) DEBUG: <core> [core/dns_cache.c:527]: _dns_hash_find():
(df7jal23ls0d.invalid(20), 1), h=139
3(19341) DEBUG: <core> [core/resolve.c:967]: get_record(): skipping 1 NS
(p=0x561007b83e66, end=0x561007b83eb1)
3(19341) DEBUG: <core> [core/resolve.c:980]: get_record(): parsing 0 ARs
(p=0x561007b83eb1, end=0x561007b83eb1)
3(19341) DEBUG: <core> [core/dns_cache.c:761]: dns_cache_mk_bad_entry():
(df7jal23ls0d.invalid, 1, 60, 1)
3(19341) DEBUG: <core> [core/dns_cache.c:701]: dns_cache_add(): adding
df7jal23ls0d.invalid(20) 1 (flags=1) at 139
3(19341) ERROR: <core> [core/resolve.c:1698]: sip_hostport2su(): could not
resolve hostname: "df7jal23ls0d.invalid"
3(19341) ERROR: tm [ut.h:309]: uri2dst2(): failed to resolve
"df7jal23ls0d.invalid"
3(19341) ERROR: tm [t_fwd.c:1735]: t_forward_nonack(): failure to add
branches
3(19341) DEBUG: tm [t_funcs.c:334]: t_relay_to(): t_forward_nonack
returned error -478 (-478)
3(19341) DEBUG: tm [t_funcs.c:352]: t_relay_to(): -478 error reply
generation delayed
3(19341) exec: *** cfgtrace:request_route=[RELAY]
c=[/usr/local/etc/kamailio/kamailio.cfg] l=287 a=24 n=sl_reply_error
3(19341) ERROR: sl [sl_funcs.c:372]: sl_reply_error(): stateless error
reply used: Unresolvable destination (478/SL)
3(19341) exec: *** cfgtrace:request_route=[RELAY]
c=[/usr/local/etc/kamailio/kamailio.cfg] l=289 a=2 n=exit
3(19341) DEBUG: <core> [core/receive.c:353]: receive_msg(): request-route
executed in: 12632 usec
3(19341) DEBUG: tm [t_lookup.c:1490]: t_unref(): delayed error reply
generation(-478)
3(19341) DEBUG: tm [t_reply.c:1650]: cleanup_uac_timers(): RETR/FR timers
reset
3(19341) DEBUG: tm [t_reply.c:596]: _reply_light(): reply sent out.
buf=0x7fbb0f2571f0: SIP/2.0 478 Unresolv..., shmem=0x7fbb0b1e7860: SIP/2.0
478 Unresolv
3(19341) DEBUG: tm [t_reply.c:607]: _reply_light(): finished
Looks I missed some thing in message routing, But cannot find what.
Please point me how to properly route call for this case.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20190213/f3da4c95/attachment.html>
More information about the sr-users
mailing list