Send RTP packet (stream) to server over internet - android

There are so many posts about rtsp protocol, generating rtp packets from android. I wrote a code which can generate rtp packet (stream) and send (unicast / broadcast) to local network. My question is how can i send the packets (stream) to server over Internet? As much i know we can't unicast to a server over inetnet from a local device (have private ip).
Android camera ----> RTP PACKETS -----------------------------------------------> SERVER
Internet

Yes you can. The router is responsible for this. In fact your router which has access to the internet has a public ip address which everyone shares behind the private network. That is how I am typing to you. Your android needs to have internet access to someone's network. The server will then contact that router since it will know its public ip address and your router will send those packets to your android.

Related

android streaming camera over 3g

My application must stream device camera over 3g connection to server .
I follow this question link and use with success libstreaming (spydroid streaming lib) on wifi.
If device and server aren't on same lan, I need a 3g connection to do same thing, but I think there are problems caused by NAT .
Packets of libstreaming are sent by UDP , and over 3g they are blocked.
There are other solutions? Maybe using streaming over TCP I can reach my purpose.
When you are outside of the NAT you can't send data inside.
Unless:
Someone asks for that data.
In case 1 you need to make a UDP server with the fix IP and request
its data by IP:PORT
Using port forwarding.
In case 2 you need to set a port forwarding at the router level.

Encrypt traffic with VpnService

I've searched for a solution for 2 days.
The problem is: i need to create the app for encrypting (with some custom algorithm) all internet traffic from a device.
I've found that I can use vpn and android provides me a class VpnService. I don't understand how to encrypt the tcp packets with VpnService class.
Could anyone help me please?
By using VpnService, you can get all the IP packet routed to your interface.
What you get here, is IP packet, which takes TCP/UDP packet as payload.
The the IP packet should be tunneled to remote server.
Encrypt the traffic with remote server is what you need.

UDP between 3G connected device and WiFi PC

Is it possible to use UDP over the 3G network? I have tried but failed, I have an application on my PC that reads UDP packets and I'm trying to send UDP packets to that "server" using my 3G connected phone.
These scenarios works:
Local to Local over Wifi
External to External over Wifi
This does not work:
3G to PC
I found the following source. The most important thing for me is:
an iPhone can send UDP packets to hosts off the AT&T network
an iPhone can't receive UDP packets sent to it from a host off the AT&T NAT network
an iPhone SHOULD be able to send & receive UDP packets to other iPhones on the AT&T network.
We should be able to send DIS from an iPhone to a server
We should be able to do multicast on a WiFi interface, and send & receive to other
hosts on the same WiFi network
This should also apply to all other smartphones. If you can not receive UDP packages from your phone the packets could be blocked by your Network Provider, or something in your setup is wrong.
The bigger problems seems to me that you are unable to send data back to your phone. That makes all UDP calls a one way route and maybe render your server useless.

RTP unreachable SIP Phone

I try to create sip phone application on android and I have some problem which is the RTP packet is unreachable to android emulator.
I'm not sure about this problem because of IP emulator.
I can do SIP Register and can call to other soft phone but when I talk there is no audio.
After I try to capture the packet, I see that the server cannot send RTP packet to the android emulator. So, it makes my program cannot have audio.
How can I fix this problem?
Have you done capture from start of call?
Have you seen no packet sent by server from start of call?
If server not sent single packet then you must check SDP parameters like,
a=sendrecv
connection ip
port of RTP
Also check that you (client) and server both are in same network.
If both are not in same network then NAT may affect RTP flow.

Establishing a sip proxy server on PC with Android clients

I have implemented a sip based real time voice transfer under the impression that two of my phones on the same WIFI network can communicate provided that they have each others IP addresses. However, I could not make it work... I am using rtp to transfer voice between these clients.
Also, it's come to my notice that using a PC on the WIFI network as server is better. Now, can I use this PC as a proxy server to establish a sip end to end connection? If yes, how?
Are there existing implementations for initializing a session? Specifically, if someone could give me an example on what address/ports I would need both of my clients to establish the connection to, it would be great.
If you have implemented correctly all the necessary parts that SIP protocol demands, then you have to install a SIP server on your PC and just create two accounts that the phones will connect with them on the server. I have tried with Android the Asterisk server, but I am sure that there will be many others out there...
By default SIP servers are listening on port 5060 using UDP. This port is used only for the initiation of the session (and other control messages) and NOT for the transfer of RTP packets.

Categories

Resources