Are IceCandidate and SDP static?

2019-08-15 04:48发布

问题:

Are IceCandidate and SDP fixed values? Is this a good idea to store them in a server database instead of retrieving on every connection? If updating these data is unavoidable, when should I do it?

回答1:

No they are not fixed values. Ice candidates locate the user in the network topology they reside in at present, which unless you have a static IP (which almost nobody has) AND a wired internet connection AND a static LAN address, AND a desktop computer that connects solely through these means and never also through, say, wifi, then this will likely change hourly, daily or weekly.

SDP additionally contains the media-setup for a call and other information, which can change from call to call, and even mid-call (requiring re-negotiation) if video or audio sources are added, removed or altered during the call. SDP may additionally contain other things that expire, but hopefully this is enough to dissuade you.



回答2:

No they are not. Ice candidates contain end point's IP and port combination which can change. Even if you have a static IP address a new port number is generated every time.