Accept user input while two calls are patched with dial extension - asterisk

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.

Related

Asterisk AMI - How to simulate a DTMF sending action over AMI

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!

In Asterisk how can I use originate command to send a fax with Elastix virtual fax

I want to send a fax with my application via Asterisk. I need to execute Originate command to send a fax and use Elastix virtual fax.
My Elastix virtual fax is defined IAX and 999 extension number.
Commandline:
asterisk -rx "channel originate Local/1234567890#from-internal extension 999#from-internal"
pro-sip*CLI> channel originate (tab pressed)
There are two ways to use this
command. A call can be originated between a channel and a specific
application, or between a channel and an extension in the dialplan.
This is similar to call files or the manager originate action. Calls
originated with this command are given a timeout of 30 seconds.
Usage1: channel originate application [appdata]
This will originate a call between the specified channel tech/data and
the given application. Arguments to the application are optional. If
the given arguments to the application include spaces, all of the
arguments to the application need to be placed in quotation marks.
Usage2: channel originate extension [exten#][context]
This will originate a call between the specified channel tech/data and
the given extension. If no context is specified, the 'default' context
will be used. If no extension is given, the 's' extension will be
used.
Sure this example not check anything like channel not availible or busy etc.
You can do same using AMI action originate
http://www.voip-info.org/wiki/view/Asterisk+Manager+API+Action+Originate
Correct application should also check dialling state, redial etc.

Capture and play voice with Asterisk ARI

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.

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

Where can I see executed "Originate" command from Asterisk AMI

I'm adjusting simple application that among other things should be able to call another party using Asterisk AMI Originate command.
I'm stuck and I believe that my originate command is wrong.
Where/how can I see log of Originate commands that Asterisk creates when I use regular phone so I can compare it to my hand crafted one?
Use a network sniffer, such as tcpdump or wireshark, and capture the packets that come and go to/from asterisk. By default, it uses 5038/tcp. Check your manager.conf file, and look for the bindaddr and port options to be sure you capture the right traffic.
If you are using ssl (sslenable=yes), then you will have to configure wireshark with your ssl keys, so it can decrypt the traffic or just use normal tcp (without ssl) for debugging and then switch to ssl.
You should see the Action: Originate coming in to asterisk, and the asterisk response and the associated events. Look for the ActionID parameter of the action so you can trace which responses and events correspond to each issued action.
Take into account that an async originate (async: true) will return a response as soon as the action is received by asterisk, but it will then send asynchronous events to inform the call status (once finished). On the other hand, when using async: false, the call will be placed and the response will have the status.
A few more resources on the originate action:
http://www.voip-info.org/wiki/view/Asterisk+Manager+API+Action+Originate
https://wiki.asterisk.org/wiki/display/AST/ManagerAction_Originate
Another question related to the async parameter:
Asterisk originate response says successfully queued but nothing more
Hope it helps!
EDIT: Asterisk does not create the originate command, but will dial a target (a channel) based on an incoming originate action, or call file, so your application (the ami client) will issue an originate action and then asterisk will react to it by doing the call. If your call is originating from a phone, it's more probable that the call is being originated by a dial() command in your dialplan.

Resources