From 59fcf95d505c3995f858b826d10cd48321ed383e Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Mon, 27 Nov 2017 17:07:02 -0500 Subject: turn: Add support for ALTERNATE_SERVER in OC2007 Compatibility The MS Office TURN servers will always return the MS_ALTERNATE_SERVER in allocation responses, and if they are not handled, we end up using the main turn server to send allocation requests that then get sent to the alternate server which will return the XOR_MAPPED_ADDRESS containing the IP address of the turn server that proxied the message instead of our own actual external IP. --- stun/usages/turn.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'stun/usages/turn.h') diff --git a/stun/usages/turn.h b/stun/usages/turn.h index 7a2d4e6..83fa00a 100644 --- a/stun/usages/turn.h +++ b/stun/usages/turn.h @@ -256,6 +256,10 @@ size_t stun_usage_turn_create_permission (StunAgent *agent, StunMessage *msg, * Allocate request, in case the currently used TURN server is requesting the use * of an alternate server. This argument will only be filled if the return value * of the function is #STUN_USAGE_TURN_RETURN_ALTERNATE_SERVER + * In the case of @STUN_USAGE_TURN_COMPATIBILITY_OC2007 compatibility, the + * @alternate_server could be filled at any time, and should only be considered + * if the request was sent to a different server than the address returned + * in the @alternate_server field * @alternate_server_len: The length of @alternate_server * @bandwidth: A pointer to fill with the bandwidth the TURN server allocated us * @lifetime: A pointer to fill with the lifetime of the allocation -- cgit v1.2.1