We actually got that link from NAF. What is the link that you believe to be correct??
By the way, errors in the patch process are nothing new. They've been there since the beginning.
Late reply since you've already added the patches from dslr
@dziny into a new version to fix this issue.
To explain this subtle bug, just so it will be less likely to happen again, it's as follows.
1. The naf github fork is of the entire, UP TO DATE, asterisk repo (which is too much code to fork and led to this bug, in my humble opinion, but let's save this thought for now).
2. naf's instructions on how to apply the patch kind of left out pointing out that the version of naf's asterisk fork's master is approximately asterisk 15.5.0. And naf's "gvsip" branch is code added onto that version of that master which means it's a patch to 15.5.0.
3. Again, naf said to apply the patch by either cloning his entire fork's "gvsip" branch and compile that, which is, again, gives you a variant of asterisk 15.5.0. Or, he says you can use his "wget compare master to gvsip branch and generate a patch" command, which gets all different files in the gvsip branch of the naf fork vs. the master branch of the naf fork.
4. When you use that "wget compare master to gvsip branch and generate a patch" command, the result code is substantially different and possibly will produce a different binary compiled output than intended!!!.
Have a look at this very important "patches" directory of PJSIP, this is what it's supposed to contain:
Code:
~/asterisk/third-party/pjproject/patches $ ls -la
total 116
drwxr-xr-x 2 root root 4096 Aug 4 12:34 .
drwxr-xr-x 3 root root 126 Aug 4 12:34 ..
-rw-r--r-- 1 root root 4726 Aug 4 12:34 0000-remove-third-party.patch
-rw-r--r-- 1 root root 1567 Aug 4 12:34 0000-set_apps_initial_log_level.patch
-rw-r--r-- 1 root root 1398 Aug 4 12:34 0021-sip_parser-Fix-return-code-in-pjsip_find_msg-and-add.patch
-rw-r--r-- 1 root root 781 Aug 4 12:34 0030-sip_transport-Destroy-transports-not-in-hash.patch
-rw-r--r-- 1 root root 633 Aug 4 12:34 0040-183_without_to_tag.patch
-rw-r--r-- 1 root root 2885 Aug 4 12:34 0050-dont_terminate_session_early.patch
-rw-r--r-- 1 root root 1887 Aug 4 12:34 0060-sip_msg-Prevent-crash-on-header-without-vptr.patch
-rw-r--r-- 1 root root 3652 Aug 4 12:34 0070-os_core_unix-Set-mutex-NULL-in-atomic-destroy-and-ad.patch
-rw-r--r-- 1 root root 18864 Aug 4 12:34 0080-timer-Clean-up-usage-of-timer-heap.patch
-rw-r--r-- 1 root root 1036 Aug 4 12:34 0090-sip_transaction-In-tsx_timer_callback-check-if-tsx-i.patch
-rw-r--r-- 1 root root 8345 Aug 4 12:34 0100-sip_inv-Add-option-to-accept-updated-SDP-on-same-To-.patch
-rw-r--r-- 1 root root 6779 Aug 4 12:34 0110_fix_tdata_rexmit_deadlock.patch
-rw-r--r-- 1 root root 5211 Aug 4 12:34 0120-oauth.patch
-rw-r--r-- 1 root root 3181 Aug 4 12:34 0130-contact-params.patch
-rw-r--r-- 1 root root 1752 Aug 4 12:34 asterisk_malloc_debug.c
-rw-r--r-- 1 root root 3059 Aug 4 12:34 asterisk_malloc_debug.h
-rw-r--r-- 1 root root 2684 Aug 4 12:34 config_site.h
-rw-r--r-- 1 root root 318 Aug 4 12:34 README
-rw-r--r-- 1 root root 251 Aug 4 12:34 user.mak
Here's what "patches" dir looks like after running naf's "wget patch" command on asterisk 13.22.0 tarball:
Code:
/usr/src/asterisk-13.22.0/third-party/pjproject/patches $ ls -la
total 116
drwxrwxr-x 2 1015 users 4096 Aug 3 18:29 .
drwxrwxr-x 4 1015 users 4096 Aug 3 18:42 ..
-rw-rw-r-- 1 1015 users 4726 Aug 3 18:29 0000-remove-third-party.patch
-rw-rw-r-- 1 1015 users 1567 Aug 3 18:29 0000-set_apps_initial_log_level.patch
-rw-rw-r-- 1 1015 users 1398 Aug 3 18:29 0021-sip_parser-Fix-return-code-in-pjsip_find_msg-and-add.patch
-rw-rw-r-- 1 1015 users 781 Aug 3 18:29 0030-sip_transport-Destroy-transports-not-in-hash.patch
-rw-rw-r-- 1 1015 users 633 Aug 3 18:29 0040-183_without_to_tag.patch
-rw-rw-r-- 1 1015 users 2885 Aug 3 18:29 0050-dont_terminate_session_early.patch
-rw-rw-r-- 1 1015 users 1524 Aug 3 18:29 0060-sip_msg-Prevent-crash-on-header-without-vptr.patch
-rw-rw-r-- 1 1015 users 3652 Aug 3 18:29 0070-os_core_unix-Set-mutex-NULL-in-atomic-destroy-and-ad.patch
-rw-rw-r-- 1 1015 users 18864 Aug 3 18:29 0080-timer-Clean-up-usage-of-timer-heap.patch
-rw-rw-r-- 1 1015 users 1036 Aug 3 18:29 0090-sip_transaction-In-tsx_timer_callback-check-if-tsx-i.patch
-rw-r--r-- 1 root root 5211 Aug 3 18:29 0100-oauth.patch
-rw-rw-r-- 1 1015 users 8345 Aug 3 18:29 0100-sip_inv-Add-option-to-accept-updated-SDP-on-same-To-.patch
-rw-r--r-- 1 root root 1107 Aug 3 18:29 0110-pjsip_dest_info.patch
-rw-r--r-- 1 root root 3181 Aug 3 18:29 0130-contact-params.patch
-rw-rw-r-- 1 1015 users 1717 Aug 3 18:29 asterisk_malloc_debug.c
-rw-rw-r-- 1 1015 users 2519 Aug 3 18:29 asterisk_malloc_debug.h
-rw-rw-r-- 1 1015 users 2380 Aug 3 18:29 config_site.h
-rw-rw-r-- 1 1015 users 318 Aug 3 18:29 README
-rw-rw-r-- 1 1015 users 251 Aug 3 18:29 user.mak
You see right!
1. One important crash fix patch (fix tdata rexmit deadlock) ends up missing!
2. Two patches incorrectly got the same sequence number "0100" which causes an unintended side effect - one of these two patches may not be applied!! It depends on what the patcher script does! The patcher script docs says it does NOT allow two patches having the same sequence number!
3. And the "oauth" patch is out of sequence, which also could cause an unintended side effect, if it's overlapping another patch, in which case, order does matter, and will make different code and a totally different asterisk binary!!
Back to my first comment, naf forking the entire asterisk repo, was probably too much to fork, because the diffs it makes really only work cleanly with current master 15.5.0 which most users aren't yet using, at least, most IPBX users aren't using yet. His contribution could probably be contained within one "patch" file, saved to pjsip's "patch" dir, plus one patch for asterisk consisting of the "C header" file for asterisk, plus the modified "README.md", plus "res_pjsip" modded files, which is the asterisk module which talks to the "pjsip" third party library. This way would probably make this gvsip naf feature MUCH easier to maintain and smoothly apply without error or missing code, to any version of asterisk 13 - 16. Ultimately, though, this GVSIP is just an update to PJSIP ("pjproject"), to add a few new RFC's required by GV for decent SIP security and crypto. The stuff on the asterisk side (res_pjsip) is actually a separate thing, it's the client to pjproject (PJSIP), and probably can/should be its own separate patch, and made to apply cleanly to all versions of asterisk 13-16.