Commit 24c74f15 authored by Sébastien Blin's avatar Sébastien Blin

pjproject: bump to latest commit

Bump pjproject to prepare the patch for RFC6544. Also the patch
used to support gnutls is merged upstream so we don't need it
anymore.

Change-Id: I7d83d7693dbadd4650623baa29f1721710040a08
parent ca342f2b
255331254b91cde93df8a0df00cb1122b8f85ad2b59f5e8a8dadc8bd56d917e5c60bfc0127e2243be941f3a6d8f386aebaf46f2b95df961a7474bc95e8b16d5c pjproject-2.8.tar.gz
\ No newline at end of file
e203f3846db1a380b2bcb2e18fb73f6296a87c25d5b0b38d44df88a398c597bcb31c85a0e72b476908e4b56fdeb6fc5c586cf595f9723091d6a09659b75d1d5c pjproject-6b9212dcb4b3f781c1e922ae544b063880bc46ac.tar.gz
\ No newline at end of file
set BUILD=%SRC%..\build
set PJPROJECT_VERSION=2.7.2
set PJPROJECT_URL=http://www.pjsip.org/release/%PJPROJECT_VERSION%/pjproject-%PJPROJECT_VERSION%.tar.bz2
set PJPROJECT_VERSION=6b9212dcb4b3f781c1e922ae544b063880bc46ac
set PJPROJECT_URL=https://github.com/pjsip/pjproject/archive/%PJPROJECT_VERSION%.tar.gz
mkdir %BUILD%
if %USE_CACHE%==1 (
copy %CACHE_DIR%\pjproject-%PJPROJECT_VERSION%.tar.bz2 %cd%
copy %CACHE_DIR%\%PJPROJECT_VERSION%.tar.gz %cd%
) else (
%WGET_CMD% %PJPROJECT_URL%
)
7z -y x pjproject-%PJPROJECT_VERSION%.tar.bz2 && 7z -y x pjproject-%PJPROJECT_VERSION%.tar -o%BUILD%
del pjproject-%PJPROJECT_VERSION%.tar && del pjproject-%PJPROJECT_VERSION%.tar.bz2
7z -y x %PJPROJECT_VERSION%.tar.gz && 7z -y x %PJPROJECT_VERSION%.tar -o%BUILD%
del %PJPROJECT_VERSION%.tar && del %PJPROJECT_VERSION%.tar.gz
rename %BUILD%\pjproject-%PJPROJECT_VERSION% pjproject
cd %BUILD%\pjproject
......@@ -27,7 +27,6 @@ if "%NO_AUTO%"=="" (
)
set UNIXPATH=%SRC:\=/%
set UNIXPATH=%ROOTPATH%%UNIXPATH:C:/=%
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/gnutls.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/ipv6.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/ice_config.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/multiple_listeners.patch"
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -7,40 +7,55 @@ Description:
Increase PJ_ICE_MAX_CHECKS, which would be way too low for the
number of candidates.
.
Increase PJ_ICE_MAX_STUN to 3:
- One for IPv4
- One for IPv6
- One set by the user
Increase PJ_ICE_MAX_STUN to 6:
- One active, one passive for IPv4
- One active, one passive for IPv6
- One active, one passive set by the user
.
Increase PJ_ICE_COMP_BITS so that we can have more components:
- 2 Audio components
- 2 Video components
Author: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
pjnath/include/pjnath/config.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pjnath/include/pjnath/config.h b/pjnath/include/pjnath/config.h
index 5c2f04bd..d8b546c8 100644
--- a/pjnath/include/pjnath/config.h
+++ b/pjnath/include/pjnath/config.h
@@ -233,3 +233,3 @@
@@ -232,7 +232,7 @@
* Default: 16
*/
#ifndef PJ_ICE_MAX_CAND
-# define PJ_ICE_MAX_CAND 16
+# define PJ_ICE_MAX_CAND 256
#endif
@@ -243,3 +243,3 @@
#ifndef PJ_ICE_ST_MAX_CAND
-# define PJ_ICE_ST_MAX_CAND 8
+# define PJ_ICE_ST_MAX_CAND 32
#endif
@@ -254,3 +254,3 @@
@@ -253,7 +253,7 @@
* Default: 2
*/
#ifndef PJ_ICE_MAX_STUN
-# define PJ_ICE_MAX_STUN 2
+# define PJ_ICE_MAX_STUN 3
#endif
@@ -274,3 +274,3 @@
@@ -273,7 +273,7 @@
* the maximum number of components (PJ_ICE_MAX_COMP) value.
*/
#ifndef PJ_ICE_COMP_BITS
-# define PJ_ICE_COMP_BITS 1
+# define PJ_ICE_COMP_BITS 2
#endif
@@ -325,3 +325,3 @@
@@ -324,7 +324,7 @@
* Default: 32
*/
#ifndef PJ_ICE_MAX_CHECKS
-# define PJ_ICE_MAX_CHECKS 32
+# define PJ_ICE_MAX_CHECKS 1024
#endif
\ No newline at end of file
diff --git a/pjproject/pjsip/src/pjsip/sip_transport.c b/pjproject_new/pjsip/src/pjsip/sip_transport.c
index 4b2cc1a..22e3603 100644
pjsip/src/pjsip/sip_transport.c | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/pjsip/src/pjsip/sip_transport.c b/pjsip/src/pjsip/sip_transport.c
index 67e235a3..a270d0a9 100644
--- a/pjsip/src/pjsip/sip_transport.c
+++ b/pjsip/src/pjsip/sip_transport.c
@@ -1248,22 +1248,22 @@ PJ_DEF(pj_status_t) pjsip_tpmgr_register_tpfactory( pjsip_tpmgr *mgr,
@@ -1338,14 +1338,16 @@ PJ_DEF(pj_status_t) pjsip_tpmgr_register_tpfactory( pjsip_tpmgr *mgr,
pj_lock_acquire(mgr->lock);
- /* Check that no factory with the same type has been registered. */
+ /* Check that no factory with the same type and bound address has been registered. */
+ /* Check that no factory with the same type and bound address has been
+ * registered. */
status = PJ_SUCCESS;
for (p=mgr->factory_list.next; p!=&mgr->factory_list; p=p->next) {
- if (p->type == tpf->type) {
......@@ -15,52 +19,41 @@ index 4b2cc1a..22e3603 100644
- break;
- }
- if (p == tpf) {
- status = PJ_EEXISTS;
- break;
- }
+ if (p->type == tpf->type && !pj_sockaddr_cmp(&tpf->local_addr, &p->local_addr)) {
+ status = PJSIP_ETYPEEXISTS;
+ break;
+ }
+ if (p->type == tpf->type &&
+ !pj_sockaddr_cmp(&tpf->local_addr, &p->local_addr)) {
+ status = PJSIP_ETYPEEXISTS;
+ break;
+ }
+ if (p == tpf) {
+ status = PJ_EEXISTS;
+ break;
+ }
}
if (status != PJ_SUCCESS) {
- pj_lock_release(mgr->lock);
- return status;
+ pj_lock_release(mgr->lock);
+ return status;
}
pj_list_insert_before(&mgr->factory_list, tpf);
@@ -2047,13 +2047,11 @@ PJ_DEF(pj_status_t) pjsip_tpmgr_acquire_transport2(pjsip_tpmgr *mgr,
pj_memcpy(&key.rem_addr, remote, addr_len);
transport = (pjsip_transport*)
- pj_hash_get(mgr->table, &key, key_len, NULL);
-
+ pj_hash_get(mgr->table, &key, key_len, NULL);
+ unsigned flag = pjsip_transport_get_flag_from_type(type);
if (transport == NULL) {
status = PJ_EEXISTS;
break;
}
@@ -2166,10 +2168,10 @@ PJ_DEF(pj_status_t) pjsip_tpmgr_acquire_transport2(pjsip_tpmgr *mgr,
pj_hash_get(mgr->table, &key, key_len, NULL);
}
+ unsigned flag = pjsip_transport_get_flag_from_type(type);
if (transport == NULL &&
(!sel || sel->disable_connection_reuse == PJ_FALSE))
{
- unsigned flag = pjsip_transport_get_flag_from_type(type);
const pj_sockaddr *remote_addr = (const pj_sockaddr*)remote;
-
/* Ignore address for loop transports. */
if (type == PJSIP_TRANSPORT_LOOP ||
type == PJSIP_TRANSPORT_LOOP_DGRAM)
@@ -2135,6 +2135,11 @@ PJ_DEF(pj_status_t) pjsip_tpmgr_acquire_transport2(pjsip_tpmgr *mgr,
}
@@ -2258,7 +2260,15 @@ PJ_DEF(pj_status_t) pjsip_tpmgr_acquire_transport2(pjsip_tpmgr *mgr,
} else {
+ /* Make sure we don't use another factory than the one given if secure flag is set */
- /* Find factory with type matches the destination type */
+ /* Make sure we don't use another factory than the one given if
+ secure flag is set */
+ if (flag & PJSIP_TRANSPORT_SECURE) {
+ TRACE_((THIS_FILE, "Can't create new TLS transport with no provided suitable TLS listener."));
+ TRACE_((THIS_FILE, "Can't create new TLS transport with no "
+ "provided suitable TLS listener."));
+ return PJSIP_ETPNOTSUITABLE;
+ }
/* Find factory with type matches the destination type */
+
+ /* Find factory with type matches the destination type */
factory = mgr->factory_list.next;
while (factory != &mgr->factory_list) {
if (factory->type == type)
......@@ -129,7 +129,7 @@ index 63a0d1c9..6cae6b2e 100644
+ // Any 256 obsolete ips (should not happen), resize the array.
+ if (idx > 0 && idx % 256 == 0) {
+ char* newDeprecated = realloc(deprecatedAddrs, (idx + 256)*sizeof(char)*PJ_INET6_ADDRSTRLEN);
+ if (!newDeprecated) {
+ if (newDeprecated == NULL) {
+ perror("realloc error: abort");
+ return;
+ }
......
This diff is collapsed.
# PJPROJECT
PJPROJECT_VERSION := 2.8
PJPROJECT_VERSION := 6b9212dcb4b3f781c1e922ae544b063880bc46ac
PJPROJECT_URL := https://github.com/pjsip/pjproject/archive/$(PJPROJECT_VERSION).tar.gz
PJPROJECT_OPTIONS := --disable-oss \
......@@ -24,8 +24,8 @@ PJPROJECT_OPTIONS := --disable-oss \
--disable-libwebrtc \
--with-gnutls=$(PREFIX)
PJPROJECT_EXTRA_CFLAGS = -g -DPJ_ENABLE_EXTRA_CHECK=1 -DPJ_ICE_MAX_CAND=256 -DPJ_ICE_MAX_CHECKS=1024 -DPJ_ICE_COMP_BITS=2 -DPJ_ICE_MAX_STUN=3 -DPJSIP_MAX_PKT_LEN=8000 -DPJ_ICE_ST_MAX_CAND=32
PJPROJECT_EXTRA_CXXFLAGS = -g -DPJ_ENABLE_EXTRA_CHECK=1 -DPJ_ICE_MAX_CAND=256 -DPJ_ICE_MAX_CHECKS=1024 -DPJ_ICE_COMP_BITS=2 -DPJ_ICE_MAX_STUN=3 -DPJSIP_MAX_PKT_LEN=8000 -DPJ_ICE_ST_MAX_CAND=32
PJPROJECT_EXTRA_CFLAGS = -g -DPJ_ENABLE_EXTRA_CHECK=1 -DPJ_ICE_MAX_CAND=256 -DPJ_ICE_MAX_CHECKS=1024 -DPJ_ICE_COMP_BITS=2 -DPJ_ICE_MAX_STUN=3 -DPJSIP_MAX_PKT_LEN=8000 -DPJ_ICE_ST_MAX_CAND=32 -DPJ_HAS_TCP=1
PJPROJECT_EXTRA_CXXFLAGS = -g -DPJ_ENABLE_EXTRA_CHECK=1 -DPJ_ICE_MAX_CAND=256 -DPJ_ICE_MAX_CHECKS=1024 -DPJ_ICE_COMP_BITS=2 -DPJ_ICE_MAX_STUN=3 -DPJSIP_MAX_PKT_LEN=8000 -DPJ_ICE_ST_MAX_CAND=32 -DPJ_HAS_TCP=1
ifdef HAVE_WIN64
PJPROJECT_EXTRA_CFLAGS += -DPJ_WIN64=1
......@@ -54,7 +54,6 @@ pjproject: pjproject-$(PJPROJECT_VERSION).tar.gz .sum-pjproject
ifdef HAVE_WIN32
$(APPLY) $(SRC)/pjproject/pj_win.patch
endif
#$(APPLY) $(SRC)/pjproject/gnutls.patch
ifdef HAVE_ANDROID
$(APPLY) $(SRC)/pjproject/android.patch
endif
......
......@@ -618,8 +618,9 @@ RingAccount::SIPStartCall(SIPCall& call, IpAddr target)
return false;
}
//const pjsip_tpselector tp_sel = getTransportSelector();
const pjsip_tpselector tp_sel = {PJSIP_TPSELECTOR_TRANSPORT, {call.getTransport()->get()}};
pjsip_tpselector tp_sel;
tp_sel.type = PJSIP_TPSELECTOR_TRANSPORT;
tp_sel.u.transport = call.getTransport()->get();
if (pjsip_dlg_set_transport(dialog, &tp_sel) != PJ_SUCCESS) {
JAMI_ERR("Unable to associate transport for invite session dialog");
return false;
......
......@@ -149,7 +149,9 @@ class SIPVoIPLink {
* @return A transport selector structure
*/
static inline pjsip_tpselector getTransportSelector(pjsip_transport *transport) {
pjsip_tpselector tp = {PJSIP_TPSELECTOR_TRANSPORT, {transport}};
pjsip_tpselector tp;
tp.type = PJSIP_TPSELECTOR_TRANSPORT;
tp.u.transport = transport;
return tp;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment