I am trying to consume a REST API from within Asterisk 16 dial plan. The CURL call works fine and I get back a JSON array of the data. However, I am trying to extract the value from specific element in the array (_Client) field value and another value , I cannot get it to work. Below is the code I am using and a sample of the CURL_RESULT:
When dealing with data extraction from a json response * php json_encode* () function is one of the best tool, you set the values in an array and then you set the array value to a channel variable assuming you don’t one to use a class like phpagi you can do all this with pure php and Asterisk shell function, python is good option too
Json, redis, native sql … all still missing in Asterisk traditional dialplan, it is really a huge problem that suddenly disappears when you move to pbx_lua, aad as a bonus you get all the features of a programming language and with it your sanity.