I recently analyzing the regarding the STUN and TURN with the support of ICE. but I know that SIP clients are responsible for the TURN relay communication, so we will apply the TURN server URL and connect the two SIP clients, and media will flow between the TURN server, but what Asterisk is doing here in the rtp.conf. it felt the documentation was a little vague. need some knowledge regarding this
; Whether to report the PJSIP version in a SOFTWARE attribute for all
; outgoing STUN packets. This option is enabled by default.
;
; stun_software_attribute=yes
;
; Hostname or address for the TURN server to be used as a relay. The port
; number is optional. If omitted the default value of 3478 will be used.
; This option is disabled by default.
;
; e.g. turnaddr=myturn.server.com:34780
;
; turnaddr=
;
; Username used to authenticate with TURN relay server.
; turnusername=
;
; Password used to authenticate with TURN relay server.
; turnpassword=
If STUN is set in rtp.conf then STUN will be used to determine a server reflexive candidate that will be added to the ICE candidates for Asterisk. If TURN is set in rtp.conf then a TURN session will be established and a relay candidate will be added to the ICE candidates for Asterisk.
Realistically few people should need to set TURN, with slightly more probably needing to set STUN.
Gotcha. but also this is not suitable for direct media setup in asterisk right. for that we need to do ICE configurations at the peer/user level ?. when i tried to setup direct media i ran into an problem where they using CGNAT in other endpoint which caused the problem to get some clarity i asked that
If you’re having to use either of those options then it’s unlikely direct media would be possible. Doubly so with remote endpoints having to use ICE. Not saying it’s impossible, but network conditions have to be just right - and we also don’t forward ICE candidates to allow direct ICE negotiation either.