I want to make a custom sipdroid client by using reverse byte order. I think that makes other Voip clients cannot decode these data.
So I read the code of the SipDroid. I found RTP data goes this way: 1. AudioRecord.read(originalPCM) 2. encode(originalPCM, encodedData) 3. rtp_socket.send(rtp_packet) //the encodeData is rtp_packet's data part
And the other side is: 1. rtp_receive(rtp_packet) 2. decode(encodeData, PCMData) //the encodeData is rtp_packet's data part 3. AudioTrack.write(PCMData)
So I modified the SipdroidSocket class. In send method, I add the following code at the beginning.
byte[] b = pack.getData();
reverse(b);
pack.setData(b);
And add the following code at the end of the receive method.
byte[] b = pack.getData();
reverse(b);
pack.setData(b);
I think in this way, the two client can work as usual. But it failed. And I don't know the reason. Please help me to find out why. Thanks.