I am using libjitsi / ice4j in my server application and would like to modify my local candidates before I call Agent.startConnectivityEstablishment(), is there a way to modify the priority or any other property to force prioritization of one candidate over another? For instance, I end up with these local candidates:
default candidate: candidate:1 1 udp 2130706431 192.168.122.15 5000 typ host
candidate:1 1 udp 2130706431 192.168.122.15 5000 typ host
candidate:2 1 udp 1694498815 24.234.1.1 5000 typ srflx raddr 192.168.122.15 rport 5000
I need the srflx candidate to be selected over the host candidate since it uses a private network address and cannot be reached from outside the network.
Both of the libraries are not documented well and there seems to be a lack of mutators on the objects in question, so any help would be appreciated.
Do you find that the srflx is being used instead of the host? I can only imagine that ICE4J will pick host if feasible. I notice that mine checks and fails on host otherwise it selects it. I can check again though.
You can check out this tutorial to see if it helps: stellarbuild.com/blog/article/ice4j-networking-tutorial-part-1
Truth be told it will be easier to modify if you use SDP because then you can manually try a few tricks on string comparisons, but that is risky. Perhaps both local networks use 192.168.1.* but are on separate networks. So assuming srflx are the same and local host strings start the same you could remove the srflx and force it to try host.
I will double check but I think it gives priority automatically to host.