Comments (3)
from peers.
Thank you @ymartineau for the response! Don't get me wrong, I'm not asking to solve any problem just looking for a hint on using this library. I read the demo and the documentation but I'm still confused: I'm able to register the UserAgent
and sending invites, then reacting on calleePickup
. I'm stuck here: what is the right way to playback an audio stream when the callee picks up?
from peers.
I've came up with this:
@Override
public void calleePickup(SipResponse sipResponse) {
SDPManager sdpManager = new SDPManager(this.agent, LOGGER);
SessionDescription sessionDescription = sdpManager.parse(sipResponse.getBody());
MediaDestination mediaDestination = sdpManager.getMediaDestination(sessionDescription);
String destination = mediaDestination.getDestination();
int port = mediaDestination.getPort();
Codec codec = mediaDestination.getCodec();
DatagramSocket datagramSocket = null;
int rtpPort = this.agent.getConfig().getRtpPort();
if (rtpPort == 0) {
int localPort = -1;
while (localPort % 2 != 0) {
datagramSocket = new DatagramSocket();
localPort = datagramSocket.getLocalPort();
if (localPort % 2 != 0) {
datagramSocket.close();
}
}
} else {
datagramSocket = new DatagramSocket(rtpPort);
}
RtpSession rtpSession = new RtpSession(this.agent.getConfig().getLocalInetAddress(), datagramSocket, false, LOGGER, HOME);
rtpSession.setRemoteAddress(InetAddress.getByName(destination));
rtpSession.setRemotePort(port);
SoundSource soundSource = new FileReader(FILENAME, DataFormat.DEFAULT, LOGGER);
CaptureRtpSender rtpSender = new CaptureRtpSender(rtpSession, soundSource, false, codec, LOGGER, HOME);
rtpSender.start();
}
from peers.
Related Issues (20)
- Pass custom SDP
- Logger not assigned in RtpSender HOT 2
- Expose on a maven repo HOT 3
- how to set custom caller id ??
- DTMF tones detected many times by asterisk
- How to play multiple audio files? HOT 1
- Missing dtmfDetected on UserAgent HOT 1
- NullPointerException instead of SocketException when port is already in use HOT 2
- "are you binding to the correct local IP?" HOT 3
- logging to console HOT 2
- Integrating Peers in java application.
- voice broken HOT 1
- the function SipHeaders.remove() exists class cast exception
- UDP socket not full clear up HOT 1
- How can i play mp3 or wav? HOT 2
- There is a Hold Music always HOT 3
- How to get Ringing Event?
- Hold Feature HOT 1
- Close timer ,InputStream and OutputStream
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from peers.