Asterisk playback sound file into ConfBridge? - asterisk

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!

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.

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

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.

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! :-).

Related

Asterisk - Make a call inside a conference with ringtone

I'm trying to make a call inside a running conference and hear the ringtone.
*Note: the conference is already running I have only the admin inside.
I already tried different approaches to make the call without success
1) Originate:
channel originate SIP/000000000#provider application ConfBridge ConferenceName
This works, makes the call and when its answered it joins the conference, but no ringtone
2) ConfBridge Menu, dialplan_exec
[default_menu]
type=menu
1=dialplan_exec(addcaller,000000000,1)
[addcaller]
exten => _XXXXXXXXXX,1,Originate(SIP/${EXTEN}#provider,app,ConfBridge,ConferenceName)
This works, makes the call I have ringtone, but when answer, no audio inside conference
3) Options 2 + a macro to join call after answer
same => n,Dial(SIP/${EXTEN}#provider,,M(joinconf))
[macro-joinconf]
exten => s,1,NoOp()
same => n,ConfBridge(ConferenceName)
same => n,Hangup()
This works, I can hear the ringtone and then I can see the user inside the conference but again, no audio!
4) All versions with variants
I have tryied all sort of variants using
same => n,Answer()
same => n,Progress()
same => n,Wait(1)
cause maybe was the channel not answered, but I'm stuck.
the final goal is a simple
conference with the power of calling and hanging other phones.
No matter if I need to use:
AMI with multiple commands
channelredirect
chanspy
meetme
AGI
whatever just need to make it work
Do originate into Local channel, in dialplan use Ringing(r param in dial command) or moh with ringing sound

Not able to connect incoming caller to th dialed calee in meetme function in asterisk

My code is simple A calls to B the they both entered into meetme conference
[from-pstn]
exten=> _X.,n,Answer()
same => n,dial(DAHDI/g0/0${9xxxxxxxxx},20,mM(MYCONFO))
[macro-MYCONFO]
exten => s,n,Meetme(1234,sdrM)
But when A calls to B only B enters the conference and A is not able to enter conference , A only hears musiconhold
yes i have read meetme and n way dialout
Can anybody help me with that
I think for this you should use option G from DIAL command:
http://www.voip-info.org/wiki/view/Asterisk+cmd+Dial
G(context^exten^pri): If the call is answered, transfer both parties to the specified context and extension. The calling party is transferred to priority x, and the called party to priority x+1. This allows the dialplan to distinguish between the calling and called legs of the call (new in v1.2). You cannot use any options that would affect the post-answer state if this option is used.
So dialplan should be:
[from-pstn]
exten=> _X.,n,Answer()
same => n,dial(DAHDI/g0/0${9xxxxxxxxx},20,mG(MYCONFO,s,1))
[MYCONFO]
exten => s,1,Meetme(1234,sdrM)
exten => s,2,Meetme(1234,sdr)
You code is incorrect.
Please read again documentation about in-call-macro. It have alot of limits
Try use goto.
If not work, try use transfer from external application with UserEvent
ps. yes, it work as described in n-way-howto too.

how to disconnect the caller but still continue the process

I'm kinda new at asterisk and i have to do a process after hangup, i have a code that is something like this:
exten => 12345,1,wait(1)
same => n,agi(myagi.php)
same => n,hangup()
exten => h,1,noop("hangup")
same => n,System(sleep 1m)
same => n,agi(sendemail.php)
so, the call wont hangup when it goes to the h extension because of the sleep, but i need the delay before sending the email, how do i disconnect the caller but still continue the process in the h extension? or is there another way to do this?
Thank You
You'll need to change your setup to send the email asynchronously. Basically in your dialplan you will call a shell script that only executes the email script in the background and returns immediately. You'll add the delay into the email script using PHP's sleep() function. I've not done this before so don't have any sample code to offer, but this looks like a good place to start.
Best way is mark cdr,for example CDR(userfield)=EMAILTO:address.
After that check all cdrs every few seconds/minutes and do action you needed.
Please never use h-extension for task that can take more then 0.5 sec, that can cause issues.

Generating IVR on Asterisk without duration, get DTMF input from user and then process it

I hope cyber Asterisk gurus would be able to help me in this regard. I am trying to create an IVR filter using Asterisk. My desired configuration goal is:
1:When a user dial into the Asterisk, the user should hear IVR(but there should be no charging on initial IVR). I want to send the IVR in in initial 183 Session in progress without any duration starting on my phone.
2:Once a user input some digit via DTMF, then the call should be processed and charging etc should take place
I would really appreciate you guys input in this regard. Thanks
You can use power of local channel combine with NoCDR. In beginning of your IVR use NoCDR() function, and after DTMF check use Dial to local channel contex with rest of yout logic.
[ivr]
exten => 100,1,NoCDR()
exten => 100,n(read),Read(variable)
exten => 100,n,GotoIf($[ ${variable} = 1 ]?go_1:read)
exten => 100,n(go_1)Dial(Local/${exten}#dtmf_1_logic)
[dtmf_1_logic]
.....
In that case you should have one CDR from dtmf_1_logic context with call duration with you are looking for

Custom extension with Asterisk that "Answers" then "Beeps"

I'm trying to solve a very painful problem that impedes on my world utilizing my amazing powers as a programmer... (my front gate makes my friends call my cell phone, then I have to press "9" and it lets them in)...
So, my amazing powers have gotten me very far, except this last part I can't get (perhaps due to lack of sleep).
I've got every thing worked out so far: The call-box now dials my Google Voice account, which forwards it to my virtual machine on my laptop running the latest 'trixbox' (Asterisk), which will receives the call via Gizmo5/SIP junk.
What I need now is to have the phone call answered, and then "press" the number "9"... wait about 5 seconds, then hang-up.
I'm sure it's as easy as putting this code somewhere in a config file:
exten => 1234,1,Answer
exten => 1234,n,Press("the flippin 9 key")
exten => 1234,n,Wait(5)
exten => 1234,n,Hangup
But I don't know:
1) Is this possible (pretty sure it is)
2) What file do I edit?
3) Do I need to make an extension first?
4) Is that code in my example above anywhere close?
5) What do I actually need to do!
I greatly appreciate any help on this one.
You're close, try:
exten => 1234,1,Answer
exten => 1234,2,Wait(2) ; Safety time
exten => 1234,3,SendDTMF(9)
exten => 1234,4,Wait(5)
exten => 1234,5,Hangup
This tells Asterisk how to handle a call coming in for 1234
In a "standard" Asterisk installation, this goes in extensions.conf and 1234 should be whatever extension/number the incoming call is coming in on.
extensions.conf has different sections, which can vary based on distribution and local setup, but it's usually best to put this in the [default] section.

Resources