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
Related
I have an executive and incoming caller. I patched their call in Asterisk using the dial command, but how can I to receive the inputi.e DTMF from the caller?
You should look at features.conf. It contains examples for:
dynamic features
These dynamic features can be triggered by in-call DTMF.
I am building an application in Asterisk , which has to simulate the phone keypress action i.e DTMF. For instance , if a caller calls a number and the IVR requires to press a digit , the application (say a webpage) should also be able to simulate the same key press. I tried the following:
- I have a web application that triggers PlayDTMF action over AMI to simulate the key press on the caller channel. Unfortunately this didn't work , as it played the DTMF digit on the channel (the keypress could be heard) but asterisk didn't receive the DTMF. It was just playing the DTMF, which is what the AMI action was designed for. I technically need to "send" the DTMF digit on the channel.
- the sendDTMF function in asterisk couldn't be used either,as it is a dialplan function and I need a AMI action to trigger DTMF from an external source.
A similar issue was reported sometime back: Asterisk AMI: DTMF not received on SIP channel
I am using Asterisk 11. Is there a way to implement the above using AMI/AGI? Or do i need to further upgrade my Asterisk to 12 to make use of ARI?
Appreciate your inputs.
I managed to simulate the DTMF action , by Dialing/Originating out to a local context and using the outgoing bridging channel id for DTMF input. So the flow is :
call lands on Asterisk -> Asterisk Dials out to a Local context -> The dialout creates a bridging event which has the outgoing channel id(store in some DB) -> The local context can have the IVR flow and using the stored channel and PLayDTMF action - dtmf digits can be inserted. Not sure if there is a more elegant solution to this!
There are Channel ARI Demo in wich we can control channel state: ring, answer, play silence, play some tone or audio-file (https://github.com/asterisk/ari-examples/tree/master/channel-state, https://wiki.asterisk.org/wiki/display/AST/ARI+and+Channels%3A+Manipulating+Channel+State)
Is it possible to receive some chunks (parts, buffers, etc.) of call voice (which are created by remote subscriber) or write chunks of voice, for example like a some array of bytes (not from file) in some audio format (alaw, ulow etc).
You can use asterisk EAGI interface to get voice data.
Other option is use Record or Mixmonitor app for record channel(channel have be put to Stasis to allow dialplan control by ARI)
"Write chunks of voice" can be done by application Playback
Also you can create your own application using c/c++, compile it into asterisk and get result you want.
No, you can't redirect voice directly using ARI.
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.
I'm trying to figure out a way to reliably detect if a channel is held via AMI. I have two issues:
On Asterisk 1.8 I get the MusicOnHold event when a channel is held. Is this a reliable event? Can Asterisk be configured in a way that this event won't be sent?
Earlier versions of Asterisk (1.6.0) don't send an event for MusicOnHold. In fact, all I get is an ExtensionStatus event when I put a call on hold. Is there another event I could enable or command I could send to figure out if a channel is on hold?
I know these are older versions of Asterisk but we have customers that are still using them.
Yes event is realible if you AMI application is realible.
No idea about ealy versions.Except you can detect moh by dialplan using NewExten event. Sure that will nto detect moh from endpoint.
Note, some phones not do MOH but instead just plaiing moh sound. For such phones you can't detect MOh state.
I was missing "callevents=yes" in my sip.conf. I get hold events properly now even on older versions of Asterisk.