Does Avaya have an API for retrieving the audio stream of a VoIP call? - voip

I have been up and down the documentation and all over the web looking for an answer to this question but have not had any luck. I have a project where I am looking to retrieve the live audio stream from an Avaya telephone call and then transcribe the call as its happening.
Does Avaya support this functionality?

You may use DMCC (which has bindings to different languages and also a language-agnostic XML interface), which implements CSTA ECMA-269 industrial standard. It has several methods to start an API session (StartApplicationSession), subscribe to events (MonitorStart) and assume first-party control over a device (RegisterTerminal). If a device is registered by an application in client-media mode, you may directly access the RTP media stream coming into and going out from the phone. RTP address, port and codec are contained in MediaStartEvent responses which you can receive via DMCC once you've set the event subscription properly. There's also a distinctive RecordMessage method that writes the audio stream from a device to a file (which you may process later).
Registering a device will likely consume a «DMCC license» (one for each registered device). If you use third-party call control methods (such as MakeCall or AnswerCall), a «Basic TSAPI license» will also be consumed for every controlled device. I've discovered out that a «Basic TSAPI» license is consumed as soon as you issue a MonitorStart request to subscribe to events. You may want to consult your vendor about how to obtain the appropriate amount of licenses for your AES. I personally found Avaya licenses rather complicated in terms of understanding what license set exactly your application may need. There's my thread on Avaya's DevConnect resource which may shed some light here.
Playing with your Avaya AES installation using the DMCC Dashboard is a good way to familiarize yourself with DMCC API.

Related

Embedded audio conference API

I really don't have knowledge about this area (WebRTC, video conference, audio conference, etc).
I want to add to my system (web application) a client support using audio conference.
I was looking for Twilio, it seems a good solution, but I think it doesn't fit my case, because it always need a virtual phone number to get works and I don't need it at my system.
What I need is something like Facebook calls, Google Hangouts (without video).
Is there any solution/library/API for it? It's no necessary be a free solution.

Bluetooth data to HID for BLED112

We have bought BLED112 to interface our target via BT.
An android app interacting with target via BT & USB (HID).
We have used some Bluetooth communication to write a program and send data to dongle.
Now can somebody here having any experince in converting that BT data to a HID signal.
Have anybody tried that?
Is there any BGScript code which we need to write to achieve that?
Please let me know if the thought is completely wrong.
Referring to a comment above which states,
We are writing an Android App which can send data to BLED112 over BLE interface or GATT. My question is how can I convert that data (basically a command) to an HID (key event), correct me if my understanding is wrong?
If I understand the use-case correctly, I think, in the initial stages of the development, you will need to use the BLE-GUI utility that BlueGiga provides.
With that utility you can see the communication between the BLED112 Dongle and the BLE112 Module. BLED112 shall be simulating what the android app would do?
First, you will need to know the GATT structure stored in BLED112 to write to or read from the BLED112.
Secondly, the way BLE112 works is an event-based implementation. Going through the API reference document for BLE112 shall help you understand the events generation conditions and codes that are generated modified when a characteristic value is updated by the android application, or read by android application. You get events for connection, disconnection, read from, write to, notification enabled for, indication enabled for, etc.
On the BLE112 side, depending upon what service and what characteristics in that service is going to be used for data transfer between Client (Android App) and Server (BLE112), you need to write suitable implementation in event callback handlers.
There is a standard service called Human Interface Device which has a reserved UUID: 0x1812.
Once you configure your BLE112 as a HID over GATT device, your android app shall see a service with UUID: 0x1812. Parse the service descriptor and get the characteristics bundled up into the service. You can read from or write to that service depending upon access parameters set in gatt.xml
As an example, say, if it is a Keyboard, you can send the scancode for (make and break) of the key depending upon what key is pressed. How to get a scancode is out of the scope of this question anyway, and sadly I had worked on PS2 keyboards, so I don't really know how to get the scancode from a USB keyboard.
So, you have the scancode for the key pressed, and you know the characteristics to write that into. Write it, the application should enable the Notifications for that characteristics, so that it is notified whenever the key is pressed and value is written into the characteristics. To let application enable notifications or indications for the characteristics, study the developer guide that talks about how to write a gatt.xml for Bluegiga-based BLE devices. I'll give you a hint: in xml, in the characteristics configuration you have to write notify="true".
About parsing of the service and characteristics in Android, Unfortunately I am not an android developer, but an embedded developer, I know how the BLE112 module part is to be implemented, while I have no insight of how android parses the data. But, there are plenty of question and discussions about it online, which you might understand better than me since you have an android background.

What libraries/APIs allow me access real time audio waveforms of a phone call?

