[asterisk-users] AGI problem using mono (.Net)

Steve Edwards asterisk.org at sedwards.com
Thu Feb 26 13:50:28 CST 2009


On Thu, 26 Feb 2009, Douglas Mortensen wrote:

> New problem:
> ==============
> Although we see the following in our logs / asterisk console: [Feb 26 
> 11:11:05] VERBOSE[9824] logger.c:  -- Playing 'filename' 
> (escape_digits=) (sample_offset 0)
>
> All that the caller hears is a very brief click. And then the dial plan 
> continues. This is causing me to wonder whether asterisk halts playback 
> of the file, if the AGI script that send the STREAM FILE command 
> completes/returns.

If your AGI is exiting before the sound file has finished and without 
reading the "result" from STDIN, you have violated the protocol.

> Talking to my developer, I asked him to create a loop after sending the 
> STREAM FILE command and read from stdin until he gets a string that 
> starts with 200.

All it takes is a single "line oriented" read. This is pretty "elemental" 
to the protocol -- issue a request, read the result. Most (all?) AGI 
libraries "wrap" these two steps into a single function call so the 
library user never has the opportunity to do anything in between.

> I'm supposing that asterisk would send this AFTER the audio file has 
> successfully played out. But again, this is only a guess.

It makes sense that Asterisk sends the "result" when the request is 
finished, successful or not.

A few more suggestions:

) Try to STREAM FILE demo-congrats.

) Verify that your sound file is playable (in the correct format for the 
codecs you have loaded) by using playback() in the dialplan.

Apologies if it is too basic (but still I forget sometimes...) that the 
file name is specified without the file type and is relative to Asterisk's 
sound directory (usually /var/lib/asterisk/sounds/) if the file name does 
not start with a slash.

The error message you showed above looks like STREAM FILE is finding the 
file. I'm guessing that you are still violating the protocol or that the 
file is not in an acceptable format for the codecs you have loaded.

It appears that you did not use an existing AGI library. Why not?

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards      sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                             Fax: +1-760-731-3000



More information about the asterisk-users mailing list