Asterisk 1.8 dial multiple number at the same time for outdound conference - asterisk

i want to connect to 5 numbers at a time to put them in conference call.
i was trying with this dialplan
exten => 123,1,Dial(Dahdi/g0/no_1&Dahdi/g0/no_2&Dahdi/g0/no_3)
with this code who ever answer the call first it will be connected and remaining will get disconnect.
regards
Vikas

That dialplan have be working if you group0 setuped correctly and have enough free channels
You also can use dial Local/123#context/n - call via dialplan

Related

Asterisk ARI - Pass channel to Stasis before Ringing

My goal
Pass an incoming call directly to Stasis and allow the app to decide whether to play a ringing or busy tone to the caller.
The problem
With my ARI app, if I omit the same => n,Ringing line from my dialplan, the Stasis app returns an error if the caller hangs up. I can have a call hang without any early media, until I pass a channel.play() command, via the ARI.
This solution has 2 issues:
The Stasis app receives a second StasisStart when the caller hangs up, returning a Channel not found error.
There is no command for channel.busy
Does anyone have any suggestions?
My only option that I can currently see is to ensure that all users have voicemail and a busy tone is never played. Not everyone wants / likes voicemail and it is not ethical to answer the call and play a busy tone, without the caller knowing that their call is connected.
Update
Using the following dialplan, I can get this to work in the desired way (plays busy to a user if they're not available), but with an error:
extensions.conf
[public]
exten => _.,1,NoOp()
same => n,Stasis(myStasisApp, ${SIP_HEADER(to)})
same => n,Busy(10)
same => n,Hangup()
myApp.js
// The user is available
channel.ring();
// The user is busy
channel.continueInDialplan();
Error
Another StasisStart is sent when the caller hangs up, followed by:
Unhandled rejection Error: {
"message": "Channel not found"
}
We faced the same problem and lost precious time finding out the reason so I'm sharing the solution here and maybe it will help.
extensions.conf
[public]
exten => _.,1,NoOp()
same => n,Stasis(myStasisApp)
same => n,Hangup()
When Asterisk receive a call, it will start the stasis app.
Create a Bridge.
Add the incomming channel A in this bridge.
Create a new outgoing channel B from your ari app with POST /channels/create.
Add the outgoing channel B in that bridge.
Dial from channel B the destination, where both of the channels
are in the same bridge with POST /channels/{channelId}/dial
Now, you will be able to see a new ARI Dial events with Ringing and Answer.
For the Hangup, you will receive Channels end events with Hangup Cause Code not a text like 17 for busy
Asterisk Hangup Cause Mappings
It's simpler to originate a channel (Asterisk version 13) instead of create and dial (Asterisk version 14) but you will not have the early media or a full control on that channel because it's created by Asterisk and not the ARI app so this channel will start sending event back to ARI when the call start and not before.
Asterisk 14 ARI: Create, Bridge, Dial.
ARI and Channels: Manipulating Channel State
This thread helped us a lot:
Re: ARI: add channel to bridge immediatelly after originate action
.
.
.
Have fun ! and Hope this will help.
/ohammami

Asterisk ringback tone recording

I made an outbound-call service application using Asterisk AMI interface.
Following is how my application works.
I generate an Originate request to internal channel using TCP/IP socket.
my dialplan accepts the request and run dial command. extension.conf file is
[from-internal]
exten => _X.,1,NoOP()
same => n,MixMonitor(${DialMonitorFile}.wav)
same => n,Dial(PJSIP/${EXTEN}#TRUNK_100-1234-5678,30)
What I want to do is record whole call process (from ringback tone sound until user hangup).
But, when dial started, only 44 byte size file is generated (maybe wav file header?) before user accepts the call. And, file increased after user accepts call.
Can someone help me how can I record ringback tone sound as well ?
Regards,
Brian
You should do Answer before MixMonitor if you want that
Please note, CDRs will be affected

Asterisk / SIP - Delaying the 200 OK till after calling card is entered

Im trying to figure out a clever way to delay the 200 ok for the sip handshake till after the "please enter your calling card code" that my voip system will be transmitting to the incoming call..
Any thoughts on this.. I must admit, I';m looking at this conceptually at this point and am a bit naive...
Thanks in advance!
You won't be able to at least if you're planning on supporting standard SIP devices.
You can send early media to a device, such as your "please enter.." audio, with a 183 Session Progress Response but I can't see that being much use as the SIP calling device won't send any DTMF tones to the server until the call has been answered which requires the 200 Ok response.
Despite that I suspect you may be looking at the wrong thing. The 200 Ok from Asterisk is for the call between the caller and the Asterisk server to get the DTMF tones and determine whether the next call leg is authorised. Only after the calling card code is accepted does the next call leg start. It sounds like your problem is that users are noticing that the billable call time includes the time they spend entering their calling card PIN. Fiddling with the 200 Ok response is not the way to fix that. Trying to get Asterisk to generate a new CDR for the second call leg would be a better approach.
For called party:
[main_content]
exten => _X.,1,Dial(SIP/${NUM}#provider,,M(dialout-macro))
[macro-dialout-macro]
exten => s,1,Noop(here you should add detect of "please enter")
exten => s,n,Noop(some other commands go)
exten => s,n,MacroExit;we are ready to connect call.
For calling party - you need ALL your provider support early media and dtmf before answer. It is posible get provider which support early media, yes. But i not know any system which support dtmf before answer,sorry.
Dialplan will be like this
exten => _x.,1,Read(variable,filename,10,n,3)
note: no answer should be BEFORE that command, should be used option n
n: to read digits even if the line is not up.
However as i say that will work only in theory.

Asterisk call transfer on DAHDI channells

All channels on Asterisk configured as DAHDI channels.After customer make payment I want to transfer the customer to the representative who interact customer before.
I try to make it by Dial() command. This is the dialplan
exten => s,1,Set(TRFNUM=${CALLERID(num)})
exten => s,2,Set(TRFNAME=${CALLERID(name)})
exten => s,3,AGI(agi://192.168.7.20/customivr)
exten => s,4,Dial(DAHDI/1/${TRFNUM}&DAHDI/2/${TRFNUM}&DAHDI/3/${TRFNUM}&DAHDI/4/${TRFNUM}&DAHDI/5/${TRFNUM}&DAHDI/6/${TRFNUM}&DAHDI/7/${TRFNUM}&DAHDI/8/${TRFNUM},30)
exten => s,5,Hangup
For example: Call comes to DAHDI/1 after the payment DAHDI/1 dial all channels one them Answer the others Hangup. DAHDI/1 bridge call by with DAHDI/2. However, although Customer and representative close phones, Channels do not Hangup. They stay Busy.
Where do i make mistake. I should hangup call channels or find another way to transfer.
It seems to be configured correctly,
I think your AGI script hangup the call when he finishes his work,
It can happen if you have $agi>hangup in the end,
or if you make any outputs in the scripts (echo, print_r, etc...),
even empty spaces output can cause this behavior,
another thing you can try is make the Dial command from the agi itself using:
agi->exec("Dial","options");

How can I ring a dial group and land everybody that answers into a conference room?

I'm using FreePBX from a Trixbox install to manage an Asterisk server. I added a dial group with ringall strategy, but as soon as one person answers, the other extensions in the group are dropped. I'd like to keep ringing these extensions so that everybody that picks up the call lands in a conference with the caller.
It would be acceptable to join the conference first, then dial the group.
Create callfiles for each party you wish to add to the conference. Callfiles are text files that are placed in /var/spool/asterisk/outgoing and cause Asterisk to originate a call based on the contents of the callfile. Make sure that the callfile is r/w by the same user that runs Asterisk. Set the mod date in the future to schedule the outbound call.
The format of the callfile should look something like this:
Channel: Local/8085551212#from-internal
MaxRetries: 2
RetryTime: 60
WaitTime: 30
Context: ext-meetme
Extension: 202
Priority: 1
...where 8085551212 is the party to call and 202 is the conference room extension. When answered, each call will be placed into the conference. Keep in mind that the call might be answered by an IVR or voicemail, so you might want to require a PIN for the conference or drop the incoming calls to an IVR that will then connect to the conference if the intended party is reached. It could be as simple as, "It's time for the sales conference. Dial # now to join."

Resources