This message was deleted.
# helpdesk
s
This message was deleted.
j
LiveKit Log:
Copy code
2022-11-25T13:44:27.621Z	INFO	livekit	service/roommanager.go:257	starting RTC session	{"room": "test-room", "nodeID": "ND_zutQo5Hs", "participant": "ben-citrix", "sdk": "JS", "sdkVersion": "1.3.2", "protocol": 8}
2022-11-25T13:44:27.622Z	INFO	livekit	rtc/room.go:297	new participant joined	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "pID": "PA_YcFWicFGME5e", "participant": "ben-citrix", "protocol": 8, "options": {"AutoSubscribe":true}}
2022-11-25T13:44:27.622Z	DEBUG	livekit	rtc/participant.go:1124	updating participant state	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false, "state": "JOINED"}
2022-11-25T13:44:27.622Z	DEBUG	livekit	rtc/participant.go:683	SetMigrateState	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false, "state": "MIGRATE_STATE_COMPLETE"}
2022-11-25T13:44:27.622Z	DEBUG	livekit	rtc/room.go:246	participant state changed	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "state": "JOINED", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "oldState": "JOINING"}
2022-11-25T13:44:27.622Z	INFO	livekit	service/rtcservice.go:242	new client WS connected	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "remote": false, "connID": "CO_PJHJJpwWfhGd"}
2022-11-25T13:44:27.623Z	INFO	livekit	rtc/transport.go:438	ice gathering state change	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false, "transport": "SUBSCRIBER", "state": "gathering"}
2022-11-25T13:44:27.623Z	INFO	livekit	rtc/participant.go:1143	sending offer	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false, "transport": "SUBSCRIBER"}
2022-11-25T13:44:27.623Z	INFO	livekit	rtc/transport.go:438	ice gathering state change	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false, "transport": "SUBSCRIBER", "state": "complete"}
2022-11-25T13:44:27.686Z	INFO	livekit	rtc/participant.go:419	received answer	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false, "transport": "SUBSCRIBER"}
2022-11-25T13:44:27.686Z	INFO	livekit	rtc/transport.go:472	ice connection state change	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false, "transport": "SUBSCRIBER", "state": "checking"}
2022-11-25T13:44:42.690Z	DEBUG	livekit	service/rtcservice.go:283	exit ws read loop for closed connection	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "remote": false, "connID": "CO_PJHJJpwWfhGd"}
2022-11-25T13:44:42.690Z	INFO	livekit	service/rtcservice.go:220	finishing WS connection	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "remote": false, "connID": "CO_PJHJJpwWfhGd"}
2022-11-25T13:44:42.690Z	INFO	livekit	service/roommanager.go:443	RTC session finishing	{"participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "room": "test-room", "roomID": "RM_DqUGNhXsvmQg"}
2022-11-25T13:44:50.475Z	INFO	livekit	routing/localrouter.go:215	memstats	{"mallocs": 504023, "frees": 469974, "m-f": 34049, "hinuse": 21184512, "halloc": 15125888, "frag": 6058624}
2022-11-25T13:45:02.792Z	INFO	livekit	rtc/transport.go:472	ice connection state change	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false, "transport": "SUBSCRIBER", "state": "failed"}
2022-11-25T13:45:02.792Z	INFO	livekit	rtc/transport.go:485	peer connection state change	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false, "transport": "SUBSCRIBER", "state": "failed"}
2022-11-25T13:45:02.792Z	INFO	livekit	rtc/participant_signal.go:198	closing signal connection	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false}
2022-11-25T13:45:02.792Z	INFO	livekit	rtc/transport.go:1357	ice candidates	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false, "transport": "SUBSCRIBER", "lc": ["udp4 host X.X.X.X:56430", "tcp4 host X.X.X.X:7881", "udp4 host 172.17.0.1:56322", "tcp4 host 172.17.0.1:7881"], "rc": ["candidate:2503476600 1 udp 2122260223 10.97.236.34 64233 typ host generation 0 ufrag NX0x network-id 1", "candidate:1799031094 1 udp 2122194687 10.94.250.71 64234 typ host generation 0 ufrag NX0x network-id 2", "candidate:3686529416 1 tcp 1518280447 10.97.236.34 9 typ host tcptype active generation 0 ufrag NX0x network-id 1", "candidate:632878534 1 tcp 1518214911 10.94.250.71 9 typ host tcptype active generation 0 ufrag NX0x network-id 2"], "lc (filtered)": [], "rc (filtered)": []}
2022-11-25T13:45:17.792Z	INFO	livekit	rtc/participant.go:1271	closing disconnected participant	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false}
2022-11-25T13:45:17.793Z	INFO	livekit	rtc/participant.go:538	participant closing	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false, "sendLeave": true, "reason": "PEER_CONNECTION_DISCONNECTED"}
2022-11-25T13:45:17.793Z	INFO	livekit	rtc/participant_signal.go:180	could not send message to participant	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false, "message": "*livekit.SignalResponse_Leave", "error": "no response sink"}
2022-11-25T13:45:17.793Z	DEBUG	livekit	rtc/participant.go:1124	updating participant state	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false, "state": "DISCONNECTED"}
2022-11-25T13:45:17.793Z	DEBUG	livekit	rtc/transport.go:1203	leaving events processor	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false, "transport": "PUBLISHER"}
2022-11-25T13:45:17.793Z	DEBUG	livekit	rtc/room.go:246	participant state changed	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "state": "DISCONNECTED", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "oldState": "JOINED"}
2022-11-25T13:45:17.793Z	DEBUG	livekit	rtc/transport.go:1203	leaving events processor	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false, "transport": "SUBSCRIBER"}
2022-11-25T13:45:17.793Z	INFO	livekit	rtc/transport.go:485	peer connection state change	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false, "transport": "PUBLISHER", "state": "closed"}
2022-11-25T13:45:17.793Z	INFO	livekit	rtc/room.go:403	closing participant for removal	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "pID": "PA_YcFWicFGME5e", "participant": "ben-citrix"}
2022-11-25T13:45:17.793Z	INFO	livekit	rtc/participant.go:538	participant closing	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false, "sendLeave": true, "reason": "STATE_DISCONNECTED"}
2022-11-25T13:45:17.793Z	INFO	livekit	rtc/transport.go:438	ice gathering state change	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false, "transport": "SUBSCRIBER", "state": "closed"}
2022-11-25T13:45:17.793Z	INFO	livekit	rtc/transport.go:472	ice connection state change	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false, "transport": "SUBSCRIBER", "state": "closed"}
2022-11-25T13:45:17.793Z	INFO	livekit	rtc/transport.go:485	peer connection state change	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg", "participant": "ben-citrix", "pID": "PA_YcFWicFGME5e", "remote": false, "transport": "SUBSCRIBER", "state": "closed"}
2022-11-25T13:45:20.476Z	INFO	livekit	routing/localrouter.go:215	memstats	{"mallocs": 505033, "frees": 474630, "m-f": 30403, "hinuse": 21028864, "halloc": 14804736, "frag": 6224128}
^C2022-11-25T13:45:20.665Z	INFO	livekit	server/main.go:249	exit requested, shutting down	{"signal": "interrupt"}
2022-11-25T13:45:20.665Z	INFO	livekit	rtc/room.go:556	closing room	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg"}
2022-11-25T13:45:20.665Z	INFO	livekit	service/roommanager.go:110	deleting room state	{"room": "test-room"}
2022-11-25T13:45:20.665Z	INFO	livekit	service/roommanager.go:411	room closed	{"room": "test-room", "roomID": "RM_DqUGNhXsvmQg"}
cc: @best-parrot-43500
p
have you had a look at the output of https://livekit.io/connection-test ? also you can try to pass
iceTransportPolicy: 'relay'
as a connection option in the rtcConfig to force usage of your turn server
j
Thanks @polite-kilobyte-67570 for responding. In the code, though, I don’t see a way to set the
iceTransportPolicy
like you mentioned. Here is the `RTCConfig`:
Copy code
type RTCConfig struct {
	UDPPort                 uint32           `yaml:"udp_port,omitempty"`
	TCPPort                 uint32           `yaml:"tcp_port,omitempty"`
	ICEPortRangeStart       uint32           `yaml:"port_range_start,omitempty"`
	ICEPortRangeEnd         uint32           `yaml:"port_range_end,omitempty"`
	NodeIP                  string           `yaml:"node_ip,omitempty"`
	NodeIPAutoGenerated     bool             `yaml:"-"`
	STUNServers             []string         `yaml:"stun_servers,omitempty"`
	TURNServers             []TURNServer     `yaml:"turn_servers,omitempty"`
	UseExternalIP           bool             `yaml:"use_external_ip"`
	UseICELite              bool             `yaml:"use_ice_lite,omitempty"`
	Interfaces              InterfacesConfig `yaml:"interfaces"`
	IPs                     IPsConfig        `yaml:"ips"`
	EnableLoopbackCandidate bool             `yaml:"enable_loopback_candidate"`

	// Number of packets to buffer for NACK
	PacketBufferSize int `yaml:"packet_buffer_size,omitempty"`

	// Throttle periods for pli/fir rtcp packets
	PLIThrottle PLIThrottleConfig `yaml:"pli_throttle,omitempty"`

	CongestionControl CongestionControlConfig `yaml:"congestion_control,omitempty"`

	// allow TCP and TURN/TLS fallback
	AllowTCPFallback *bool `yaml:"allow_tcp_fallback,omitempty"`

	// for testing, disable UDP
	ForceTCP bool `yaml:"force_tcp,omitempty"`
}
I tried setting it in my yaml file, and it had no effect.
p
j
Hi @polite-kilobyte-67570, I am currently using the livekit-react example for my front end (I’m hosting it, so I can modify it locally). I’m not a React programmer, so I may be wrong, but it appears to me that it is not using the LiveKit SDK, but rather using URL query parameters to setup the room. Is there a way that I can easily add the RTC Connection Options in the react example or do I need to go back to square one and create a different front end?
I found the example webpage under the SDK examples directory, so I will use that to test.
👍 1
e
@jolly-daybreak-70827 I don’t see the
relay
candidates in the log, so your external turn server might not takes effect (if it is accessible from the client network)
j
Ok, I’ve been doing a lot more testing and still cannot get LiveKit to work with this particular TURN server. I was able to compare wireshark results between three cases: 1. LiveKit to external TURN server running inside a company network - doesn’t work 2. LiveKit to external TURN server under my control running on a VM in Google Cloud - works 3. Our company application to the external TURN server running inside the company network - works When I look at the network traffic in #1, all I see are STUN Binding Requests going from the Livekit server to the TURN server, but no responses or any other traffic. When I look at the network traffic in #2, I see STUN Binding Requests and Responses, and then I see DTLS traffic between the two servers When I look at the network traffic in #3, I also see some initial STUN Binding Requests over UDP, but no Responses. However, after that the communication seems to resort to TCP only and the WebRTC session is established through the TURN server. My question: if the TURN server inside the company network has incoming UDP blocked, is there any way for Livekit to establish a session with this server?
e
The TURN server use udp to communicate with sfu server (livekit), so you can’t use this TURN if it’s udp traffic is blocked. In common case, TURN is used to help client whos udp traffic to webrtc server is blocked while TURN server is open, so client can use the TURN to relay traffic to webrtc server, why are you using a TURN has same network condition with client to establish the session?
j
why are you using a TURN has same network condition with client to establish the session?
Because it is a bank that has very strict security policies.
e
If all UDP traffic to the TURN server is blocked, I think there is no way to force client connect to livekit-server by the TURN. But livekit-server can use
udpmux
to reuse a single port for all udp traffic, if you can open a policy to enable the single <ip>:<port> of livekit-serve, it will success
j
Ok, I switched gears a bit since trying to work with the corporate TURN server where I have no access to logs was becoming too difficult. I created a new coturn server running in an Azure VM and my LiveKit server is running inside a Google Cloud VM. I am having similar issues when trying to establish a WebRTC session using this external TURN server. • So far, I can only get an external TURN server to work if it is on the same internal network as the LiveKit server (e.g. both VMs are inside Google Cloud) • In the case that works, in my TURN server logs I see incoming packets for ALLOCATE, CREATE_PERMISSION, and CHANNEL_BIND • For the Azure TURN case that doesn’t work, in my logs I see incoming packets for ALLOCATE and CREATE_PERMISSION (both marked success), but I never see the CHANNEL_BIND packet. • In wireshark, I never see the Binding Success Response messages from the LiveKit server to the TURN server when using the Azure VM Any ideas on what would prevent the CHANNEL_BIND message?
Update: I set
use_external_ip
to
true
and now the Azure TURN seems to be working. Now I need to try to run the test again with the bank TURN server to see if it will work now (they are enabling UDP this evening).
Don’t know why it worked for a short period of time, but now it’s back to not working for the TURN server outside the LiveKit network. I’m beginning to think what I’m trying to do just won’t work with LiveKit.
e
If your livekit-server is inside Cloud VM, set
use_external_ip
will provide help to the connection. You can use client outside the bank network to verify your TURN and livekit is working correctly.