InnovateAsterisk / Browser-Phone

A fully featured browser based WebRTC SIP phone for Asterisk
https://www.innovateasterisk.com
GNU Affero General Public License v3.0
496 stars 245 forks source link

Not getting video #425

Open prathibhacdac opened 1 year ago

prathibhacdac commented 1 year ago

.Error sending STUN request: Invalid argument

InnovateAsterisk commented 1 year ago

What is the contents of the rtp.conf file?

prathibhacdac commented 1 year ago

[general] rtpstart=10000 rtpend=20000 stunaddr=stun.l.google.com:19302 turnaddr=openrelay.metered.ca:443?transport=tcp turnusername=openrelayproject turnpassword=openrelayproject

prathibhacdac commented 1 year ago

Sometimes getting video but it is stuck immediately after the video appears on both ends.

prathibhacdac commented 1 year ago

Attempt 1 to send STUN request timed out. [2023-02-03 11:46:10] NOTICE[359069]: stun.c:247 handle_stun_timeout: Attempt 2 to send STUN request timed out. [2023-02-03 11:46:13] WARNING[359069]: stun.c:252 handle_stun_timeout: Attempt 3 to send STUN request timed out. Check that the server address is correct and reachable.

prathibhacdac commented 1 year ago

I've turned off firewall.

prathibhacdac commented 1 year ago

ERROR[359537]: pjproject: <?>: tcprel0x7f94a43d8a70 .CreatePermission failed for IP [2402:3a80:411:8be5:0:6f:f7a6:c501]: 443/Peer Address Family Mismatch (4)

prathibhacdac commented 1 year ago

Connecting to web socket... Sending Registration ...Registered is occuring frequently on one end of the connection.

InnovateAsterisk commented 1 year ago

You need to make sure that the Asterisk Server, and the Web Client can both reach: stun.l.google.com:19302

Address Family Mismatch means there a problem with the IP address configuration. There are two types of IP addresses, IP4 and IP6. IP4 is typically 192.168.1.2, and IP6 will be something like 2402:3a80:411:8be5:0:6f:f7a6:c501 I'm not sure what the mixup is, maybe the server is using IP6. I am not sure if this is possible with PJSIP

prathibhacdac commented 1 year ago

how to ensure that the Asterisk Server can reach stun.l.google.com:19302?

InnovateAsterisk commented 1 year ago

Sometimes getting video but it is stuck immediately after the video appears on both ends.

First let's make sure the STUN lookup is working, and that there are no other errors. WebRTC is highly reliant on STUN. Its not necessary to use TURN, as Asterisk will be in the media path.

InnovateAsterisk commented 1 year ago

how to ensure that the Asterisk Server can reach stun.l.google.com:19302?

Try something like this: https://manpages.ubuntu.com/manpages/xenial/man1/stun.1.html

prathibhacdac commented 1 year ago
trckle ice o/p: Time Type Foundation Protocol Address Port Priority URL (if present) relayProtocol (if present)
0.003 host 0 udp bc02bc43-2e14-4256-9d50-426c43bb6be3.local 60046 126 | 32512 | 255    
0.006 host 2 tcp bc02bc43-2e14-4256-9d50-426c43bb6be3.local 9 125 | 32704 | 255    
0.007 host 0 udp bc02bc43-2e14-4256-9d50-426c43bb6be3.local 60047 126 | 32512 | 254    
0.007 host 2 tcp bc02bc43-2e14-4256-9d50-426c43bb6be3.local 9 125 | 32704 | 254    
0.065 srflx 1 udp 14.139.183.221 60046 100 | 32543 | 255    
0.084 Done
InnovateAsterisk commented 1 year ago

This is the important result:

0.065 | srflx | 1 | udp | 14.139.183.221 | 60046 | 100 | 32543 | 255 |  

prathibhacdac commented 1 year ago

stun-client stun.l.google.com O/p: Primary: Blocked or could not reach STUN server

InnovateAsterisk commented 1 year ago

can you try a simple traceroute.

prathibhacdac commented 1 year ago

