We need to add a full path to where the contents of pjsip.conf will be stored. In some systems, this will be /etc/asterisk/pjsip.conf, but in others, it could be something like /etc/asterisk/sip.d/foo-config.conf.
This way, generate and append functions will work directly with the installed conf file.