Based on the error DTLS failed to negotiate for some reason, why that is I do not know (haven’t seen that before - could certainly be due to you using openwrt). DTLS is required for WebRTC and without it won’t work.
Ok! So I found out that the asterisk websockets pacakage in OPenwrt was auto selecting libopenssl but it didnt select enable DTLS in its configuartion. After enabling DTLS and compiling I don’t see the DTLS errors.
Still I got errors mentioning the STUN permisison issue.
Here is my configuration
When I dial from 500 to 400 , there is no video at 400 but 500 can get video.
Connected to Asterisk 18.5.1 currently running on SHAULA-001 (pid = 4900)
== WebSocket connection from '192.168.1.183:55786' for protocol 'sip' accepted using version '13'
-- Added contact 'sip:b5468908@192.168.1.183:55786;transport=ws' to AOR '500' with expiration of 600 seconds
== Endpoint 500 is now Reachable
== WebSocket connection from '192.168.1.184:46666' for protocol 'sip' accepted using version '13'
-- Added contact 'sip:453475i8@192.168.1.184:46666;transport=ws' to AOR '400' with expiration of 600 seconds
== Endpoint 400 is now Reachable
-- Executing [500@from-internal:1] Dial("PJSIP/400-00000000", "PJSIP/500") in new stack
-- Called PJSIP/500
-- PJSIP/500-00000001 is ringing
> 0x17caab0 -- Strict RTP learning after remote address set to: 5.36.200.129:15115
[Mar 10 23:41:55] ERROR[4932]: pjproject: <?>: icess0xb4c4c02 ......Error sending STUN request: Permission denied
> 0x17d5850 -- Strict RTP learning after remote address set to: 5.36.200.129:15115
-- PJSIP/500-00000001 answered PJSIP/400-00000000
> 0x17f0440 -- Strict RTP learning after remote address set to: 5.36.200.129:43690
> 0x17c2e60 -- Strict RTP learning after remote address set to: 5.36.200.129:43690
[Mar 10 23:41:55] ERROR[4932]: pjproject: <?>: icess0xb68c902 ...Error sending STUN request: Permission denied
-- Channel PJSIP/500-00000001 joined 'simple_bridge' basic-bridge <24145dc0-20ca-4fca-9bf5-06009b48e566>
-- Channel PJSIP/400-00000000 joined 'simple_bridge' basic-bridge <24145dc0-20ca-4fca-9bf5-06009b48e566>
> 0x17d5850 -- Strict RTP learning after remote address set to: 192.168.1.183:38891
> 0x17caab0 -- Strict RTP learning after ICE completion
> 0x17d5850 -- Strict RTP learning after remote address set to: 192.168.1.183:38891
> 0x17caab0 -- Strict RTP learning after remote address set to: 192.168.1.183:38891
[Mar 10 23:41:55] ERROR[4942]: pjproject: <?>: icess0xb68c902 ..Error sending STUN request: Permission denied
[Mar 10 23:41:55] ERROR[4942]: pjproject: <?>: icess0xb68c902 ..Error sending STUN request: Permission denied
[Mar 10 23:41:55] ERROR[4942]: pjproject: <?>: icess0xb68c902 ..Error sending STUN request: Permission denied
> 0x17f0440 -- Strict RTP learning after remote address set to: 192.168.1.184:43690
> 0x17c2e60 -- Strict RTP learning after ICE completion
> 0x17f0440 -- Strict RTP learning after remote address set to: 192.168.1.184:43690
> 0x17c2e60 -- Strict RTP learning after remote address set to: 192.168.1.184:43690
> 0x17c2e60 -- Strict RTP switching to RTP target address 192.168.1.184:43690 as source
> 0x17d5850 -- Strict RTP switching to RTP target address 192.168.1.183:38891 as source
> 0x17caab0 -- Strict RTP switching to RTP target address 192.168.1.183:38891 as source
> 0x17d5850 -- Strict RTP learning complete - Locking on source address 192.168.1.183:38891
> 0x17caab0 -- Strict RTP learning complete - Locking on source address 192.168.1.183:38891
> 0x17c2e60 -- Strict RTP learning complete - Locking on source address 192.168.1.184:43690
-- Channel PJSIP/400-00000000 left 'simple_bridge' basic-bridge <24145dc0-20ca-4fca-9bf5-06009b48e566>
== Spawn extension (from-internal, 500, 1) exited non-zero on 'PJSIP/400-00000000'
-- Channel PJSIP/500-00000001 left 'simple_bridge' basic-bridge <24145dc0-20ca-4fca-9bf5-06009b48e566>
-- Executing [400@from-internal:1] Dial("PJSIP/500-00000002", "PJSIP/400") in new stack
-- Called PJSIP/400
-- PJSIP/400-00000003 is ringing
But when 400 calls 500 all is OK. Both the calls are from within the local network so far and I havent started testing calling to or from extrenal network yet
The call below is All OK
Executing [400@from-internal:1] Dial("PJSIP/500-00000002", "PJSIP/400") in new stack
-- Called PJSIP/400
-- PJSIP/400-00000003 is ringing
> 0x22ee550 -- Strict RTP learning after remote address set to: 5.36.200.129:46693
[Mar 10 23:46:09] ERROR[3287]: pjproject: <?>: icess0xb4cce02 ......Error sending STUN request: Permission denied
> 0x22dfff0 -- Strict RTP learning after remote address set to: 5.36.200.129:46693
-- PJSIP/400-00000003 answered PJSIP/500-00000002
> 0x22d7110 -- Strict RTP learning after remote address set to: 5.36.200.129:49501
> 0x224aaa0 -- Strict RTP learning after remote address set to: 5.36.200.129:49501
[Mar 10 23:46:09] ERROR[3287]: pjproject: <?>: icess0xb4fa602 ...Error sending STUN request: Permission denied
-- Channel PJSIP/400-00000003 joined 'simple_bridge' basic-bridge <2474088b-7f75-44a0-b9ef-b1dd37e5c11b>
-- Channel PJSIP/500-00000002 joined 'simple_bridge' basic-bridge <2474088b-7f75-44a0-b9ef-b1dd37e5c11b>
> 0x22dfff0 -- Strict RTP learning after remote address set to: 192.168.1.184:46693
> 0x22ee550 -- Strict RTP learning after ICE completion
> 0x22dfff0 -- Strict RTP learning after remote address set to: 192.168.1.184:46693
> 0x22ee550 -- Strict RTP learning after remote address set to: 192.168.1.184:46693
[Mar 10 23:46:09] ERROR[2246]: pjproject: <?>: icess0xb4fa602 ..Error sending STUN request: Permission denied
[Mar 10 23:46:09] ERROR[2246]: pjproject: <?>: icess0xb4fa602 ..Error sending STUN request: Permission denied
[Mar 10 23:46:09] ERROR[2246]: pjproject: <?>: icess0xb4fa602 ..Error sending STUN request: Permission denied
> 0x22d7110 -- Strict RTP learning after remote address set to: 192.168.1.183:49501
> 0x224aaa0 -- Strict RTP learning after ICE completion
[Mar 10 23:46:09] ERROR[2246]: pjproject: <?>: icess0xb4fa602 ..Error sending STUN request: Permission denied
> 0x22d7110 -- Strict RTP learning after remote address set to: 192.168.1.183:49501
> 0x224aaa0 -- Strict RTP learning after remote address set to: 192.168.1.183:49501
> 0x224aaa0 -- Strict RTP switching to RTP target address 192.168.1.183:49501 as source
> 0x22d7110 -- Strict RTP switching to RTP target address 192.168.1.183:49501 as source
> 0x22dfff0 -- Strict RTP switching to RTP target address 192.168.1.184:46693 as source
> 0x22ee550 -- Strict RTP switching to RTP target address 192.168.1.184:46693 as source
> 0x22dfff0 -- Strict RTP learning complete - Locking on source address 192.168.1.184:46693
> 0x22ee550 -- Strict RTP learning complete - Locking on source address 192.168.1.184:46693
> 0x22d7110 -- Strict RTP learning complete - Locking on source address 192.168.1.183:49501
> 0x224aaa0 -- Strict RTP learning complete - Locking on source address 192.168.1.183:49501
-- Channel PJSIP/400-00000003 left 'simple_bridge' basic-bridge <2474088b-7f75-44a0-b9ef-b1dd37e5c11b>
-- Channel PJSIP/500-00000002 left 'simple_bridge' basic-bridge <2474088b-7f75-44a0-b9ef-b1dd37e5c11b>
== Spawn extension (from-internal, 400, 1) exited non-zero on 'PJSIP/500-00000002'