Asterisk ARI initiating a call - asterisk

I am trying to initiate a call between two local endpoints, a softphone(PJSIP/100) and a harphone(PJSIP/102). Using ARI I have created two channels, with app parameters and put them both into the same mixing bridge in stasisStart event.
At this moment, both of the channels are in the same bridge, but their state is "Down". If I now dial both of them separately from ARI and then press answer on both endpoints, they can share audio, but is it possible to avoid dialing and answering both of them? I have played around the "originator" and "callerid" parameters, which is passed when creating channels, but that does not help.
Is it possible to "dial" one of them from another via ARI?

It’s not 100% clear what you’re trying to do here, but from what I understand...
Dial PJSIP/100 and put it into bridge_1 in statisStart
Dial PJSIP/102 and put it into bridge_1 in stasisStart
You could dial them using stasis originate or an originate via the dialplan.

Related

Unable to set callerID using ARI

I have a java stasis application on Asterisk 14 using ari4java. It mostly works great. I am now trying to receive an external call and relay it back out. I do following
Incoming call enters Stasis
Create bridge
Add first call(channel) to bridge
Create channel
Add second channel to bridge
Dial( secondChID, "Local/2601", 30)
No matter what I try, the second outbound call gets the callerID of the first inbound call. That is actually OK for many calls, but in this case I want to set another callerId.
Before Dial() I have tried to setChannelVar(CALLERID(num)) and this value I can see in all events coming from Asterisk. But once the SIP call is placed, no sign of my callerID.
I doubt it is the ari4java doing anything wrong as I see the callerID in all the "dial" events. I thought I could force a callerID in sip.conf, but unable to do that too.

Asterisk ARI early media detection

I'm playing with asterisk ARI and I have few problems that I'm unable to solve.
Originating a call from ARI does not register any events until channel is UP. Is it possible to force it to enter Stasis before channel is in UP state?
I'm trying to detect if there is voice in early media (operator messages on GSM gateway calls). Can it be done?
It is very much possible with Asterisk 14 version.
https://wiki.asterisk.org/wiki/display/AST/Asterisk+14+Channels+REST+API#Asterisk14ChannelsRESTAPI-create
This will create a new channel and place into Stasis immediately.
You will be able to do any operation over the newly created channel.
You can originate the call into a Local channel, then perform your dial from the local channel.
Early media is carried via SIP 183, which means, that Asterisk isn't really aware of it. Well, it is aware at the channel level, saying: "Please open media ports", however, there is not ARI event that says that.
Gotta admit, it does sound like a cool feature for ARI.

Asterisk DID switch to out outgoing trunk?

I have a toll free DID that users call to access my PBX service on an Asterisk box. The problem is; this DID comes only with a single channel so the system can only receive one call at a time. My initial idea was to simply get the caller ID of the incoming call, disconnect the caller and issue an automated call back to him to proceed with the call. This would free up my toll free number but could be confusing for the caller of course and also, there are issues where the caller calls from behind an extension. The best solution would be to somehow seemlessly switch the call to an outgoing trunk to reconnect the caller but now using my SIP trunk.
My question is; is there a way to do this in Asterisk (or I guess, does SIP somehow allow such operation)?
Thanks in advance.
That is called "callback".
Yes, you can do it. No, asterisk have no internal way do that and no way do it not noticable for user.

Asterisk HOLD functionality workaround

I'm using asterisk with webrtc in chrome (SIPml5 client) and also using their webrtc2sip gateway.
My problem is that I can't send the hook-flash/flash signal to asterisk for some reason.
Is there a possibility to trigger hook flash by sending DTMF signals ? (which apparently work for me )
Example: I want to trigger the standard hold functionality by sending the following DTMF sequence: #123.
On the other hand as a workaround, could I hold a channel using AMI or AGI ?
Basically I want the other party to hear OnHoldMusic while the channels/call remain active. On the local side I can just mute the audio tag which is fine.
Thanks.
Yes, you can do hold using ami command hold or AGI exec command musiconhold
That info is availible in AMI/AGI documentation
You can handle dtmf by using features.conf

Asterisk: Outbound and Inbound call at the same time

I am looking this use case scenario for Asterisk. I am using v 1.8 running a Centos 6.4 Linux distribution.
1.An outbound call is initiated via Asterisk
2.Both the internal extension as well as the outbound call-phone starts to ring.
The first person to pick up (either the internal extension or outbound call-phone) will
hear the a pre recorded message to hold as the call is being connected to the other user
i.e: If outbound call-phone picks up first then he will be asked to hold the line while the call is being connected to internal-phone user.
Any inputs?
My suggestion is almost the same but a little different:
Setup a dynamic meetme room changing the only-person message to "please hold..."
Setup booth calls at same time to destination numbers and set the originate command application parameter as meetme
Create 2 calls
http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out
After connect use bridge command or conference room.
http://www.voip-info.org/wiki/view/Asterisk+cmd+MeetMe

Resources