Edit:
Official author of the above script is Lefteris Zafiris
hope this will help
Note: I can’t upload .agi file that’s why I changed the extension of a file to .txt.
Edit
Sorry for my half explanation and do not provide Name of the author.
As it says, Asterisk doesn’t have a format called sln.
I thought you wanted real time speech to text, but you seem to be recording the audio.
As a general point, you are using language features that write to standard error, but you don’t seem to have redirected standard error to a file, so finding the output of those may be difficult.
It’s interesting that you don’t use a class library for AGI. Whilst I have reservations about them, as they seem to add little value and obscure what is really happening, most people seem to use them.
I don’t understand that, as I thought that that function was implemented in the Asterisk core. Maybe it is treating it as a request for a global variable, because you haen’t provided a channel name. Unfortunately the wiki, for GET FULL VARIABLE, appears to be wrong in multiple ways, but I don’t have time to look at the code to find out exactly how it does work.
@Yash3120 Are you selectively loading modules? If so, then you are using functionality from modules you haven’t loaded (such as func_channel and format_sln).
An AGI library does obscure the foundations of the protocol:
Asterisk ‘owns’ STDIN/STDOUT and anything you do to those streams is not going to end well.
The protocol is ‘single line oriented, request and response’ meaning you issue a single line request, and you get a single line response (IIRC).
You have to read the ‘AGI environment’ Asterisk gives you before you can do anything – even if you don’t need anything from it.
But using a library makes the feature available to a class of programmers who don’t wake up in the morning excited that they can start the day with a deep dive into the Asterisk source code.
I fall somewhere inbetween
I know the protocol pretty well (at least I used to ) and I use a library because it improves the quality of my code and reduces the quantity of code I have to write.