diff options
author | Joshua Colp <jcolp@digium.com> | 2017-11-10 13:06:38 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2017-11-10 13:15:04 +0000 |
commit | 360d50d74c27b4e409790de9632de1b45e38d02e (patch) | |
tree | ca5e2ec8b0129425ce28918bd1ab75999445ae1b /third-party | |
parent | 6cce74440119b6a8b4f0b1e75da7f86b2478d7e0 (diff) |
pjsip: Add patch to allow all transports to be destroyed.
If a transport is created with the same transport type, source
IP address, and source port as one that already exists the old
transport is moved into a linked list called "tp_list".
If this old transport is later shutdown it will not be destroyed
as the process checks whether the transport is valid or not. This
check does not look at the "tp_list" when making the determination
causing the transport to not be destroyed.
This change updates the logic to query not just the main storage
method for transports but also the "tp_list".
Upstream issue https://trac.pjsip.org/repos/ticket/2061
ASTERISK-27411
Change-Id: Ic5c2bb60226df0ef1c8851359ed8d4cd64469429
Diffstat (limited to 'third-party')
-rw-r--r-- | third-party/pjproject/patches/0030-sip_transport-Destroy-transports-not-in-hash.patch | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/third-party/pjproject/patches/0030-sip_transport-Destroy-transports-not-in-hash.patch b/third-party/pjproject/patches/0030-sip_transport-Destroy-transports-not-in-hash.patch new file mode 100644 index 000000000..e42b0f7c6 --- /dev/null +++ b/third-party/pjproject/patches/0030-sip_transport-Destroy-transports-not-in-hash.patch @@ -0,0 +1,27 @@ +diff --git a/pjsip/src/pjsip/sip_transport.c b/pjsip/src/pjsip/sip_transport.c +index e4bec24..a39b56e 100644 +--- a/pjsip/src/pjsip/sip_transport.c ++++ b/pjsip/src/pjsip/sip_transport.c +@@ -957,7 +957,21 @@ static pj_bool_t is_transport_valid(pjsip_tpmgr *tpmgr, pjsip_transport *tp, + const pjsip_transport_key *key, + int key_len) + { +- return (pj_hash_get(tpmgr->table, key, key_len, NULL) == (void*)tp); ++ transport *tp_iter; ++ ++ if (pj_hash_get(tpmgr->table, key, key_len, NULL) == (void*)tp) { ++ return PJ_TRUE; ++ } ++ ++ tp_iter = tpmgr->tp_list.next; ++ while (tp_iter != &tpmgr->tp_list) { ++ if (tp_iter->tp == tp) { ++ return PJ_TRUE; ++ } ++ tp_iter = tp_iter->next; ++ } ++ ++ return PJ_FALSE; + } + + /* |