lan: improve pjsip behavior in a LAN

1. Resolving the TURN server but receiving connection timeout are
breaking the ICE init for now. This should not be the case. This
patch only removes the candidate from the candidate's list if a
conection timeout to the TURN occurs.
2. pj_getaddrinfo is very slow. Moreover, it's unecessary because
we succeed to get correct hosts candidates. So, just disable this.

Change-Id: Ic17628032c66ab1eeab43036bc340c81808aea5c
This commit is contained in:
Sébastien Blin
2019-09-24 14:36:28 -04:00
committed by Adrien Béraud
parent 0552492e01
commit c33f1ff775
4 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,17 @@
pjlib/include/pj/config.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pjlib/include/pj/config.h b/pjlib/include/pj/config.h
index ad0abbb5..6bba5a55 100644
--- a/pjlib/include/pj/config.h
+++ b/pjlib/include/pj/config.h
@@ -1003,6 +1003,9 @@
#endif
+#ifndef PJ_GETHOSTIP_DISABLE_LOCAL_RESOLUTION
+# define PJ_GETHOSTIP_DISABLE_LOCAL_RESOLUTION 1
+#endif
/** @} */

View File

@ -39,6 +39,8 @@ bash -c "%PATCH_CMD% %UNIXPATH%pjproject/ice_config.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/fix_first_packet_turn_tcp.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/fix_ebusy_turn.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/ignore_ipv6_on_transport_check.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/fix_turn_connection_failure.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/disable_local_resolution.patch"
%APPLY_CMD% %SRC%\pjproject\win32_vs_gnutls.patch
%APPLY_CMD% %SRC%\pjproject\win_config.patch

View File

@ -0,0 +1,16 @@
pjnath/src/pjnath/ice_strans.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pjnath/src/pjnath/ice_strans.c b/pjnath/src/pjnath/ice_strans.c
index 72f12700..d4790049 100644
--- a/pjnath/src/pjnath/ice_strans.c
+++ b/pjnath/src/pjnath/ice_strans.c
@@ -2854,7 +2854,7 @@ static void turn_on_state(pj_turn_sock *turn_sock, pj_turn_state_t old_state,
sess_init_update(comp->ice_st);
- } else if ((old_state == PJ_TURN_STATE_RESOLVING || old_state == PJ_TURN_STATE_ALLOCATING) &&
+ } else if (old_state >= PJ_TURN_STATE_RESOLVING && old_state <= PJ_TURN_STATE_ALLOCATING &&
new_state >= PJ_TURN_STATE_DEALLOCATING)
{
pj_ice_sess_cand *cand = NULL;

View File

@ -68,6 +68,8 @@ endif
$(APPLY) $(SRC)/pjproject/fix_first_packet_turn_tcp.patch
$(APPLY) $(SRC)/pjproject/fix_ebusy_turn.patch
$(APPLY) $(SRC)/pjproject/ignore_ipv6_on_transport_check.patch
$(APPLY) $(SRC)/pjproject/fix_turn_connection_failure.patch
$(APPLY) $(SRC)/pjproject/disable_local_resolution.patch
$(UPDATE_AUTOCONFIG)
$(MOVE)