UNIQUE ENDOPOIN that combines BOTH WEBRTC and UDP

Hi, up until Asterisk 20.15 this configuration worked perfectly.

[system]
type=system
disable_tcp_switch=yes

[global]
type=global
debug=no
keep_alive_interval=20

[acl]
type=acl
deny=0.0.0.0/0.0.0.0
permit=0.0.0.0/0.0.0.0

common-transport
external_media_address=159.69.217.212
external_signaling_address=159.69.217.212
local_net=159.69.217.212/32

transport-udp
type=transport
protocol=udp
bind=0.0.0.0:5080
allow_reload=yes

transport-wss
type=transport
protocol=wss
bind=0.0.0.0:8089
allow_reload=yes

[3006]
type=aor
max_contacts=10
remove_existing=yes
qualify_frequency=30

[auth3006]
type=auth
auth_type=userpass
username=3006
password=callite3006

[3006]
type=endpoint
aors=3006
auth=auth3006
outbound_auth=auth3006
webrtc=yes
dtmf_mode=auto
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
direct_media=no
use_avpf=no
ice_support=no
allow_transfer=yes
one_touch_recording=yes
dtls_setup=actpass
message_context=message
context=uscita
rtcp_mux=yes
media_encryption=dtls
dtls_verify=no
disallow=all
allow=alaw

I was able to log in and make calls with both UDP and WSS/WebRTC clients (until asterisk 20.15), but with Asterisk 20.16 something changed.
I can still log in and everything works fine with WebRTC, but with UDP clients only audio is sent. Nothing is received. Basically, the called number listens to me, but I can’t hear them.
I ran a log and the SRTP packet has a negative length. But on the PBX with chanSpy I can hear audio in both directions.

i’ve read in the changelog that res_rtp_asterisk: Don’t send RTP before DTLS has negotiated.
but shouldn’t DTSL negotiation even start in UDP, or am I wrong?

How can I solve my problem?

This was never truly a supported configuration. The change put into place to prevent audio leakage was indeed likely the cause, since for normal UDP it is unlikely that DTLS is in use (you haven’t provided logging so I can only guess).

ty for the answer. DTLS isn’t used by the UDP client. So in asterisk (20.16) is it impossible to have the same endpoint to register both WebRTC and UDP clients?

It has never been supported, tested, or actually implemented properly. It worked by luck for you in your specific situation. Due to the given change it is not possible anymore. Further work would need to be done to actually properly support it.

i solved using this endpoint:

[endpoint-3006](!)
type=endpoint
language=it
dtmf_mode=auto
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
direct_media=no
use_avpf=no
ice_support=no
allow_transfer=yes
one_touch_recording=yes
dtls_setup=actpass
message_context=message
aors=3006
auth=auth3006
outbound_auth=auth3006
context=uscita
dtls_verify=no
disallow=all
allow=alaw

[3006]
type=aor
remove_existing=yes
max_contacts=10
qualify_frequency=30

[auth3006]
type=auth
auth_type=userpass
username=3006
password=XXXXXXXXX

[wss-3006]
webrtc=yes
rtcp_mux=yes
media_encryption=dtls

[identify-wss-3006]
type=identify
endpoint=wss-3006
match_header=Contact: /<sips:3006@.*transport=ws/

[udp-3006]
webrtc=no
rtcp_mux=no
media_encryption=no

[identify-udp-3006]
type=identify
endpoint=udp-3006
match_header=Contact: /<sip:3006@.*/

But I’m not sure if this is the correct way. It seems to work for now.
is this the right way?

It wasn’t a good idea to use two different endpoints. It’s complicated to receive inbound calls. I solved this by putting Kamailio in front of Asterisk for WebRTC recordings. If anyone is interested, I’d be happy to help set up Kamailio + Asterisk.