Author Message
Mahammad
Joined: Jan 18, 2018
Messages: 10
Offline
Dear Experts,

I am intended to write a rest api where I can call a phone and answer it. I took softphone app from sampleaps provided by Avaya and transferred it to spring boot application. But I have difficulti in recording the calls between parties. I have MediaMode.Client and I have implemented MediaControlListener.

Code from sample app:
public void mediaStarted(MediaStartEvent startEvent) {
try {

// Get the Far End RTP/RTCP Address, the codec and the Packet
// Size from the event.
InetAddress remoteAddress = InetAddress.getByName(startEvent
.getRtpAddress().getAddress());
int remoteRtpPort = startEvent.getRtpAddress().getPort()
.intValue();
int remoteRtcpPort = startEvent.getRtcpAddress().getPort()
.intValue();
String remoteCodec = startEvent.getCodec();

MediaEncryption remoteEncryption = new MediaEncryption();
remoteEncryption.setProtocol(startEvent.getEncryption()
.getProtocol());
remoteEncryption.setTransmitKey(startEvent.getEncryption()
.getTransmitKey());
remoteEncryption.setReceiveKey(startEvent.getEncryption()
.getReceiveKey());
remoteEncryption.setPayloadType(startEvent.getEncryption()
.getPayloadType().intValue());

int packetSize = startEvent.getPacketSize().intValue();

System.out.println(" starting Audio: remote=" + remoteAddress
+ ":" + remoteRtpPort + ", codec=" + remoteCodec
+ ", packetsize=" + packetSize + ", protocol="
+ remoteEncryption.getProtocol());

// Start Audio on the Client Media Stack
// with the Far End Audio Information
System.out.println("before speaking");
audio.start(
new InetSocketAddress(remoteAddress, remoteRtpPort),
new InetSocketAddress(remoteAddress, remoteRtcpPort),
remoteCodec, packetSize, remoteEncryption);

//startRecording();
System.out.println("started speaking");
} catch (Exception e) {
e.printStackTrace();
}

I need to write startRecording method. Could anyone please help me? How should this method be implemented and where? Should we extend some interface from avaya package?

Thanks
JohnBiggs
Joined: Jun 20, 2005
Messages: 1139
Location: Rural, Virginia
Offline
While Avaya provides the Media Stack API in order to help prototype applications it is not production quality code. It lacks lost packet, jitter and other problem scenario handling for the packet stream. It also does not scale indefinitely. The DMCC SDK does not provide methods that handle the decryption and processing of RTP packets. That is left to the application developer to address. You may want to take a look in the DMCC .NET SDK. If I recall properly there is/was a sample application in it that SDK which provided some media processing functionality. I do not know how it achieved what it did.
MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Offline
The MediaStartedEvent indicates that Communication Manager has started to transmit an RTP stream to the IP Address & Port that you provided in your Terminal Registration Request. It also provides other necessary data such as the IP Address and Port from which it is sending the RTP and the Codec and Encryption scheme it is using.

The RTP packets included header information and the media from the call.

You must ensure that something (your application or some other application) listens at the local port port and:

1. Receives the RTP data
2. If necessary, decrypts the media in the RTP data
3. If necessary, decodes the media
4. Dos something with the media. Most likely, buffer it and store it in a file.
5. Handles issues such as missing packets or out-of-order packets etc.

You can get more information on RTP in RFC3550 https://tools.ietf.org/html/rfc3550

You can either write some RTP stack software yourself or get some from a third party.

I should note that the DMCC Java SDK includes a very basic client media stack library which is used by the Softphone sample application to receive RTP and divert it to a speaker. That is what audio.start() does. However, this library is not suitable for a production environment.

Martin
Mahammad
Joined: Jan 18, 2018
Messages: 10
Offline
Thanks Martin, John

Do you know anyone or company that could provide online training for dmcc?

thanks
MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Offline
I don't know of any third party training for DMCC. This website and this forum have all the information that you should need in order to develop a DMCC application. Handling RTP is outside the scope of DMCC.

Martin
Go to:   
Mobile view