<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/6854">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjproject.c: Upgrade bundled PJPROJECT to 2.7<br><br>Update patches included in bundled PJPROJECT for the new version.<br><br>ASTERISK-27355<br><br>Change-Id: I9ac5dbbffaadca25ad24fac8b9ab615e5ace6083<br>---<br>M third-party/pjproject/Makefile.rules<br>M third-party/pjproject/patches/0000-remove-third-party.patch<br>M third-party/pjproject/patches/0000-set_apps_initial_log_level.patch<br>D third-party/pjproject/patches/0010-evsub-Add-pjsip_evsub_set_uas_timeout.patch<br>A third-party/pjproject/patches/0010-r5665-svn-backport-ICE-Use-STUN-FINGERPRINT-attribut.patch<br>D third-party/pjproject/patches/0011-r5554-svn-backport-Increase-SENDER_WIDTH-column-size.patch<br>D third-party/pjproject/patches/0013-r5559-svn-backport-Fix-to-resolve-DNS-SRV-crashes.patch<br>D third-party/pjproject/patches/0014-Add-pjsip-transport-register-type-ipv6.patch<br>D third-party/pjproject/patches/0025-fix-print-xml-crash.patch<br>D third-party/pjproject/patches/0035-r5572-svn-backport-dialog-transaction-deadlock.patch<br>D third-party/pjproject/patches/0036-r5573-svn-backport-ua-pjsua-transaction-deadlock.patch<br>D third-party/pjproject/patches/0037-r5576-svn-backport-session-timer-crash.patch<br>D third-party/pjproject/patches/0048-r5576-svn-backport-tls-crash.patch<br>D third-party/pjproject/patches/0058-Parse-zero-length-multipart-body-parts-correctly.patch<br>D third-party/pjproject/patches/0059-Ensure-2543-transaction-key-buffer-is-large-enough.patch<br>D third-party/pjproject/patches/0070-Set-PJSIP_INV_SUPPORT_UPDATE-correctly-in-pjsip_inv_.patch<br>D third-party/pjproject/patches/0075-Fixed-2030-Improve-error-handling-in-OpenSSL-socket.patch<br>D third-party/pjproject/patches/0080-STUN-Fingerprint-with-ICE.patch<br>M third-party/versions.mak<br>19 files changed, 80 insertions(+), 1,002 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/third-party/pjproject/Makefile.rules b/third-party/pjproject/Makefile.rules<br>index acd7662..56b2c49 100644<br>--- a/third-party/pjproject/Makefile.rules<br>+++ b/third-party/pjproject/Makefile.rules<br>@@ -1,3 +1,11 @@<br>+# We switched download locations so Asterisk users don't bombard the Teluu<br>+# site with download requests.<br>+#<br>+# For future reference when upgrading bundled PJPROJECT the next time<br>+# PJPROJECT is released.<br>+# Teluu's download URL.<br>+# PJPROJECT_URL ?= http://www.pjsip.org/release/$(PJPROJECT_VERSION)<br>+<br> PJPROJECT_URL ?= https://raw.githubusercontent.com/asterisk/third-party/master/pjproject/$(PJPROJECT_VERSION)<br> <br> # PJPROJECT_CONFIGURE_OPTS could come from the command line or could be<br>diff --git a/third-party/pjproject/patches/0000-remove-third-party.patch b/third-party/pjproject/patches/0000-remove-third-party.patch<br>index 81c53a0..7cde2f4 100644<br>--- a/third-party/pjproject/patches/0000-remove-third-party.patch<br>+++ b/third-party/pjproject/patches/0000-remove-third-party.patch<br>@@ -1,21 +1,28 @@<br>+From 1ec66eb253c603e06fedff5710e701dc0e55c697 Mon Sep 17 00:00:00 2001<br>+From: Richard Mudgett <rmudgett@digium.com><br>+Date: Thu, 23 Feb 2017 17:10:07 -0600<br>+Subject: [PATCH 1/3] 0000-remove-third-party.patch<br>+<br>+---<br>+ build.mak.in | 107 -----------------------------------------------------------<br>+ 1 file changed, 107 deletions(-)<br>+<br> diff --git a/build.mak.in b/build.mak.in<br>-index eb28663..83024ef 100644<br>+index 6c263a9..36e7ff4 100644<br> --- a/build.mak.in<br> +++ b/build.mak.in<br>-@@ -1,6 +1,5 @@<br>+@@ -1,4 +1,3 @@<br> -export PJDIR := @ac_pjdir@<br> include $(PJDIR)/version.mak<br> export PJ_DIR := $(PJDIR)<br> <br>- # @configure_input@<br>- export MACHINE_NAME := auto<br> @@ -28,19 +27,6 @@ export APP_THIRD_PARTY_EXT :=<br> export APP_THIRD_PARTY_LIBS :=<br> export APP_THIRD_PARTY_LIB_FILES :=<br> <br>--ifeq (@ac_external_srtp@,1)<br>+-ifneq (@ac_external_srtp@,0)<br> -# External SRTP library<br>--APP_THIRD_PARTY_EXT += -lsrtp<br>+-APP_THIRD_PARTY_EXT += -l@ac_external_srtp_lib@<br> -else<br> -APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libsrtp-$(LIB_SUFFIX)<br> -ifeq ($(PJ_SHARED_LIBRARIES),)<br>@@ -129,3 +136,6 @@<br> # Additional flags<br> @ac_build_mak_vars@<br> <br>+-- <br>+2.7.4<br>+<br>diff --git a/third-party/pjproject/patches/0000-set_apps_initial_log_level.patch b/third-party/pjproject/patches/0000-set_apps_initial_log_level.patch<br>index fc0f570..3eed240 100644<br>--- a/third-party/pjproject/patches/0000-set_apps_initial_log_level.patch<br>+++ b/third-party/pjproject/patches/0000-set_apps_initial_log_level.patch<br>@@ -1,3 +1,14 @@<br>+From 34f25c67f17be80814ddb16edc6c76d30213ca1b Mon Sep 17 00:00:00 2001<br>+From: Richard Mudgett <rmudgett@digium.com><br>+Date: Thu, 23 Feb 2017 17:11:00 -0600<br>+Subject: [PATCH 2/3] 0000-set_apps_initial_log_level.patch<br>+<br>+---<br>+ pjsip-apps/src/pjsua/main.c | 2 ++<br>+ pjsip-apps/src/pjsystest/main_console.c | 2 ++<br>+ pjsip-apps/src/python/_pjsua.c | 3 ++-<br>+ 3 files changed, 6 insertions(+), 1 deletion(-)<br>+<br> diff --git a/pjsip-apps/src/pjsua/main.c b/pjsip-apps/src/pjsua/main.c<br> index 2baaf82..11831f2 100644<br> --- a/pjsip-apps/src/pjsua/main.c<br>@@ -37,3 +48,6 @@<br> PyEval_InitThreads();<br> <br> if (PyType_Ready(&PyTyp_pjsua_callback) < 0)<br>+-- <br>+2.7.4<br>+<br>diff --git a/third-party/pjproject/patches/0010-evsub-Add-pjsip_evsub_set_uas_timeout.patch b/third-party/pjproject/patches/0010-evsub-Add-pjsip_evsub_set_uas_timeout.patch<br>deleted file mode 100644<br>index a55aa00..0000000<br>--- a/third-party/pjproject/patches/0010-evsub-Add-pjsip_evsub_set_uas_timeout.patch<br>+++ /dev/null<br>@@ -1,84 +0,0 @@<br>-From b7af9e6639f29feb4db6d0866c98e552b025ec96 Mon Sep 17 00:00:00 2001<br>-From: George Joseph <gjoseph@digium.com><br>-Date: Mon, 6 Feb 2017 15:39:29 -0700<br>-Subject: [PATCH] evsub: Add pjsip_evsub_set_uas_timeout.<br>-<br>-A UAS which needs to recreate incoming subscriptions from a persistent<br>-store can call pjsip_dlg_create_uas_and_inc_lock and<br>-pjsip_evsub_create_uas as long as they've persisted the<br>-correct data but since the timer is triggered by an incoming subscribe,<br>-it's never set and the subscription never expires.<br>-<br>-* Add pjsip_evsub_set_uas_timeout which is just a wrapper around<br>- evsub.c:set_timeout(sub, TIMER_TYPE_UAS_TIMEOUT, seconds)<br>-<br>-* Also, fixed copy-paste error in pjsip_sub_state_hdr_print when<br>- printing retry-after parameter.<br>----<br>- pjsip/include/pjsip-simple/evsub.h | 14 ++++++++++++++<br>- pjsip/src/pjsip-simple/evsub.c | 10 ++++++++++<br>- pjsip/src/pjsip-simple/evsub_msg.c | 2 +-<br>- 3 files changed, 25 insertions(+), 1 deletion(-)<br>-<br>-diff --git a/pjsip/include/pjsip-simple/evsub.h b/pjsip/include/pjsip-simple/evsub.h<br>-index 82e0a7c..45e6411 100644<br>---- a/pjsip/include/pjsip-simple/evsub.h<br>-+++ b/pjsip/include/pjsip-simple/evsub.h<br>-@@ -511,6 +511,20 @@ PJ_DEF(pj_status_t) pjsip_evsub_add_ref(pjsip_evsub *sub);<br>- PJ_DEF(pj_status_t) pjsip_evsub_dec_ref(pjsip_evsub *sub);<br>- <br>- <br>-+/**<br>-+ * Sets, resets or cancels the UAS subscription timeout.<br>-+ *<br>-+ * If there is an existing timer, it is cancelled before any<br>-+ * other action.<br>-+ *<br>-+ * A timeout of 0 is ignored except that any existing timer<br>-+ * is cancelled.<br>-+ *<br>-+ * @param sub The server subscription instance.<br>-+ * @param seconds The new timeout.<br>-+ */<br>-+PJ_DEF(void) pjsip_evsub_set_uas_timeout(pjsip_evsub *sub, pj_int32_t seconds);<br>-+<br>- <br>- PJ_END_DECL<br>- <br>-diff --git a/pjsip/src/pjsip-simple/evsub.c b/pjsip/src/pjsip-simple/evsub.c<br>-index 3fe4b49..6918a8c 100644<br>---- a/pjsip/src/pjsip-simple/evsub.c<br>-+++ b/pjsip/src/pjsip-simple/evsub.c<br>-@@ -530,6 +530,16 @@ static void set_timer( pjsip_evsub *sub, int timer_id,<br>- <br>- <br>- /*<br>-+ * Set event subscription UAS timout.<br>-+ */<br>-+PJ_DEF(void) pjsip_evsub_set_uas_timeout(pjsip_evsub *sub, pj_int32_t seconds)<br>-+{<br>-+ PJ_ASSERT_RETURN(sub != NULL, PJ_EINVAL);<br>-+ set_timer(sub, TIMER_TYPE_UAS_TIMEOUT, seconds);<br>-+}<br>-+<br>-+<br>-+/*<br>- * Destructor.<br>- */<br>- static void evsub_on_destroy(void *obj)<br>-diff --git a/pjsip/src/pjsip-simple/evsub_msg.c b/pjsip/src/pjsip-simple/evsub_msg.c<br>-index b44a715..b37db1c 100644<br>---- a/pjsip/src/pjsip-simple/evsub_msg.c<br>-+++ b/pjsip/src/pjsip-simple/evsub_msg.c<br>-@@ -179,7 +179,7 @@ static int pjsip_sub_state_hdr_print(pjsip_sub_state_hdr *hdr,<br>- }<br>- if (hdr->retry_after >= 0) {<br>- pj_memcpy(p, ";retry-after=", 13);<br>-- p += 9;<br>-+ p += 13;<br>- printed = pj_utoa(hdr->retry_after, p);<br>- p += printed;<br>- }<br>--- <br>-2.9.3<br>-<br>diff --git a/third-party/pjproject/patches/0010-r5665-svn-backport-ICE-Use-STUN-FINGERPRINT-attribut.patch b/third-party/pjproject/patches/0010-r5665-svn-backport-ICE-Use-STUN-FINGERPRINT-attribut.patch<br>new file mode 100644<br>index 0000000..3c83cc5<br>--- /dev/null<br>+++ b/third-party/pjproject/patches/0010-r5665-svn-backport-ICE-Use-STUN-FINGERPRINT-attribut.patch<br>@@ -0,0 +1,41 @@<br>+From 06bc834969a34d2c60e05beed3051b4a6d34c125 Mon Sep 17 00:00:00 2001<br>+From: Richard Mudgett <rmudgett@digium.com><br>+Date: Thu, 28 Sep 2017 10:57:23 -0500<br>+Subject: [PATCH 3/3] r5665 svn backport ICE: Use STUN FINGERPRINT attribute<br>+ when sending keepalives<br>+<br>+Fixed #2046: ICE: Use STUN FINGERPRINT attribute when sending keepalives<br>+<br>+Per RFC 5245 Section 10:<br>+<br>+ If STUN is being used for keepalives, a STUN Binding Indication is<br>+ used [RFC5389]. The Indication MUST NOT utilize any authentication<br>+ mechanism. It SHOULD contain the FINGERPRINT attribute to aid in<br>+ demultiplexing, but SHOULD NOT contain any other attributes.<br>+---<br>+ pjnath/src/pjnath/ice_session.c | 8 +++++---<br>+ 1 file changed, 5 insertions(+), 3 deletions(-)<br>+<br>+diff --git a/pjnath/src/pjnath/ice_session.c b/pjnath/src/pjnath/ice_session.c<br>+index 27a2950..63a0d1c 100644<br>+--- a/pjnath/src/pjnath/ice_session.c<br>++++ b/pjnath/src/pjnath/ice_session.c<br>+@@ -1217,10 +1217,12 @@ static void ice_keep_alive(pj_ice_sess *ice, pj_bool_t send_now)<br>+ msg_data = PJ_POOL_ZALLOC_T(tdata->pool, pj_ice_msg_data);<br>+ msg_data->transport_id = the_check->lcand->transport_id;<br>+ <br>+- /* Temporarily disable FINGERPRINT. The Binding Indication <br>+- * SHOULD NOT contain any attributes.<br>++ /* RFC 5245 Section 10:<br>++ * The Binding Indication SHOULD contain the FINGERPRINT attribute<br>++ * to aid in demultiplexing, but SHOULD NOT contain any other<br>++ * attributes.<br>+ */<br>+- saved = pj_stun_session_use_fingerprint(comp->stun_sess, PJ_FALSE);<br>++ saved = pj_stun_session_use_fingerprint(comp->stun_sess, PJ_TRUE);<br>+ <br>+ /* Send to session */<br>+ addr_len = pj_sockaddr_get_len(&the_check->rcand->addr);<br>+-- <br>+2.7.4<br>+<br>diff --git a/third-party/pjproject/patches/0011-r5554-svn-backport-Increase-SENDER_WIDTH-column-size.patch b/third-party/pjproject/patches/0011-r5554-svn-backport-Increase-SENDER_WIDTH-column-size.patch<br>deleted file mode 100644<br>index 4c53337..0000000<br>--- a/third-party/pjproject/patches/0011-r5554-svn-backport-Increase-SENDER_WIDTH-column-size.patch<br>+++ /dev/null<br>@@ -1,77 +0,0 @@<br>-From df1ceb301c8a17969c467e3cf00246cfc28d1732 Mon Sep 17 00:00:00 2001<br>-From: Richard Mudgett <rmudgett@digium.com><br>-Date: Mon, 20 Feb 2017 12:19:05 -0600<br>-Subject: [PATCH 1/5] r5554 svn backport Increase SENDER_WIDTH column size for<br>- 64-bit systems.<br>-<br>-Re #1994 (misc): Make the log's sender and thread width a compile-time configurable setting.<br>-<br>-Thanks to Richard Mudgett for the suggestion.<br>----<br>- pjlib/include/pj/config.h | 27 +++++++++++++++++++++++++++<br>- pjlib/src/pj/log.c | 4 ++--<br>- 2 files changed, 29 insertions(+), 2 deletions(-)<br>-<br>-diff --git a/pjlib/include/pj/config.h b/pjlib/include/pj/config.h<br>-index 079d69b..3523f50 100644<br>---- a/pjlib/include/pj/config.h<br>-+++ b/pjlib/include/pj/config.h<br>-@@ -442,6 +442,33 @@<br>- #endif<br>- <br>- /**<br>-+ * Log sender width.<br>-+ *<br>-+ * Default: 22 (for 64-bit machines), 14 otherwise<br>-+ */<br>-+#ifndef PJ_LOG_SENDER_WIDTH<br>-+# if PJ_HAS_STDINT_H<br>-+# include <stdint.h><br>-+# if (UINTPTR_MAX == 0xffffffffffffffff)<br>-+# define PJ_LOG_SENDER_WIDTH 22<br>-+# else<br>-+# define PJ_LOG_SENDER_WIDTH 14<br>-+# endif<br>-+# else<br>-+# define PJ_LOG_SENDER_WIDTH 14<br>-+# endif<br>-+#endif<br>-+<br>-+/**<br>-+ * Log thread name width.<br>-+ *<br>-+ * Default: 12<br>-+ */<br>-+#ifndef PJ_LOG_THREAD_WIDTH<br>-+# define PJ_LOG_THREAD_WIDTH 12<br>-+#endif<br>-+<br>-+/**<br>- * Colorfull terminal (for logging etc).<br>- *<br>- * Default: 1<br>-diff --git a/pjlib/src/pj/log.c b/pjlib/src/pj/log.c<br>-index 293ad46..cf7ac37 100644<br>---- a/pjlib/src/pj/log.c<br>-+++ b/pjlib/src/pj/log.c<br>-@@ -380,7 +380,7 @@ PJ_DEF(void) pj_log( const char *sender, int level,<br>- pre += pj_utoa_pad(ptime.msec, pre, 3, '0');<br>- }<br>- if (log_decor & PJ_LOG_HAS_SENDER) {<br>-- enum { SENDER_WIDTH = 14 };<br>-+ enum { SENDER_WIDTH = PJ_LOG_SENDER_WIDTH };<br>- pj_size_t sender_len = strlen(sender);<br>- if (pre!=log_buffer) *pre++ = ' ';<br>- if (sender_len <= SENDER_WIDTH) {<br>-@@ -395,7 +395,7 @@ PJ_DEF(void) pj_log( const char *sender, int level,<br>- }<br>- }<br>- if (log_decor & PJ_LOG_HAS_THREAD_ID) {<br>-- enum { THREAD_WIDTH = 12 };<br>-+ enum { THREAD_WIDTH = PJ_LOG_THREAD_WIDTH };<br>- const char *thread_name = pj_thread_get_name(pj_thread_this());<br>- pj_size_t thread_len = strlen(thread_name);<br>- *pre++ = ' ';<br>--- <br>-2.7.4<br>-<br>diff --git a/third-party/pjproject/patches/0013-r5559-svn-backport-Fix-to-resolve-DNS-SRV-crashes.patch b/third-party/pjproject/patches/0013-r5559-svn-backport-Fix-to-resolve-DNS-SRV-crashes.patch<br>deleted file mode 100644<br>index dc03cbc..0000000<br>--- a/third-party/pjproject/patches/0013-r5559-svn-backport-Fix-to-resolve-DNS-SRV-crashes.patch<br>+++ /dev/null<br>@@ -1,112 +0,0 @@<br>-From d9d52f005f6d0242ea84e7c59ad6b25f052c8485 Mon Sep 17 00:00:00 2001<br>-From: Richard Mudgett <rmudgett@digium.com><br>-Date: Mon, 20 Feb 2017 12:05:32 -0600<br>-Subject: [PATCH 3/5] r5559 svn backport Fix to resolve DNS SRV crashes.<br>-<br>-Re #1994 (misc): Don't try to resolve a DNS SRV query that is already considered resolved.<br>-Thanks to Richard Mudgett for the patch.<br>-<br>-srv_resolver.c: Don't try to send query if already considered resolved.<br>-<br>-* In resolve_hostnames() don't try to resolve a query that is already<br>-considered resolved.<br>-<br>-* In resolve_hostnames() fix DNS typo in comments.<br>-<br>-* In build_server_entries() move a common expression assigning to cnt<br>-earlier.<br>-<br>-sip_transport.c: Fix tdata object name to actually contain the pointer.<br>-<br>-It helps if the logs referencing a tdata object buffer actually have<br>-a name that includes the correct pointer as part of the name. Also<br>-since the tdata has its own pool it helps if any logs referencing the<br>-pool have the same name as the tdata object. This change brings tdata<br>-logging in line with how tsx objects are named.<br>----<br>- pjlib-util/src/pjlib-util/srv_resolver.c | 18 +++++++++++++-----<br>- pjsip/src/pjsip/sip_transport.c | 3 ++-<br>- 2 files changed, 15 insertions(+), 6 deletions(-)<br>-<br>-diff --git a/pjlib-util/src/pjlib-util/srv_resolver.c b/pjlib-util/src/pjlib-util/srv_resolver.c<br>-index 8a2f7e1..84ad3f6 100644<br>---- a/pjlib-util/src/pjlib-util/srv_resolver.c<br>-+++ b/pjlib-util/src/pjlib-util/srv_resolver.c<br>-@@ -407,8 +407,9 @@ static void build_server_entries(pj_dns_srv_async_query *query_job,<br>- for (i=0; i<query_job->srv_cnt; ++i) {<br>- pj_in_addr addr;<br>- pj_in6_addr addr6;<br>-+ unsigned cnt = query_job->srv[i].addr_cnt;<br>- <br>-- if (query_job->srv[i].addr_cnt != 0) {<br>-+ if (cnt != 0) {<br>- /* IP address already resolved */<br>- continue;<br>- }<br>-@@ -417,7 +418,6 @@ static void build_server_entries(pj_dns_srv_async_query *query_job,<br>- pj_inet_pton(pj_AF_INET(), &query_job->srv[i].target_name,<br>- &addr) == PJ_SUCCESS)<br>- {<br>-- unsigned cnt = query_job->srv[i].addr_cnt;<br>- pj_sockaddr_init(pj_AF_INET(), &query_job->srv[i].addr[cnt],<br>- NULL, query_job->srv[i].port);<br>- query_job->srv[i].addr[cnt].ipv4.sin_addr = addr;<br>-@@ -427,7 +427,6 @@ static void build_server_entries(pj_dns_srv_async_query *query_job,<br>- pj_inet_pton(pj_AF_INET6(), &query_job->srv[i].target_name,<br>- &addr6) == PJ_SUCCESS)<br>- {<br>-- unsigned cnt = query_job->srv[i].addr_cnt;<br>- pj_sockaddr_init(pj_AF_INET6(), &query_job->srv[i].addr[cnt],<br>- NULL, query_job->srv[i].port);<br>- query_job->srv[i].addr[cnt].ipv6.sin6_addr = addr6;<br>-@@ -480,6 +479,15 @@ static pj_status_t resolve_hostnames(pj_dns_srv_async_query *query_job)<br>- for (i=0; i<query_job->srv_cnt; ++i) {<br>- struct srv_target *srv = &query_job->srv[i];<br>- <br>-+ if (srv->addr_cnt != 0) {<br>-+ /*<br>-+ * This query is already counted as resolved because of the<br>-+ * additional records in the SRV response or the target name<br>-+ * is an IP address exception in build_server_entries().<br>-+ */<br>-+ continue;<br>-+ }<br>-+<br>- PJ_LOG(5, (query_job->objname, <br>- "Starting async DNS A query_job for %.*s",<br>- (int)srv->target_name.slen, <br>-@@ -493,7 +501,7 @@ static pj_status_t resolve_hostnames(pj_dns_srv_async_query *query_job)<br>- <br>- status = PJ_SUCCESS;<br>- <br>-- /* Start DNA A record query */<br>-+ /* Start DNS A record query */<br>- if ((query_job->option & PJ_DNS_SRV_RESOLVE_AAAA_ONLY) == 0)<br>- {<br>- if ((query_job->option & PJ_DNS_SRV_RESOLVE_AAAA) != 0) {<br>-@@ -511,7 +519,7 @@ static pj_status_t resolve_hostnames(pj_dns_srv_async_query *query_job)<br>- &srv->common, &srv->q_a);<br>- }<br>- <br>-- /* Start DNA AAAA record query */<br>-+ /* Start DNS AAAA record query */<br>- if (status == PJ_SUCCESS &&<br>- (query_job->option & PJ_DNS_SRV_RESOLVE_AAAA) != 0)<br>- {<br>-diff --git a/pjsip/src/pjsip/sip_transport.c b/pjsip/src/pjsip/sip_transport.c<br>-index d672a6d..6dd14d1 100644<br>---- a/pjsip/src/pjsip/sip_transport.c<br>-+++ b/pjsip/src/pjsip/sip_transport.c<br>-@@ -422,7 +422,8 @@ PJ_DEF(pj_status_t) pjsip_tx_data_create( pjsip_tpmgr *mgr,<br>- tdata = PJ_POOL_ZALLOC_T(pool, pjsip_tx_data);<br>- tdata->pool = pool;<br>- tdata->mgr = mgr;<br>-- pj_memcpy(tdata->obj_name, pool->obj_name, PJ_MAX_OBJ_NAME);<br>-+ pj_ansi_snprintf(tdata->obj_name, sizeof(tdata->obj_name), "tdta%p", tdata);<br>-+ pj_memcpy(pool->obj_name, tdata->obj_name, sizeof(pool->obj_name));<br>- <br>- status = pj_atomic_create(tdata->pool, 0, &tdata->ref_cnt);<br>- if (status != PJ_SUCCESS) {<br>--- <br>-2.7.4<br>-<br>diff --git a/third-party/pjproject/patches/0014-Add-pjsip-transport-register-type-ipv6.patch b/third-party/pjproject/patches/0014-Add-pjsip-transport-register-type-ipv6.patch<br>deleted file mode 100644<br>index 796473a..0000000<br>--- a/third-party/pjproject/patches/0014-Add-pjsip-transport-register-type-ipv6.patch<br>+++ /dev/null<br>@@ -1,62 +0,0 @@<br>-From daeb0956524606b597704a90b54d81340e10b3e4 Mon Sep 17 00:00:00 2001<br>-From: Joshua Colp <jcolp@digium.com><br>-Date: Tue, 7 Mar 2017 12:32:49 +0000<br>-Subject: [PATCH] Add support for registering IPv6 transport type.<br>-<br>-This change allows an IPv6 transport type to be registered<br>-and used. The IPv4 transport is found (if available) and the<br>-IPv4 flag added to its type to match how the finding of<br>-IPv6 transport types works.<br>----<br>- pjsip/src/pjsip/sip_transport.c | 15 +++++++++++++--<br>- 1 file changed, 13 insertions(+), 2 deletions(-)<br>-<br>-diff --git a/pjsip/src/pjsip/sip_transport.c b/pjsip/src/pjsip/sip_transport.c<br>-index 7df6138..ce72814 100644<br>---- a/pjsip/src/pjsip/sip_transport.c<br>-+++ b/pjsip/src/pjsip/sip_transport.c<br>-@@ -236,6 +236,7 @@ PJ_DEF(pj_status_t) pjsip_transport_register_type( unsigned tp_flag,<br>- int *p_tp_type)<br>- {<br>- unsigned i;<br>-+ pjsip_transport_type_e parent = 0;<br>- <br>- PJ_ASSERT_RETURN(tp_flag && tp_name && def_port, PJ_EINVAL);<br>- PJ_ASSERT_RETURN(pj_ansi_strlen(tp_name) <<br>-@@ -243,6 +244,11 @@ PJ_DEF(pj_status_t) pjsip_transport_register_type( unsigned tp_flag,<br>- PJ_ENAMETOOLONG);<br>- <br>- for (i=1; i<PJ_ARRAY_SIZE(transport_names); ++i) {<br>-+ if (tp_flag & PJSIP_TRANSPORT_IPV6 &&<br>-+ pj_stricmp2(&transport_names[i].name, tp_name) == 0)<br>-+ {<br>-+ parent = transport_names[i].type;<br>-+ }<br>- if (transport_names[i].type == 0)<br>- break;<br>- }<br>-@@ -250,14 +256,19 @@ PJ_DEF(pj_status_t) pjsip_transport_register_type( unsigned tp_flag,<br>- if (i == PJ_ARRAY_SIZE(transport_names))<br>- return PJ_ETOOMANY;<br>- <br>-- transport_names[i].type = (pjsip_transport_type_e)i;<br>-+ if (tp_flag & PJSIP_TRANSPORT_IPV6 && parent) {<br>-+ transport_names[i].type = parent | PJSIP_TRANSPORT_IPV6;<br>-+ } else {<br>-+ transport_names[i].type = (pjsip_transport_type_e)i;<br>-+ }<br>-+<br>- transport_names[i].port = (pj_uint16_t)def_port;<br>- pj_ansi_strcpy(transport_names[i].name_buf, tp_name);<br>- transport_names[i].name = pj_str(transport_names[i].name_buf);<br>- transport_names[i].flag = tp_flag;<br>- <br>- if (p_tp_type)<br>-- *p_tp_type = i;<br>-+ *p_tp_type = transport_names[i].type;<br>- <br>- return PJ_SUCCESS;<br>- }<br>--- <br>-2.7.4<br>-<br>diff --git a/third-party/pjproject/patches/0025-fix-print-xml-crash.patch b/third-party/pjproject/patches/0025-fix-print-xml-crash.patch<br>deleted file mode 100644<br>index eafc389..0000000<br>--- a/third-party/pjproject/patches/0025-fix-print-xml-crash.patch<br>+++ /dev/null<br>@@ -1,24 +0,0 @@<br>-From 1bc5ca699f523bd8e910203a3eb4dee58f366976 Mon Sep 17 00:00:00 2001<br>-From: Joshua Elson <joshelson@gmail.com><br>-Date: Mon, 20 Mar 2017 19:28:47 -0600<br>-Subject: [PATCH] Prevent memory corruption on xml tag write<br>-<br>----<br>- pjlib-util/src/pjlib-util/xml.c | 1 +<br>- 1 file changed, 1 insertion(+)<br>-<br>-diff --git a/pjlib-util/src/pjlib-util/xml.c b/pjlib-util/src/pjlib-util/xml.c<br>-index 296b232..b0aad26 100644<br>---- a/pjlib-util/src/pjlib-util/xml.c<br>-+++ b/pjlib-util/src/pjlib-util/xml.c<br>-@@ -248,6 +248,7 @@ static int xml_print_node( const pj_xml_node *node, int indent,<br>- if (node->content.slen==0 &&<br>- node->node_head.next==(pj_xml_node*)&node->node_head)<br>- {<br>-+ if (SIZE_LEFT() < 3) return -1;<br>- *p++ = ' ';<br>- *p++ = '/';<br>- *p++ = '>';<br>--- <br>-2.10.1 (Apple Git-78)<br>-<br>diff --git a/third-party/pjproject/patches/0035-r5572-svn-backport-dialog-transaction-deadlock.patch b/third-party/pjproject/patches/0035-r5572-svn-backport-dialog-transaction-deadlock.patch<br>deleted file mode 100644<br>index 0c5e986..0000000<br>--- a/third-party/pjproject/patches/0035-r5572-svn-backport-dialog-transaction-deadlock.patch<br>+++ /dev/null<br>@@ -1,32 +0,0 @@<br>-Index: trunk/pjsip/src/pjsip/sip_transaction.c<br>-===================================================================<br>---- a/pjsip/src/pjsip/sip_transaction.c (revision 5244)<br>-+++ b/pjsip/src/pjsip/sip_transaction.c (revision 5572)<br>-@@ -1231,5 +1231,27 @@<br>- PJSIP_EVENT_INIT_TSX_STATE(e, tsx, event_src_type, event_src,<br>- prev_state);<br>-+<br>-+ /* For timer event, release lock to avoid deadlock.<br>-+ * This should be safe because:<br>-+ * 1. The tsx state just switches to TERMINATED or DESTROYED.<br>-+ * 2. There should be no other processing taking place. All other<br>-+ * events, such as the ones handled by tsx_on_state_terminated()<br>-+ * should be ignored.<br>-+ * 3. tsx_shutdown() hasn't been called.<br>-+ * Refer to ticket #2001 (https://trac.pjsip.org/repos/ticket/2001).<br>-+ */<br>-+ if (event_src_type == PJSIP_EVENT_TIMER &&<br>-+ (pj_timer_entry *)event_src == &tsx->timeout_timer)<br>-+ {<br>-+ pj_grp_lock_release(tsx->grp_lock);<br>-+ }<br>-+<br>- (*tsx->tsx_user->on_tsx_state)(tsx, &e);<br>-+<br>-+ if (event_src_type == PJSIP_EVENT_TIMER &&<br>-+ (pj_timer_entry *)event_src == &tsx->timeout_timer)<br>-+ {<br>-+ pj_grp_lock_acquire(tsx->grp_lock);<br>-+ }<br>- }<br>- <br>diff --git a/third-party/pjproject/patches/0036-r5573-svn-backport-ua-pjsua-transaction-deadlock.patch b/third-party/pjproject/patches/0036-r5573-svn-backport-ua-pjsua-transaction-deadlock.patch<br>deleted file mode 100644<br>index 5887380..0000000<br>--- a/third-party/pjproject/patches/0036-r5573-svn-backport-ua-pjsua-transaction-deadlock.patch<br>+++ /dev/null<br>@@ -1,119 +0,0 @@<br>-Index: trunk/pjsip/include/pjsip/sip_transaction.h<br>-===================================================================<br>---- a/pjsip/include/pjsip/sip_transaction.h (revision 5572)<br>-+++ b/pjsip/include/pjsip/sip_transaction.h (revision 5573)<br>-@@ -180,4 +180,8 @@<br>- * is created by calling #pjsip_tsx_create_key() from an incoming message.<br>- *<br>-+ * IMPORTANT: To prevent deadlock, application should use<br>-+ * #pjsip_tsx_layer_find_tsx2() instead which only adds a reference to<br>-+ * the transaction instead of locking it.<br>-+ *<br>- * @param key The key string to find the transaction.<br>- * @param lock If non-zero, transaction will be locked before the<br>-@@ -190,4 +194,19 @@<br>- PJ_DECL(pjsip_transaction*) pjsip_tsx_layer_find_tsx( const pj_str_t *key,<br>- pj_bool_t lock );<br>-+<br>-+/**<br>-+ * Find a transaction with the specified key. The transaction key normally<br>-+ * is created by calling #pjsip_tsx_create_key() from an incoming message.<br>-+ *<br>-+ * @param key The key string to find the transaction.<br>-+ * @param add_ref If non-zero, transaction's reference will be added<br>-+ * by one before the function returns, to make sure that<br>-+ * it's not deleted by other threads.<br>-+ *<br>-+ * @return The matching transaction instance, or NULL if transaction<br>-+ * can not be found.<br>-+ */<br>-+PJ_DECL(pjsip_transaction*) pjsip_tsx_layer_find_tsx2( const pj_str_t *key,<br>-+ pj_bool_t add_ref );<br>- <br>- /**<br>-Index: trunk/pjsip/src/pjsip/sip_transaction.c<br>-===================================================================<br>---- a/pjsip/src/pjsip/sip_transaction.c (revision 5572)<br>-+++ b/pjsip/src/pjsip/sip_transaction.c (revision 5573)<br>-@@ -642,6 +642,6 @@<br>- * Find a transaction.<br>- */<br>--PJ_DEF(pjsip_transaction*) pjsip_tsx_layer_find_tsx( const pj_str_t *key,<br>-- pj_bool_t lock )<br>-+static pjsip_transaction* find_tsx( const pj_str_t *key, pj_bool_t lock,<br>-+ pj_bool_t add_ref )<br>- {<br>- pjsip_transaction *tsx;<br>-@@ -655,5 +655,5 @@<br>- /* Prevent the transaction to get deleted before we have chance to lock it.<br>- */<br>-- if (tsx && lock)<br>-+ if (tsx)<br>- pj_grp_lock_add_ref(tsx->grp_lock);<br>- <br>-@@ -667,10 +667,27 @@<br>- PJ_RACE_ME(5);<br>- <br>-- if (tsx && lock) {<br>-- pj_grp_lock_acquire(tsx->grp_lock);<br>-- pj_grp_lock_dec_ref(tsx->grp_lock);<br>-+ if (tsx) {<br>-+ if (lock)<br>-+ pj_grp_lock_acquire(tsx->grp_lock);<br>-+<br>-+ if (!add_ref)<br>-+ pj_grp_lock_dec_ref(tsx->grp_lock);<br>- }<br>- <br>- return tsx;<br>-+}<br>-+<br>-+<br>-+PJ_DEF(pjsip_transaction*) pjsip_tsx_layer_find_tsx( const pj_str_t *key,<br>-+ pj_bool_t lock )<br>-+{<br>-+ return find_tsx(key, lock, PJ_FALSE);<br>-+}<br>-+<br>-+<br>-+PJ_DEF(pjsip_transaction*) pjsip_tsx_layer_find_tsx2( const pj_str_t *key,<br>-+ pj_bool_t add_ref )<br>-+{<br>-+ return find_tsx(key, PJ_FALSE, add_ref);<br>- }<br>- <br>-Index: trunk/pjsip/src/pjsip/sip_ua_layer.c<br>-===================================================================<br>---- a/pjsip/src/pjsip/sip_ua_layer.c (revision 5572)<br>-+++ b/pjsip/src/pjsip/sip_ua_layer.c (revision 5573)<br>-@@ -552,10 +552,10 @@<br>- <br>- /* Lookup the INVITE transaction */<br>-- tsx = pjsip_tsx_layer_find_tsx(&key, PJ_TRUE);<br>-+ tsx = pjsip_tsx_layer_find_tsx2(&key, PJ_TRUE);<br>- <br>- /* We should find the dialog attached to the INVITE transaction */<br>- if (tsx) {<br>- dlg = (pjsip_dialog*) tsx->mod_data[mod_ua.mod.id];<br>-- pj_grp_lock_release(tsx->grp_lock);<br>-+ pj_grp_lock_dec_ref(tsx->grp_lock);<br>- <br>- /* Dlg may be NULL on some extreme condition<br>-Index: trunk/pjsip/src/pjsip-ua/sip_inv.c<br>-===================================================================<br>---- a/pjsip/src/pjsip-ua/sip_inv.c (revision 5572)<br>-+++ b/pjsip/src/pjsip-ua/sip_inv.c (revision 5573)<br>-@@ -3276,5 +3276,5 @@<br>- pjsip_tsx_create_key(rdata->tp_info.pool, &key, PJSIP_ROLE_UAS,<br>- pjsip_get_invite_method(), rdata);<br>-- invite_tsx = pjsip_tsx_layer_find_tsx(&key, PJ_TRUE);<br>-+ invite_tsx = pjsip_tsx_layer_find_tsx2(&key, PJ_TRUE);<br>- <br>- if (invite_tsx == NULL) {<br>-@@ -3325,5 +3325,5 @@<br>- <br>- if (invite_tsx)<br>-- pj_grp_lock_release(invite_tsx->grp_lock);<br>-+ pj_grp_lock_dec_ref(invite_tsx->grp_lock);<br>- }<br>- <br>diff --git a/third-party/pjproject/patches/0037-r5576-svn-backport-session-timer-crash.patch b/third-party/pjproject/patches/0037-r5576-svn-backport-session-timer-crash.patch<br>deleted file mode 100644<br>index 098adcd..0000000<br>--- a/third-party/pjproject/patches/0037-r5576-svn-backport-session-timer-crash.patch<br>+++ /dev/null<br>@@ -1,72 +0,0 @@<br>-Index: pjproject/trunk/pjsip/src/pjsip-ua/sip_timer.c<br>-===================================================================<br>---- a/pjsip/src/pjsip-ua/sip_timer.c (revision 5557)<br>-+++ b/pjsip/src/pjsip-ua/sip_timer.c (revision 5576)<br>-@@ -333,6 +333,8 @@<br>- pjsip_tx_data *tdata = NULL;<br>- pj_status_t status;<br>- pj_bool_t as_refresher;<br>-+ int entry_id;<br>-+ char obj_name[PJ_MAX_OBJ_NAME];<br>- <br>- pj_assert(inv);<br>- <br>-@@ -344,7 +346,10 @@<br>- /* Check our role */<br>- as_refresher =<br>- (inv->timer->refresher == TR_UAC && inv->timer->role == PJSIP_ROLE_UAC) ||<br>-- (inv->timer->refresher == TR_UAS && inv->timer->role == PJSIP_ROLE_UAS); <br>-+ (inv->timer->refresher == TR_UAS && inv->timer->role == PJSIP_ROLE_UAS);<br>-+<br>-+ entry_id = entry->id;<br>-+ pj_ansi_strncpy(obj_name, inv->pool->obj_name, PJ_MAX_OBJ_NAME);<br>- <br>- /* Do action based on role(refresher or refreshee). <br>- * As refresher:<br>-@@ -353,7 +358,7 @@<br>- * As refreshee:<br>- * - end session if there is no refresh request received.<br>- */<br>-- if (as_refresher && (entry->id != REFRESHER_EXPIRE_TIMER_ID)) {<br>-+ if (as_refresher && (entry_id != REFRESHER_EXPIRE_TIMER_ID)) {<br>- pj_time_val now;<br>- <br>- /* As refresher, reshedule the refresh request on the following:<br>-@@ -414,7 +419,7 @@<br>- }<br>- <br>- pj_gettimeofday(&now);<br>-- PJ_LOG(4, (inv->pool->obj_name,<br>-+ PJ_LOG(4, (obj_name,<br>- "Refreshing session after %ds (expiration period=%ds)",<br>- (now.sec-inv->timer->last_refresh.sec),<br>- inv->timer->setting.sess_expires));<br>-@@ -432,7 +437,7 @@<br>- NULL, &tdata);<br>- <br>- pj_gettimeofday(&now);<br>-- PJ_LOG(3, (inv->pool->obj_name, <br>-+ PJ_LOG(3, (obj_name,<br>- "No session %s received after %ds "<br>- "(expiration period=%ds), stopping session now!",<br>- (as_refresher?"refresh response":"refresh"),<br>-@@ -451,11 +456,16 @@<br>- status = pjsip_inv_send_msg(inv, tdata); <br>- }<br>- <br>-+ /*<br>-+ * At this point, dialog might have already been destroyed,<br>-+ * including its pool used by the invite session.<br>-+ */<br>-+<br>- /* Print error message, if any */<br>- if (status != PJ_SUCCESS) {<br>-- PJ_PERROR(2, (inv->pool->obj_name, status,<br>-+ PJ_PERROR(2, (obj_name, status,<br>- "Error in %s session timer",<br>-- ((as_refresher && entry->id != REFRESHER_EXPIRE_TIMER_ID)? <br>-+ ((as_refresher && entry_id != REFRESHER_EXPIRE_TIMER_ID)?<br>- "refreshing" : "terminating")));<br>- }<br>- }<br>- <br>diff --git a/third-party/pjproject/patches/0048-r5576-svn-backport-tls-crash.patch b/third-party/pjproject/patches/0048-r5576-svn-backport-tls-crash.patch<br>deleted file mode 100644<br>index b5edc71..0000000<br>--- a/third-party/pjproject/patches/0048-r5576-svn-backport-tls-crash.patch<br>+++ /dev/null<br>@@ -1,32 +0,0 @@<br>-Index: /pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c<br>-===================================================================<br>---- a/pjlib/src/pj/ssl_sock_ossl.c (revision 5564)<br>-+++ b/pjlib/src/pj/ssl_sock_ossl.c (revision 5565)<br>-@@ -145,5 +145,6 @@<br>- SSL_STATE_NULL,<br>- SSL_STATE_HANDSHAKING,<br>-- SSL_STATE_ESTABLISHED<br>-+ SSL_STATE_ESTABLISHED,<br>-+ SSL_STATE_ERROR<br>- };<br>- <br>-@@ -1907,4 +1908,8 @@<br>- buf->len += size_;<br>- <br>-+ if (status != PJ_SUCCESS) {<br>-+ ssock->ssl_state = SSL_STATE_ERROR;<br>-+ }<br>-+<br>- ret = (*ssock->param.cb.on_data_read)(ssock, buf->data,<br>- buf->len, status,<br>-@@ -2658,5 +2663,9 @@<br>- /* Current cipher */<br>- cipher = SSL_get_current_cipher(ssock->ossl_ssl);<br>-- info->cipher = (SSL_CIPHER_get_id(cipher) & 0x00FFFFFF);<br>-+ if (cipher) {<br>-+ info->cipher = (SSL_CIPHER_get_id(cipher) & 0x00FFFFFF);<br>-+ } else {<br>-+ info->cipher = PJ_TLS_UNKNOWN_CIPHER;<br>-+ }<br>- <br>- /* Remote address */<br>diff --git a/third-party/pjproject/patches/0058-Parse-zero-length-multipart-body-parts-correctly.patch b/third-party/pjproject/patches/0058-Parse-zero-length-multipart-body-parts-correctly.patch<br>deleted file mode 100644<br>index 49334c3..0000000<br>--- a/third-party/pjproject/patches/0058-Parse-zero-length-multipart-body-parts-correctly.patch<br>+++ /dev/null<br>@@ -1,41 +0,0 @@<br>-From f0c717463d569f87a16f9b014033c8ca8939a7b4 Mon Sep 17 00:00:00 2001<br>-From: Mark Michelson <mmichelson@digium.com><br>-Date: Thu, 13 Apr 2017 16:59:40 -0500<br>-Subject: [PATCH] Parse zero-length multipart body parts correctly.<br>-<br>-The calculation of end_body could result in a negative length being<br>-passed to multipart_body_parse_part().<br>----<br>- pjsip/src/pjsip/sip_multipart.c | 16 +++++++++-------<br>- 1 file changed, 9 insertions(+), 7 deletions(-)<br>-<br>-diff --git a/pjsip/src/pjsip/sip_multipart.c b/pjsip/src/pjsip/sip_multipart.c<br>-index 8351f7e..b302139 100644<br>---- a/pjsip/src/pjsip/sip_multipart.c<br>-+++ b/pjsip/src/pjsip/sip_multipart.c<br>-@@ -653,13 +653,15 @@ PJ_DEF(pjsip_msg_body*) pjsip_multipart_parse(pj_pool_t *pool,<br>- <br>- end_body = curptr;<br>- <br>-- /* The newline preceeding the delimiter is conceptually part of<br>-- * the delimiter, so trim it from the body.<br>-- */<br>-- if (*(end_body-1) == '\n')<br>-- --end_body;<br>-- if (*(end_body-1) == '\r')<br>-- --end_body;<br>-+ if (end_body > start_body) {<br>-+ /* The newline preceeding the delimiter is conceptually part of<br>-+ * the delimiter, so trim it from the body.<br>-+ */<br>-+ if (*(end_body-1) == '\n')<br>-+ --end_body;<br>-+ if (*(end_body-1) == '\r')<br>-+ --end_body;<br>-+ }<br>- <br>- /* Now that we have determined the part's boundary, parse it<br>- * to get the header and body part of the part.<br>--- <br>-1.9.1<br>-<br>diff --git a/third-party/pjproject/patches/0059-Ensure-2543-transaction-key-buffer-is-large-enough.patch b/third-party/pjproject/patches/0059-Ensure-2543-transaction-key-buffer-is-large-enough.patch<br>deleted file mode 100644<br>index eb5a7db..0000000<br>--- a/third-party/pjproject/patches/0059-Ensure-2543-transaction-key-buffer-is-large-enough.patch<br>+++ /dev/null<br>@@ -1,29 +0,0 @@<br>-From b5f0f8868363c482a2c4ce343e3ee6ad256b0708 Mon Sep 17 00:00:00 2001<br>-From: Mark Michelson <mmichelson@digium.com><br>-Date: Thu, 13 Apr 2017 16:20:07 -0500<br>-Subject: [PATCH] Ensure 2543 transaction key buffer is large enough.<br>-<br>-The CSeq method length needs to be factored into the allocated buffer<br>-length. Otherwise, the buffer may not be large enough to accommodate the<br>-entire key.<br>----<br>- pjsip/src/pjsip/sip_transaction.c | 3 ++-<br>- 1 file changed, 2 insertions(+), 1 deletion(-)<br>-<br>-diff --git a/pjsip/src/pjsip/sip_transaction.c b/pjsip/src/pjsip/sip_transaction.c<br>-index c1750dc..2200d8d 100644<br>---- a/pjsip/src/pjsip/sip_transaction.c<br>-+++ b/pjsip/src/pjsip/sip_transaction.c<br>-@@ -288,7 +288,8 @@ static pj_status_t create_tsx_key_2543( pj_pool_t *pool,<br>- host = &rdata->msg_info.via->sent_by.host;<br>- <br>- /* Calculate length required. */<br>-- len_required = 9 + /* CSeq number */<br>-+ len_required = method->name.slen + /* Method */<br>-+ 9 + /* CSeq number */<br>- rdata->msg_info.from->tag.slen + /* From tag. */<br>- rdata->msg_info.cid->id.slen + /* Call-ID */<br>- host->slen + /* Via host. */<br>--- <br>-1.9.1<br>-<br>diff --git a/third-party/pjproject/patches/0070-Set-PJSIP_INV_SUPPORT_UPDATE-correctly-in-pjsip_inv_.patch b/third-party/pjproject/patches/0070-Set-PJSIP_INV_SUPPORT_UPDATE-correctly-in-pjsip_inv_.patch<br>deleted file mode 100644<br>index 9238e3e..0000000<br>--- a/third-party/pjproject/patches/0070-Set-PJSIP_INV_SUPPORT_UPDATE-correctly-in-pjsip_inv_.patch<br>+++ /dev/null<br>@@ -1,29 +0,0 @@<br>-From 1193681959816effa121c4470748d5faa3a59272 Mon Sep 17 00:00:00 2001<br>-From: George Joseph <gjoseph@digium.com><br>-Date: Thu, 29 Jun 2017 13:42:10 -0600<br>-Subject: [PATCH] Set PJSIP_INV_SUPPORT_UPDATE correctly in<br>- pjsip_inv_verify_request3<br>-<br>-pjsip_inv_verify_request3 was setting rem_options when UPDATE was<br>-detected in the Allow header. That's just an internal variable and<br>-doesn't go anywhere. It's '*options' that needs to be set.<br>----<br>- pjsip/src/pjsip-ua/sip_inv.c | 2 +-<br>- 1 file changed, 1 insertion(+), 1 deletion(-)<br>-<br>-diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c<br>-index fbc8ebe..6db7e6b 100644<br>---- a/pjsip/src/pjsip-ua/sip_inv.c<br>-+++ b/pjsip/src/pjsip-ua/sip_inv.c<br>-@@ -1237,7 +1237,7 @@ PJ_DEF(pj_status_t) pjsip_inv_verify_request3(pjsip_rx_data *rdata,<br>- <br>- if (i != allow->count) {<br>- /* UPDATE is present in Allow */<br>-- rem_option |= PJSIP_INV_SUPPORT_UPDATE;<br>-+ *options |= PJSIP_INV_SUPPORT_UPDATE;<br>- }<br>- <br>- }<br>--- <br>-2.9.4<br>-<br>diff --git a/third-party/pjproject/patches/0075-Fixed-2030-Improve-error-handling-in-OpenSSL-socket.patch b/third-party/pjproject/patches/0075-Fixed-2030-Improve-error-handling-in-OpenSSL-socket.patch<br>deleted file mode 100644<br>index 1e7035d..0000000<br>--- a/third-party/pjproject/patches/0075-Fixed-2030-Improve-error-handling-in-OpenSSL-socket.patch<br>+++ /dev/null<br>@@ -1,247 +0,0 @@<br>-From 96c06899d95eaf01d05561554b21e8c63baa7129 Mon Sep 17 00:00:00 2001<br>-From: ming <ming@localhost><br>-Date: Thu, 27 Jul 2017 06:07:54 +0000<br>-Subject: [PATCH 75/76] Fixed #2030: Improve error handling in OpenSSL socket<br>-<br>----<br>- pjlib/src/pj/ssl_sock_ossl.c | 173 ++++++++++++++++++++++++++++++++++++++-----<br>- 1 file changed, 156 insertions(+), 17 deletions(-)<br>-<br>-diff --git a/pjlib/src/pj/ssl_sock_ossl.c b/pjlib/src/pj/ssl_sock_ossl.c<br>-index c466b3c..b8175e1 100644<br>---- a/pjlib/src/pj/ssl_sock_ossl.c<br>-+++ b/pjlib/src/pj/ssl_sock_ossl.c<br>-@@ -298,14 +298,104 @@ static pj_status_t flush_delayed_send(pj_ssl_sock_t *ssock);<br>- /* Expected maximum value of reason component in OpenSSL error code */<br>- #define MAX_OSSL_ERR_REASON 1200<br>- <br>--static pj_status_t STATUS_FROM_SSL_ERR(pj_ssl_sock_t *ssock,<br>-- unsigned long err)<br>-+<br>-+static char *SSLErrorString (int err)<br>- {<br>-- pj_status_t status;<br>-+ switch (err) {<br>-+ case SSL_ERROR_NONE:<br>-+ return "SSL_ERROR_NONE";<br>-+ case SSL_ERROR_ZERO_RETURN:<br>-+ return "SSL_ERROR_ZERO_RETURN";<br>-+ case SSL_ERROR_WANT_READ:<br>-+ return "SSL_ERROR_WANT_READ";<br>-+ case SSL_ERROR_WANT_WRITE:<br>-+ return "SSL_ERROR_WANT_WRITE";<br>-+ case SSL_ERROR_WANT_CONNECT:<br>-+ return "SSL_ERROR_WANT_CONNECT";<br>-+ case SSL_ERROR_WANT_ACCEPT:<br>-+ return "SSL_ERROR_WANT_ACCEPT";<br>-+ case SSL_ERROR_WANT_X509_LOOKUP:<br>-+ return "SSL_ERROR_WANT_X509_LOOKUP";<br>-+ case SSL_ERROR_SYSCALL:<br>-+ return "SSL_ERROR_SYSCALL";<br>-+ case SSL_ERROR_SSL:<br>-+ return "SSL_ERROR_SSL";<br>-+ default:<br>-+ return "SSL_ERROR_UNKNOWN";<br>-+ }<br>-+}<br>- <br>-- /* General SSL error, dig more from OpenSSL error queue */<br>-- if (err == SSL_ERROR_SSL)<br>-- err = ERR_get_error();<br>-+#define ERROR_LOG(msg, err) \<br>-+ PJ_LOG(2,("SSL", "%s (%s): Level: %d err: <%lu> <%s-%s-%s> len: %d", \<br>-+ msg, action, level, err, \<br>-+ (ERR_lib_error_string(err)? ERR_lib_error_string(err): "???"), \<br>-+ (ERR_func_error_string(err)? ERR_func_error_string(err):"???"),\<br>-+ (ERR_reason_error_string(err)? \<br>-+ ERR_reason_error_string(err): "???"), len));<br>-+<br>-+static void SSLLogErrors(char * action, int ret, int ssl_err, int len)<br>-+{<br>-+ char *ssl_err_str = SSLErrorString(ssl_err);<br>-+<br>-+ if (!action) {<br>-+ action = "UNKNOWN";<br>-+ }<br>-+<br>-+ switch (ssl_err) {<br>-+ case SSL_ERROR_SYSCALL:<br>-+ {<br>-+ unsigned long err2 = ERR_get_error();<br>-+ if (err2) {<br>-+ int level = 0;<br>-+ while (err2) {<br>-+ ERROR_LOG("SSL_ERROR_SYSCALL", err2);<br>-+ level++;<br>-+ err2 = ERR_get_error();<br>-+ }<br>-+ } else if (ret == 0) {<br>-+ /* An EOF was observed that violates the protocol */<br>-+<br>-+ /* The TLS/SSL handshake was not successful but was shut down<br>-+ * controlled and by the specifications of the TLS/SSL protocol.<br>-+ */<br>-+ } else if (ret == -1) {<br>-+ /* BIO error - look for more info in errno... */<br>-+ char errStr[250] = "";<br>-+ strerror_r(errno, errStr, sizeof(errStr));<br>-+ /* for now - continue logging these if they occur.... */<br>-+ PJ_LOG(4,("SSL", "BIO error, SSL_ERROR_SYSCALL (%s): "<br>-+ "errno: <%d> <%s> len: %d",<br>-+ action, errno, errStr, len));<br>-+ } else {<br>-+ /* ret!=0 & ret!=-1 & nothing on error stack - is this valid??? */<br>-+ PJ_LOG(2,("SSL", "SSL_ERROR_SYSCALL (%s) ret: %d len: %d",<br>-+ action, ret, len));<br>-+ }<br>-+ break;<br>-+ }<br>-+ case SSL_ERROR_SSL:<br>-+ {<br>-+ unsigned long err2 = ERR_get_error();<br>-+ int level = 0;<br>-+<br>-+ while (err2) {<br>-+ ERROR_LOG("SSL_ERROR_SSL", err2);<br>-+ level++;<br>-+ err2 = ERR_get_error();<br>-+ }<br>-+ break;<br>-+ }<br>-+ default:<br>-+ PJ_LOG(2,("SSL", "%lu [%s] (%s) ret: %d len: %d",<br>-+ ssl_err, ssl_err_str, action, ret, len));<br>-+ break;<br>-+ }<br>-+}<br>-+<br>-+<br>-+static pj_status_t GET_STATUS_FROM_SSL_ERR(unsigned long err)<br>-+{<br>-+ pj_status_t status;<br>- <br>- /* OpenSSL error range is much wider than PJLIB errno space, so<br>- * if it exceeds the space, only the error reason will be kept.<br>-@@ -317,13 +407,49 @@ static pj_status_t STATUS_FROM_SSL_ERR(pj_ssl_sock_t *ssock,<br>- status = ERR_GET_REASON(err);<br>- <br>- status += PJ_SSL_ERRNO_START;<br>-- ssock->last_err = err;<br>- return status;<br>- }<br>- <br>-+/* err contains ERR_get_error() status */<br>-+static pj_status_t STATUS_FROM_SSL_ERR(char *action, pj_ssl_sock_t *ssock,<br>-+ unsigned long err)<br>-+{<br>-+ int level = 0;<br>-+ int len = 0; //dummy<br>-+<br>-+ ERROR_LOG("STATUS_FROM_SSL_ERR", err);<br>-+ level++;<br>-+<br>-+ /* General SSL error, dig more from OpenSSL error queue */<br>-+ if (err == SSL_ERROR_SSL) {<br>-+ err = ERR_get_error();<br>-+ ERROR_LOG("STATUS_FROM_SSL_ERR", err);<br>-+ }<br>-+<br>-+ ssock->last_err = err;<br>-+ return GET_STATUS_FROM_SSL_ERR(err);<br>-+}<br>-+<br>-+/* err contains SSL_get_error() status */<br>-+static pj_status_t STATUS_FROM_SSL_ERR2(char *action, pj_ssl_sock_t *ssock,<br>-+ int ret, int err, int len)<br>-+{<br>-+ unsigned long ssl_err = err;<br>-+<br>-+ if (err == SSL_ERROR_SSL) {<br>-+ ssl_err = ERR_peek_error();<br>-+ }<br>-+<br>-+ /* Dig for more from OpenSSL error queue */<br>-+ SSLLogErrors(action, ret, err, len);<br>-+<br>-+ ssock->last_err = ssl_err;<br>-+ return GET_STATUS_FROM_SSL_ERR(ssl_err);<br>-+}<br>-+<br>- static pj_status_t GET_SSL_STATUS(pj_ssl_sock_t *ssock)<br>- {<br>-- return STATUS_FROM_SSL_ERR(ssock, ERR_get_error());<br>-+ return STATUS_FROM_SSL_ERR("status", ssock, ERR_get_error());<br>- }<br>- <br>- <br>-@@ -1514,7 +1640,7 @@ static pj_bool_t on_handshake_complete(pj_ssl_sock_t *ssock,<br>- unsigned long err;<br>- err = ERR_get_error();<br>- if (err != SSL_ERROR_NONE)<br>-- status = STATUS_FROM_SSL_ERR(ssock, err);<br>-+ status = STATUS_FROM_SSL_ERR("connecting", ssock, err);<br>- }<br>- reset_ssl_sock_state(ssock);<br>- }<br>-@@ -1833,11 +1959,11 @@ static pj_status_t do_handshake(pj_ssl_sock_t *ssock)<br>- }<br>- <br>- if (err < 0) {<br>-- err = SSL_get_error(ssock->ossl_ssl, err);<br>-- if (err != SSL_ERROR_NONE && err != SSL_ERROR_WANT_READ) <br>-+ int err2 = SSL_get_error(ssock->ossl_ssl, err);<br>-+ if (err2 != SSL_ERROR_NONE && err2 != SSL_ERROR_WANT_READ)<br>- {<br>- /* Handshake fails */<br>-- status = STATUS_FROM_SSL_ERR(ssock, err);<br>-+ status = STATUS_FROM_SSL_ERR2("Handshake", ssock, err, err2, 0);<br>- return status;<br>- }<br>- }<br>-@@ -1913,6 +2039,7 @@ static pj_bool_t asock_on_data_read (pj_activesock_t *asock,<br>- read_data_t *buf = *(OFFSET_OF_READ_DATA_PTR(ssock, data));<br>- void *data_ = (pj_int8_t*)buf->data + buf->len;<br>- int size_ = (int)(ssock->read_size - buf->len);<br>-+ int len = size_;<br>- <br>- /* SSL_read() may write some data to BIO write when re-negotiation<br>- * is on progress, so let's protect it with write mutex.<br>-@@ -1965,10 +2092,22 @@ static pj_bool_t asock_on_data_read (pj_activesock_t *asock,<br>- */<br>- if (err != SSL_ERROR_NONE && err != SSL_ERROR_WANT_READ)<br>- {<br>-- /* Reset SSL socket state, then return PJ_FALSE */<br>-- status = STATUS_FROM_SSL_ERR(ssock, err);<br>-- reset_ssl_sock_state(ssock);<br>-- goto on_error;<br>-+ if (err == SSL_ERROR_SYSCALL && size_ == -1 &&<br>-+ ERR_peek_error() == 0 && errno == 0)<br>-+ {<br>-+ status = STATUS_FROM_SSL_ERR2("Read", ssock, size_,<br>-+ err, len);<br>-+ PJ_LOG(4,("SSL", "SSL_read() = -1, with "<br>-+ "SSL_ERROR_SYSCALL, no SSL error, "<br>-+ "and errno = 0 - skip BIO error"));<br>-+ /* Ignore these errors */<br>-+ } else {<br>-+ /* Reset SSL socket state, then return PJ_FALSE */<br>-+ status = STATUS_FROM_SSL_ERR2("Read", ssock, size_,<br>-+ err, len);<br>-+ reset_ssl_sock_state(ssock);<br>-+ goto on_error;<br>-+ }<br>- }<br>- <br>- status = do_handshake(ssock);<br>-@@ -2856,7 +2995,7 @@ static pj_status_t ssl_write(pj_ssl_sock_t *ssock,<br>- status = PJ_EBUSY;<br>- } else {<br>- /* Some problem occured */<br>-- status = STATUS_FROM_SSL_ERR(ssock, err);<br>-+ status = STATUS_FROM_SSL_ERR2("Write", ssock, nwritten, err, size);<br>- }<br>- } else {<br>- /* nwritten < *size, shouldn't happen, unless write BIO cannot hold <br>--- <br>-2.9.4<br>-<br>diff --git a/third-party/pjproject/patches/0080-STUN-Fingerprint-with-ICE.patch b/third-party/pjproject/patches/0080-STUN-Fingerprint-with-ICE.patch<br>deleted file mode 100644<br>index 96d44fa..0000000<br>--- a/third-party/pjproject/patches/0080-STUN-Fingerprint-with-ICE.patch<br>+++ /dev/null<br>@@ -1,35 +0,0 @@<br>-From 28490e9ddee0937516f9edcaf95d274fe5ceaf4c Mon Sep 17 00:00:00 2001<br>-From: Sean Bright <sean.bright@gmail.com><br>-Date: Mon, 25 Sep 2017 14:06:53 -0400<br>-Subject: [PATCH] ICE: Use STUN FINGERPRINT attribute when sending keepalives<br>-<br>-Per RFC 5245 Section 10:<br>-<br>- If STUN is being used for keepalives, a STUN Binding Indication is<br>- used [RFC5389]. The Indication MUST NOT utilize any authentication<br>- mechanism. It SHOULD contain the FINGERPRINT attribute to aid in<br>- demultiplexing, but SHOULD NOT contain any other attributes.<br>----<br>- pjnath/src/pjnath/ice_session.c | 6 ++----<br>- 1 file changed, 2 insertions(+), 4 deletions(-)<br>-<br>-diff --git a/pjnath/src/pjnath/ice_session.c b/pjnath/src/pjnath/ice_session.c<br>-index 159d7b1..f90005a 100644<br>---- a/pjnath/src/pjnath/ice_session.c<br>-+++ b/pjnath/src/pjnath/ice_session.c<br>-@@ -1217,10 +1217,8 @@ static void ice_keep_alive(pj_ice_sess *ice, pj_bool_t send_now)<br>- msg_data = PJ_POOL_ZALLOC_T(tdata->pool, pj_ice_msg_data);<br>- msg_data->transport_id = the_check->lcand->transport_id;<br>- <br>-- /* Temporarily disable FINGERPRINT. The Binding Indication <br>-- * SHOULD NOT contain any attributes.<br>-- */<br>-- saved = pj_stun_session_use_fingerprint(comp->stun_sess, PJ_FALSE);<br>-+ /* Make sure that the FINGERPRINT attribute is used per RFC 5245 Section 10 */<br>-+ saved = pj_stun_session_use_fingerprint(comp->stun_sess, PJ_TRUE);<br>- <br>- /* Send to session */<br>- addr_len = pj_sockaddr_get_len(&the_check->rcand->addr);<br>--- <br>-2.7.4<br>-<br>diff --git a/third-party/versions.mak b/third-party/versions.mak<br>index 03dd6d3..4f645f1 100644<br>--- a/third-party/versions.mak<br>+++ b/third-party/versions.mak<br>@@ -1,2 +1,2 @@<br> <br>-PJPROJECT_VERSION = 2.6<br>+PJPROJECT_VERSION = 2.7<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6854">change 6854</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/6854"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I9ac5dbbffaadca25ad24fac8b9ab615e5ace6083 </div>
<div style="display:none"> Gerrit-Change-Number: 6854 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>