ChanSpy + PlayBack + MutingChannel asterisk - signal-processing

First of all this is not a question related to conference call. This is pure 1 to 1 sip call scenario. and during this sip call what I am trying to do is, to play an audio file on either one of them, and while playing audio, i don't want to hear other's party voice.
For playing audio, I have initiate and AMI command like follows
Action: Originate
Channel: Local/s#whisper-to-party
Variable: MyChannel=SIP/666
Application: Playback
Data: hello-world
ActionID:11
On Dialplan I have
[whisper-to-party]
exten => s,1,Answer()
exten => s,n,ChanSpy(${MyChannel}, qsW)
Now I want whenever I play "hello-world" to the MyChannel, it will hear nothing except my playback audio.
I tried MuteAudio AMI call too before ChanSpy call, but it was mute the whole channel and I can't able to hear hello world
Any solution.

Only way do that is unbridge channel on answer
G([[context^]exten^]priority): If the call is answered, transfer
the calling party to the specified <priority> and the called party to
the specified <priority> plus one.
NOTE: You cannot use any additional action post answer options in
conjunction with this option.
After playback bridge it back via conference room(it will use simple bridge if 2 party in conference)

Related

How do I create single audio file of video calls? Having both participants audio in single file?

We are using twilio video call. We need to create real time transcription for this call. How shall I do that? We tried to use twilio composition api but it's taking too long.
Tried twilio composition api to compose the separate audio files from each participant. This takes forever to create the composition. We need it near real time.

Play live stream on twilio hold

I have a need to play LIVE audio to enqueued twilio calls (instead of playing hold music from an mp3 file for instance).
I've tried pointing the hold music to a live mp3 stream (icecast), which didn't work.
The only thing I can think of is to start a conference, put a call into it that is sending the audio I need to be played on hold, and then on-hold calls are placed (muted) into that conference.
Doesn't seem like best way, and I'd like to avoid conference costs though (there are millions of minutes per month of on-hold time).
Is there a more elegant solution for this problem?
Twilio developer evangelist here.
As far as I am aware this is not possible with <Play>. When you give Twilio an mp3 file to play it first downloads and caches the file (if the headers allow for it). When working with mp3 files Twilio expects an existing file and a finite file size.
I think using a conference, or a series of direct one to one calls, to play the stream as you suggested is likely the best solution. If you do have millions of minutes per month then I recommend you get in touch with the Twilio sales team who might be able to make those minutes more affordable.

Twilio Recording: Pause and Resume

I believe the answer is no, but does Twilio provide ability to pause/resume a recording? Use case is recording a call, but pausing recording when collecting sensitive information. From the REST documentation, it doesn't appear to be a supported capability. Thought someone might have found some options for this requirement.
This is possible, though it's not wholly obvious how from the documentation.
You can modify call state using the REST API, as per https://www.twilio.com/docs/api/rest/change-call-state , and we basically use it to tell the call to re-dial to the same agent (presumably this is a call centre?) but with no-record, and then again with record re-activated once we're done.
You end up with two separate recordings for the call, which in our case we download, stitch together, and store back to our storage platform.
Edit:
Having discussed this issue with Twilio support, there's another possibility which allows you to just have a single recording.
Instead of dialling the two ends of the call together, you instead put them both into a conference that's recorded when you initially connect the call. When you want to pause it, using the REST API, you add a new "hold" leg into the conference, then move the two real ends of the call onto a new conference that isn't recorded. When you're done, you move them back again and it's "unpaused". You then only have one recording from the original conference.
None of these is ideal, and apparently they are working on a proper support setup for this (fairly obvious!) requirement, but this should solve it for now.
The Recording Pause & Resume feature is now supported in the Twilio API. Here's a link that gets you started:
https://support.twilio.com/hc/en-us/articles/360010199074-Getting-Started-with-Call-Recording-Controls#pause_resume

Sending tones via a manual process with Twilio

Our call center deals with businesses and we use Twilio to make our calls. However, many businesses have a menu to navigate before we get to talk to someone. How can I create a 10-key pad on our end and use it to send menu selections to the call we are connected with?
I know about the senddigits attribute on Dialing numbers with Twilio, but this sends preprogrammed tones. We have no way of knowing what the tones need to be until we are connected and in the menu, so this won't work.
I've been through the API pretty thoroughly and can't seem to find anything relating to this.
If there is nothing, is there another software that anyone can recommend that allows for making calls out, generating recordings of calls and allows me to send keytones manually after the call has been started?
Check out the digits attribute of the 'Play' tag.
https://www.twilio.com/docs/api/twiml/play#attributes-digits
Each 'w' character tells Twilio to wait 0.5 seconds instead of playing a digit.
Assuming I am understanding your problem, could you not us MP3s of DTMF tones (http://jetcityorange.com/dtmf/) and PLAY to send the tones after the call has started?

Listening on asterisk active calls from custom IOS app

I am working on an mobile app to listen in on ongoing asterisk calls. Asterisk is set up to record calls, however the inbound and outgoing voices get saved to different wav files. Overcoming first obstacle was to stream wav files while they are being written to - this was achieved using Node JS, however now I need to join the mix two files together and stream them, which would be doable if the files were not written to at the same time.
First option would be to figure out how to programatically join the two while continuously checking if EOF has changed while also streaming the result. (Feels above my paygrade)
Second option would be to stream two files independently to client IOS application which would play them at the same time. If the first challenge of playing two streams simultaneously would be solved, it would require very stable connection. Therefore I don't see this as a viable option
Third possibility would be to embed softphone into the IOS app and use it as a client for ChanSpy. Would that be possible and what library can help me achieve it?
What do you guys suggest, perhaps there are more options out there?
Thanks
What about Using Application_MixMonitor instead?
Why not just build a SIP client on IOS and use ChanSpy to listen to the calls live?
http://www.voip-info.org/wiki/view/Asterisk+cmd+ChanSpy
You can supply m option to mixmon application or use sox to do the mixing.
https://wiki.asterisk.org/wiki/display/AST/Application_Monitor
http://leifmadsen.wordpress.com/tag/mixmonitor-sox-mixing-asterisk-script/

Resources