FreePBX Chef - Automate PJSIP Trunk Creation

The preferred method for doing this would be to use the REST or GraphQL APIs. I haven’t used the REST API a lot, but I did do a blog post about GraphQL at GraphQL support in FreePBX 15 | FreePBX - Let Freedom Ring a couple of months ago. The GraphQL support is still in technology preview and has some bugs, but it should be more usable and stable over the long run that trying to do the automation with PHP code. Please give it a try and see if it works for you!