Sending a sound from AsterNET

Aug 28, 2013 at 8:46 AM
Hi!! I expose my situation. I need to play some sounds in Asterisk, depending of some variables (they doesn't matter) But I can't create a .mp3 for each sound (they're too many) So I'm generating the sound in .NET and configured a simple extensions.conf file so you can see how it should look like ;)
[demo]
exten=>100,1,Answer()
exten=>100,n,Playback(${MYSOUND})
exten=>100,n,Hangup()
So, I have a sounc created by code (it will be deleted when the app ends) and a variable in my Asterisk which are waiting a sound route. But how I send my sound file to Asterisk?

for the record, I'm using the Manager. If you need more information just ask for it!!!

Thank you very much.
Aug 28, 2013 at 10:30 AM
It's a very common problem, however there is no simple answer.

Firstly, FastAGI doesn't support the ability to send Audio files from the FastAGI server to Asterisk. That's the main problem, and everything else is going to be a work around.
  1. The most common way around this issue is to use a share of some sort (shared storage) that both Asterisk and the server running AsterNET can both read/write from/to. That means you can write your audio file to the shared storage, then ask Asterisk to play that file.
  2. Use something like SharpSSH to transfer the file from your local AsterNET machine, to the asterisk box before asking Asterisk to play the file.
  3. Investigate patches for FastAGI like http://agi-audiotx.sourceforge.net/. This isn't supported by AsterNET, although if you did go down this route, we would accept any patches you made to integrate the solution.
  4. This is more complex, however i see this being a solution more people could benefit from long term, if you were able to implement it, is a FastAGI proxy (like nodast.js) that adds additional commands to FastAGI and supports file copy. This has the benefit of not touching the Asterisk source code, but adding additional functionality that you would control.
So, I know that wont be the answer you wanted, but they are the most common ways around this problem that I know of.
Aug 28, 2013 at 12:49 PM
But, if I don't wanna send a file? I mean, if I have an WaveStream I can't send it to Asterisk and playing it from there isn't it? I must use a file?
Aug 28, 2013 at 3:16 PM
No, sorry but you can't stream a file from AsterNET to Asterisk! FastAGI doesn't allow for this. I wish it did, it was would be very handy for many people.