问题
I'm trying to make a conference and play a sound file in the background of the conference. How can I make this possible?
this obviously wouldn't work because the sound file will be played before entering the conference.
exten => s,1,playback(some/soundfile)
same => n,confbridge(1)
Thanks in advance!
回答1:
Wanted to add my solution here in case anyone ever needs it.
first make a context for the conf bridge in extensions.conf:
[conf-msg]
exten => s,1,ConfBridge(01)
where 01 is the bridge number
Then via the command line you can do:
asterisk -x 'channel originate local/s@conf-msg application Playback file'
Its really as simple as that.
回答2:
You have create new call,simple method using call files.
http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out
After that you have place one of call legs to your conference like this
Channel: Local/1111@conference
Application: Playback
Data: some/soundfile
Where conference is context to get to ur conference room. No need do spy or somethign like that,that is wast of time/cpu
回答3:
See here for a similar question: Asterisk- How to 'whisper' music using ChanSpy(), or any alternative?
Basically, you want to add a participant that points to a local channel (as above, only enter the channel instead of spying), play your sounds, then hangup.
回答4:
Same answers, but for many confBridge:
In extension.conf
:
[autobridge]
exten => _X.,1,ConfBridge(${EXTEN})
Then, like tgwaste's answer, you could initiate message into conference room 1234, by using
originate
:originate local/1234@autobridge application Playback en_US/tt-monkeys
from console or a manager connection,
Or as arheops's answer suggest, by adding a file in
outgoing spool dir
:printf "Channel: Local/%d@autobridge\nApplication: %s\nData: %s\n" \ 1234 Playback sound/file >/var/spool/asterisk/outgoing/f-$RANDOM
from anything at filesystem level ( with correct permissions, could be shared! :-).
来源:https://stackoverflow.com/questions/10359445/asterisk-playback-sound-file-into-confbridge