When I used directmedia=yes, I can video/audio call on wifi(local network) and it works well.
But one phone is on 4G and other phone is on wifi, SIP can established but video/audio is not working.
So I have changed directmedia=no, and I can make video/audio call.
At this moment, I have one issue.
Video has many dropped packet so that video quality is too bad, specially 4G
How can I set sip.conf so that I can make video/audio call on wifi/wifi, wifi/4G, 4G/4G?
Here is sip.conf what I used on asterisk server.
Thank you.
[general]
externip=xx.xx.xx.xx
localnet=yy.yy.yy.yy/255.255.240.0
transport=tls,udp
videosupport=yes
icesupport=yes
directmedia=no
directrtpsetup=yes
nat=force_rport,comedia
;canreinvite=no
context=from-sip
;tls
tlsenable=yes
tlsbindaddr=0.0.0.0
tlscertfile=/etc/asterisk/TLS_LE_cert.pem
tlsdontverifyserver=yes
;tlscipher=DES-CBC3-SHA
;tlscipher=AES256-SHA
tlsclientmethod=tlsv1
;srtp enabled
;encryption=no
;/tls
;codecs
disallow=all
allow=opus
allow=speex
allow=vp8
allow=h264
;/codecs
alwaysauthreject=yes
allowguest=no
keepalive=yes
keepalive=180
bindaddr=0.0.0.0
call-limit=1
callcounter=yes
rtcachefriends=yes
rtautoclear=yes
rtautoclear=300
rtupdate=yes
rtsavesysname=yes
ignoreregexpire=no
maxexpiry=3600
minexpiry=60
defaultexpiry=300