I am looking to build an app that needs to process incoming audio on a phone call in real time.
WebRTC allows for this but i think this works only in their browser based P2P audio communications functionality but not for phone calls/ VOIP.
Twilio and Plivo allow you record the audio for batch/later processing.
Is there a library that will give me access to the audio streams in real time? If not, what would I need to build such a service from scratch?
Thanks
If you are open to using a media server (so that the call is not longe P2P but it's mediated by the media server using a B2B model), then perhaps the Kurento Media Server may solve your problem. Kurento Media Server makes possible to create processing capabilities which are applyied in real time onto the media streams. There are many examples in the documentation of computer vision and augmented reality algorithms applied in real time over the video streams. I've never seen an only-audio processing module, but it should be simple to implement just by creating an additional module, which is not too complex if you have some knowledge about C/C++ and media processing concepts.
Disclaimer: I'm part of the Kurento development team.

Is there any telephony framework in linux?

I have a USB 3g modem, On windows it comes with software with which, I can use it for calling, sending and receiving SMS. Now, I want to write similar open source application in linux ( I also want to provide DTMF detection functionality ).
In windows, we can achieve this through TAPI, what are the similar technologies/frameworks in linux? Is there any similar opensource application ( I want to use as a reference )?
Yes it is is called ofono - project started by Intel/Nokia for Maemo/Moblin. From wikipedia:
oFono is a free, open source project for mobile telephony (GSM/UMTS)
applications. It uses high-level D-Bus API for use by telephony
applications. It uses 3GPP standard. It is free software released
under the terms of the GNU General Public License v2.
And Asterisk and Freeswitch are PBX software and probably are not what you are looking for.
Freeswitch
I'm not sure about a USB modem, but for VOIP telephony, Freeswitch is excellent. It uses a generic socket API to make it extensible via any number of languages. It can handle inbound and outbound calls, text-to-speech, voice recognition, etc.
My Vodafone Merlin card was recognized as a ttySx ant it was possible to interact by simple AT-commands like with old analog modems. There were also extra commands for reasing the sim card address book, sms and I believe also for sending sms.
We use sms tools: http://smstools3.kekekasvi.com/
The SMS Server Tools 3 is a SMS Gateway software which can send and receive short messages through GSM modems and mobile phones.
You can send short messages by simply storing text files into a special spool directory. The program monitors this directory and sends new files automatically. It also stores received short messages into another directory as text files. Binary messages (including Unicode text) are also supported, for example ring tone messages. It's also possible to send a WAP Push message to the WAP / MMS capable mobile phone.
The program can be run as a SMS daemon which can be started automatically when the operating system starts. High availability can be ensured by using multiple GSM devices (currently up to 64, this limit is easily changeable).
The program can run other external programs or scripts after events like reception of a new message, successful sending and also when the program detects a problem. These programs can inspect the related text files and perform automatic actions, for example storing information into a database (for example MySQL or Microsoft SQL Server), sending an automatic reply, forwarding messages via eMail (SMS to eMail gateway), ... and whatever you like."
Asterisk would be the usual suspect for what you want - http://www.asterisk.org/

Record audio from various internal devices in Android (via undocumented API)

I was wondering whether it is possible to capture audio data from other sources like the system out, FM radio, bluetooth headset, etc. I'm particularly interested in capturing audio from the FM radio and already investigated all possibilities including trying to sniff the raw bluetooth communication between the phone and the radio device with no luck. It's too bad Android only allows recording audio from the MIC.
I've looked at the Android source code and couldn't find a backdoor to allow me to do that without rooting the device. Do you, at least, have any idea how to use other devices (maybe access somehow /dev/audio) say via NDK or even better - Java (maybe Reflection?) to trick the system to capture the audio stream from say, the FM radio. (in my case I'm trying to develop the app for the HTC Desire)
PS. And for those of you who are against using undocumented APIs, please don't post here - I'm writing an app that will be for my personal use or even if I ever publish it I will warn the user of possible incompatibilities.
I've spent quite some time deciphering the audio stack, and I think you may try to hijack libaudio. You'll have trouble speaking directly to the hardware (/dev/*) because many devices use proprietary audio drivers. There's no rule in this regard.
However, the audio hardware abstraction layer (HAL) provided by /system/lib/libaudio.so should expose the API described at http://source.android.com/porting/audio.html
The Android system, and especially audioflinger, uses this libaudio HAL to find available devices, deal with routing, and of course to read/write PCM data.
So, you could hijack the interaction between audioflinger and libaudio, by renaming the later, and providing your own libaudio which decorates the real one. Doing so, you should be able to log what happens and very possibly intercept FM radio output, provided that this is not directly handled by the hardware.
Of course, all this requires rooting. Please comment if you manage to do this, that interests me.

Resources