How to set up Asterisk to play audio files to sound card?

Hi,

as Asterisk playing welcome message, MusicOnHold audio files via SIP client
acts as media server,
tell me how to set up Asterisk to play audio files to sound card directly, not using SIP client to listen to
audio track .

I have stand-alone basic Asterisk installation and just want to listen to audio files played by Asterisk via sound card
(no SIP, no Ethernet, Internet),
to let me test dial plans when I lie on my bed with closed eyes, to see what’s wrong when ppl close a call answered by Asterisk’s run IVR.

As there is a number of SIP client softphone apps, some Flash-based,
I just need Asterisk to play audio directly to a sound card, like any other media streaming server.

As SIP client like Flashphoner connects to Asterisk via 5060 port

flashphoner.com/flashphoner_client.swf?v=67

does it mean I need to write media player app using 5060 port for Astersk media server playing MOH files as audio stream ?

Darius

Darius

I think you need chan_oss.so (oss.conf)

This really needs to be interpreted in the contexts of his many other threads.

The soundcard driver support in Asterisk is really for demonstration use, rather than for serious use. It may well have the same problems as the Celliax driver.

If the question is as general as it seems, I’d use system to run an audio play utility, such as the one that comes with the sox package.

CLI > load chan_oss.so

Unable to load module chan_oss.so

Default chan_oss.so module comin g with Asterisk

==
;
; Open Sound System Console Driver Configuration File
;
[general]
;
; Automatically answer incoming calls on the console? Choose yes if
; for example you want to use this as an intercom.
;
autoanswer=yes
;
; Default context (is overridden with @context syntax)
;
context=local
;
; Set overridecontext to yes if you want the context specified above
; to override what someone places on the command line.
;
;overridecontext=yes
;
; Default extension to call
;
extension=s
;
; Default language
;
;language=en
;
; Silence supression can be enabled when sound is over a certain threshold.
; The value for the threshold should probably be between 500 and 2000 or so,
; but your mileage may vary. Use the echo test to evaluate the best setting.
;silencesuppression = yes
;silencethreshold = 1000
;
; On half-duplex cards, the driver attempts to switch back and forth between
; read and write modes. Unfortunately, this fails sometimes on older hardware.
; To prevent the driver from switching (ie. only play files on your speakers),
; then set the playbackonly option to yes. Default is no. Note this option has
; no effect on full-duplex cards.
playbackonly=no
; playbackonly=yes

I doubt that chan_oss has been ported to Windows, as OSS is a Linux specific thing. Also, you will be getting answers based on version 1.4 or 1.6, not 1.2.

I don’t know if the Windows port of sox can play files.

Using a supported version on CentOS really makes life a lot easier.

[quote=“david55”]This really needs to be interpreted in the contexts of his many other threads.

The soundcard driver support in Asterisk is really for demonstration use, rather than for serious use. It may well have the same problems as the Celliax driver.

If the question is as general as it seems, I’d use system to run an audio play utility, such as the one that comes with the sox package.[/quote]

Thanks David,

Sox comes as really powerful audio utility

from
sox.sourceforge.net/

SoX is a cross-platform (Windows, Linux, MacOS X, etc.) command line utility that can convert various formats of computer audio files in to other formats. It can also apply various effects to these sound files, and, as an added bonus, SoX can play and record audio files on most platforms.

exten => #,1,Playback(demo-thanks) ; “Thanks for trying the demo”

exten => s,n(instruct),MusicOnHold()

Does it mean Playback and MusicOnHold , BackGround commands
cannot be redirected to play audio via sound card directly ?

voip-info.org/wiki/view/Aste … d+Playback


If neither skip nor noanswer options are specified, then the Playback command will first answer the channel (if it hasn’t been answered already) and then play the sound file.

[quote]Does it mean Playback and MusicOnHold , BackGround commands
cannot be redirected to play audio via sound card directly ?[/quote]

No. Why would you think they could?

You didn’t ask how to make Playback and MusicOnHold play on a sound card; you asked how to make file files play on it, even though I couldn’t work out why you would want to do that.

[quote=“david55”]I doubt that chan_oss has been ported to Windows, as OSS is a Linux specific thing. Also, you will be getting answers based on version 1.4 or 1.6, not 1.2.

I don’t know if the Windows port of sox can play files.

Using a supported version on CentOS really makes life a lot easier.[/quote]

Thanks David,

you are right, Asterisk is Linux specific and what I use is Asterisk for Linux run under Cygwin.

Playing sound files via sound card looks to be something special and complicated in Asterisk.
I really don’t know why.

But I am sure, there is a nice solution to the problem and testing of Asterisk dialplans on stand-alone machine
and I hope to make it true soon.

[quote]Playing sound files via sound card looks to be something special and complicated in Asterisk.
I really don’t know why.[/quote]

Because the Asterisk machine would normally be hidden in a machine room where no-one would hear them. A normal PABX wouldn’t have that capability.

[quote=“david55”][quote]Playing sound files via sound card looks to be something special and complicated in Asterisk.
I really don’t know why.[/quote]

Because the Asterisk machine would normally be hidden in a machine room where no-one would hear them. A normal PABX wouldn’t have that capability.[/quote]

Ok David.

There is development phase of a new call center, PBX or alike system
and deployment phase.

In development phase audio files are recorded, tested, played back.
In development phase flow-charted dial plans are designed, tested for bugs, sound quality and more.

Is testing of Astersk dial plans and general PABX functionality, by making direct calls from a mobile phone to Asterisk server
something really special or fantastic today ?

To me, it’s first step in testing PABX functionality in 2-way interactive communication.

Mayby my needs are special, but I need to test Mobile Asterisk only.

I do hope we can find a nice solution.