traceroute to stun.l.google.com (142.250.25.127), 30 hops max, 60 byte packets 1 _gateway (10.10.10.1) 2.985 ms 2.982 ms 2.965 ms 2 14.139.183.209 (14.139.183.209) 3.285 ms 3.346 ms 3.261 ms 3 4 5 6 10.119.73.122 (10.119.73.122) 15.964 ms 19.869 ms 17.031 ms 7 72.14.213.20 (72.14.213.20) 33.763 ms 34.463 ms 72.14.195.128 (72.14.195.128) 17.970 ms 8 9 142.250.228.220 (142.250.228.220) 15.910 ms 142.250.233.142 (142.250.233.142) 15.900 ms 74.125.242.129 (74.125.242.129) 19.210 ms 10 74.125.242.139 (74.125.242.139) 22.168 ms 74.125.242.154 (74.125.242.154) 69.479 ms 74.125.242.139 (74.125.242.139) 18.712 ms 11 142.250.212.4 (142.250.212.4) 37.547 ms 72.14.232.34 (72.14.232.34) 33.778 ms 142.250.238.182 (142.250.238.182) 41.042 ms 12 216.239.50.22 (216.239.50.22) 35.663 ms 142.250.212.4 (142.250.212.4) 37.541 ms 142.250.37.49 (142.250.37.49) 40.401 ms 13 142.251.79.124 (142.251.79.124) 36.461 ms 142.250.37.49 (142.250.37.49) 38.126 ms 142.250.37.1 (142.250.37.1) 37.630 ms 14 142.251.79.122 (142.251.79.122) 41.081 ms 142.251.79.134 (142.251.79.134) 37.549 ms 15 16 17 18 19 20 fy-in-f127.1e100.net (142.250.25.127) 34.970 ms

InnovateAsterisk commented 1 year ago

Primary: Blocked or could not reach STUN server

Are you blocking outbound traffic from your server?

prathibhacdac commented 1 year ago

No. I've stopped firewall.

InnovateAsterisk commented 1 year ago

what does stun stun.l.google.com:19302 -v output

prathibhacdac commented 1 year ago

stun-client stun.l.google.com:19302 -v STUN client version 0.96 Opened port 25938 with fd 3 Opened port 25939 with fd 4 Encoding stun message: Encoding ChangeRequest: 0

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 4

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 2

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 0

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 4

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 2

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 0

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 4

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 2

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 0

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 4

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 2

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 0

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 4

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 2

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 0

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 4

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 2

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 0

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 4

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 2

About to send msg of len 28 to 142.250.25.127:19302 test I = 0 test II = 0 test III = 0 test I(2) = 0 is nat = 0 mapped IP same = 1 hairpin = 0 preserver port = 0 Primary: Blocked or could not reach STUN server Return value is 0x00001c

prathibhacdac commented 1 year ago

systemctl status firewalld firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; preset: enabled) Active: inactive (dead) since Thu 2023-01-05 15:33:54 IST; 4 weeks 0 days ago

InnovateAsterisk commented 1 year ago

what is the output of ifconfig

prathibhacdac commented 1 year ago

