How Implement The Voip Application Using Android.net.rtp Package
Solution 1:
The trick is to get the port mapping correct. You need to use the port number from audioStream.getLocalPort() and send this port number to the peer in the SDP packet as SIP signalling.
Check out this example application which implements sip functionality https://github.com/Mobicents/restcomm-android-sdk/tree/master/Examples/JAIN%20SIP
Solution 2:
I used the same code you submitted, and got it working with minor changes. Basically i found the problem was getting the port number correct.
When creating the audioStream
the port number seems to be random. At Android developer
I found: Note that the local port is assigned automatically to conform with RFC 3550.
What I did was I started the application on one phone first and used audioStream.getLocalPort()
to find the port number. Then I connected to this port using the other one. This resulted in two-way communication, even if i only had the correct port number on one phone.
Hope this helps.
Solution 3:
I think you should set the speaker on!
Maybe you can use the following method:
audioManager.setSpeakerphoneOn(true);
Post a Comment for "How Implement The Voip Application Using Android.net.rtp Package"