There was a recent long thread at What is the best way to handle a custom-built Asterisk on FreePBX 17? going into this some but the patch itself is no compatible at all with chan_pjsip.
There was a recent long thread at What is the best way to handle a custom-built Asterisk on FreePBX 17? going into this some but the patch itself is no compatible at all with chan_pjsip.