ifconfig ens192: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.10.10.73 netmask 255.255.254.0 broadcast 10.10.11.255 inet6 fe80::20c:29ff:fe4c:9530 prefixlen 64 scopeid 0x20 ether 00:0c:29:4c:95:30 txqueuelen 1000 (Ethernet) RX packets 7090548 bytes 2246570864 (2.0 GiB) RX errors 0 dropped 24 overruns 0 frame 0 TX packets 1389790 bytes 869643774 (829.3 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000 (Local Loopback) RX packets 2724680 bytes 1011145602 (964.3 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 2724680 bytes 1011145602 (964.3 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

InnovateAsterisk commented 1 year ago

You have a very similar config to me, however my stun lookup results on something like this:

stun stun.l.google.com:19302 -v
STUN client version 0.97
Opened port 28148 with fd 3
Opened port 28149 with fd 4
Encoding stun message: 
Encoding ChangeRequest: 0

About to send msg of len 28 to 108.177.100.127:19302
Encoding stun message: 
Encoding ChangeRequest: 4

About to send msg of len 28 to 108.177.100.127:19302
Encoding stun message: 
Encoding ChangeRequest: 2

About to send msg of len 28 to 108.177.100.127:19302
Received stun message: 32 bytes
MappedAddress = 34.255.23.95:28148
Received message of type 257  id=1
Received stun message: 32 bytes
MappedAddress = 34.255.23.95:28149
Received message of type 257  id=2
Encoding stun message: 
Encoding ChangeRequest: 2

About to send msg of len 28 to 108.177.100.127:19302
Encoding stun message: 
Encoding ChangeRequest: 0

About to send msg of len 28 to 34.255.23.95:28148
Received stun message: 28 bytes
ChangeRequest = 0
Received message of type 1  id=11
Received stun message: 32 bytes
MappedAddress = 34.255.23.95:28149
Received message of type 257  id=3
Received stun message: 32 bytes
MappedAddress = 34.255.23.95:28149
Received message of type 257  id=3
test I = 1
test II = 1
test III = 1
test I(2) = 0
is nat  = 1
mapped IP same = 1
hairpin = 1
preserver port = 1
Primary: Independent Mapping, Independent Filter, preserves ports, will hairpin
Return value is 0x000003

Importantly you cannot see: Received stun message: 32 bytes on your trace.

You appear to be using a local 10 range ip address on the box, so it could be a firewall on the server, or the gateway at 1 _gateway (10.10.10.1) blocking the inbound connection.

prathibhacdac commented 1 year ago

which port to be opened in the server?

prathibhacdac commented 1 year ago

stun-client stun.l.google.com:19302 -v STUN client version 0.96 Opened port 27912 with fd 3 Opened port 27913 with fd 4 Encoding stun message: Encoding ChangeRequest: 0

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 4

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 2

About to send msg of len 28 to 142.250.25.127:19302 Received stun message: 32 bytes MappedAddress = 14.139.183.221:27912 Received message of type 257 id=1 Encoding stun message: Encoding ChangeRequest: 4

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 2

About to send msg of len 28 to 142.250.25.127:19302 Encoding stun message: Encoding ChangeRequest: 0

About to send msg of len 28 to 14.139.183.221:27912 Received stun message: 32 bytes MappedAddress = 14.139.183.221:27913 Received message of type 257 id=2 Received stun message: 32 bytes MappedAddress = 14.139.183.221:27913 Received message of type 257 id=3 Received stun message: 32 bytes MappedAddress = 14.139.183.221:27913 Received message of type 257 id=2 Received stun message: 32 bytes MappedAddress = 14.139.183.221:27913 Received message of type 257 id=3 Encoding stun message: Encoding ChangeRequest: 0

About to send msg of len 28 to 14.139.183.221:27912 Encoding stun message: Encoding ChangeRequest: 0

About to send msg of len 28 to 14.139.183.221:27912 Encoding stun message: Encoding ChangeRequest: 0

About to send msg of len 28 to 14.139.183.221:27912 Encoding stun message: Encoding ChangeRequest: 0

About to send msg of len 28 to 14.139.183.221:27912 Encoding stun message: Encoding ChangeRequest: 0

About to send msg of len 28 to 14.139.183.221:27912 Encoding stun message: Encoding ChangeRequest: 0

About to send msg of len 28 to 14.139.183.221:27912 test I = 1 test II = 1 test III = 1 test I(2) = 0 is nat = 1 mapped IP same = 1 hairpin = 0 preserver port = 1 Primary: Independent Mapping, Independent Filter, preserves ports, no hairpin Return value is 0x000013

prathibhacdac commented 1 year ago

Now call is getting connected but there is no video???

prathibhacdac commented 1 year ago

.Error sending STUN request: Invalid argument

prathibhacdac commented 1 year ago

I got the message "Received stun message: 32 bytes".

I'm able to hear music on hold. Started music on hold, class 'default', on channel 'PJSIP/9962466480-00000017'

prathibhacdac commented 1 year ago

stun show status Hostname Port Period Retries Status ExternAddr ExternPort stun.l.google.com 19302 300 3 OK 14.139.183.221 41145

prathibhacdac commented 1 year ago

why I'm not getting video and audio?

InnovateAsterisk commented 1 year ago

Firstly make sure the audio and video packets are flowing correctly. Enable RTP debug rtp set debug on Then make a call. You should see a lot of packets, and the screen fills up quick.

It will not take long to see the issue, so turn it off again rtp set debug off

The problems may be that you are not sending the RTP to the correct destination. Remember, what you are expecting to see is packets flowing from your Routers live IP address (last hop from your PC onto the internet on its way to the Asterisk Server), then (if you are test calling your self) that packets are coming back to the same IP address from the Asterisk Server.

prathibhacdac commented 1 year ago

WARNING[442804]: res_http_websocket.c:559 ws_safe_read: Web socket closed abruptly -- Removed contact 'sip:bqm9iiag@10.10.10.70:39388;transport=ws' from AOR '201004' due to shutdown -- Removed contact 'sip:j59d2nvj@10.10.10.70:58510;transport=ws' from AOR '9962466480' due to shutdown == Contact 201004/sip:bqm9iiag@10.10.10.70:39388;transport=ws has been deleted == Endpoint 201004 is now Unreachable == Contact 9962466480/sip:j59d2nvj@10.10.10.70:58510;transport=ws has been deleted == Endpoint 9962466480 is now Unreachable Call is not getting connected. == WebSocket connection from '10.10.10.70:50756' closed == WebSocket connection from '10.10.10.70:35720' for protocol 'sip' accepted using version '13' [2023-02-06 16:35:48] WARNING[442813]: res_http_websocket.c:559 ws_safe_read: Web socket closed abruptly == WebSocket connection from '10.10.10.70:58510' closed [2023-02-06 16:35:58] ERROR[442825]: res_http_websocket.c:567 ws_safe_read: Error reading from web socket: Success [2023-02-06 16:35:58] ERROR[359856]: iostream.c:552 ast_iostream_close: SSL_shutdown() failed: error:00000001:lib(0)::reason(1), Internal SSL error

prathibhacdac commented 1 year ago

Trying... Not ringing

prathibhacdac commented 1 year ago

Ringing. As soon I attend the call, the screen becomes blank. At the initiators end the call keeps on ringing.

prathibhacdac commented 1 year ago

Executing [9962466480@from-extensions:1] NoOp("PJSIP/201004-0000003c", "You called: 9962466480") in new stack -- Executing [9962466480@from-extensions:2] Dial("PJSIP/201004-0000003c", "PJSIP/9962466480,30") in new stack -- Called PJSIP/9962466480 -- PJSIP/9962466480-0000003d is ringing [2023-02-06 17:22:37] WARNING[443386]: res_http_websocket.c:559 ws_safe_read: Web socket closed abruptly -- Removed contact 'sip:6eduougk@10.10.10.70:52660;transport=ws' from AOR '9962466480' due to shutdown == Contact 9962466480/sip:6eduougk@10.10.10.70:52660;transport=ws has been deleted == Endpoint 9962466480 is now Unreachable == WebSocket connection from '10.10.10.70:40924' closed -- Nobody picked up in 30000 ms

prathibhacdac commented 1 year ago

Got RTP packet from 10.176.17.207:62474 (type 98, seq 044241, ts 2331253370, len 001141) Got RTP packet from 10.176.17.207:62474 (type 98, seq 044242, ts 2331253370, len 001141) Got RTP packet from 10.176.17.207:62474 (type 98, seq 044243, ts 2331253370, len 001141) Sent RTP packet to 42.111.162.70:57091 (type 108, seq 048055, ts 2331253370, len 001119) Sent RTP packet to 42.111.162.70:57091 (type 108, seq 048056, ts 2331253370, len 001119) Sent RTP packet to 42.111.162.70:57091 (type 108, seq 048057, ts 2331253370, len 001119)

unable to see any error messages in the log.

NOTICE[446731]: res_pjsip_sdp_rtp.c:150 rtp_check_timeout: Disconnecting channel 'PJSIP/9962466480-00000003' for lack of audio RTP activity in 120 seconds

prathibhacdac commented 1 year ago

which ports should be opened in the server??

port 19302 are opened. Is there any other port that needs to be opened.

prathibhacdac commented 1 year ago

sdp.c .Error adding media attribute, attribute is ignored: Too many objects of the specified type (PJ_ETOOMANY) [2023-02-07 10:43:06] WARNING[447498]: pjproject: <?>: sdp.c .Error adding media attribute, attribute is ignored: [2023-02-07 10:43:06] ERROR[447498]: pjproject: <?>: sip_inv.c .Error parsing/validating SDP body: Missing SDP rtpmap for dynamic payload type (PJMEDIA_SDP_EMISSINGRTPMAP)

prathibhacdac commented 1 year ago

No audio in voice call and no video and voice in video call. If the network is same, everything works fine. But the problem occurs, if the network is distinct.

prathibhacdac commented 1 year ago

Opened ports 10000 to 20000 in the firewall. Still getting the following error:

NOTICE[453177]: stun.c:247 handle_stun_timeout: Attempt 1 to send STUN request to '142.250.25.127' timed out. [2023-02-07 17:25:12] NOTICE[453177]: stun.c:247 handle_stun_timeout: Attempt 2 to send STUN request to '142.250.25.127' timed out. [2023-02-07 17:25:15] WARNING[453177]: stun.c:252 handle_stun_timeout: Attempt 3 to send STUN request to '142.250.25.127' timed out. Check that the server address is correct and reachable. [2023-02-07 17:25:19] NOTICE[453177]: stun.c:247 handle_stun_timeout: Attempt 1 to send STUN request to '142.250.25.127' timed out. [2023-02-07 17:25:22] NOTICE[453177]: stun.c:247 handle_stun_timeout: Attempt 2 to send STUN request to '142.250.25.127' timed out. [2023-02-07 17:25:25] WARNING[453177]: stun.c:252 handle_stun_timeout: Attempt 3 to send STUN request to '142.250.25.127' timed out. Check that the server address is correct and reachable.