0
votes

I am developing a VoIP service where two devices can have an audio conversation. I have been reading about signalling protocols like SIP. I understand the power of SIP but I prefer to have my own signalling protocol since my service will be very basic and will not require the full power of SIP.

As far as I understand, the main purpose of SIP and other protocols is to find the address of the remote party. This information I can get from my server, so no need for SIP here.

Establishing the connection from the caller should be relatively easy.

The problem I am facing however: How can I make the callee Android system listen for RTP packets specific to my app? I need this so I can fire up an intent to deal with answering the call etc.

A ServerSocket has been suggested, but I am not using TCP, and I am trying to make a client-to-client connection, not a server-client one.

1

1 Answers

2
votes

SIP is not only used to find the IP address of remote party but also to agree on ports involved in media communication.

For 1-to-1 calls, when caller establishes connection it sends SIP INVITE to callee IP and SIP port. Caller knows that IP because it can query for it from the Registrar server for example.

The SIP INVITE sent from caller to callee has RTP/RTCP ports of caller stored in SDP payload of SIP INVITE message.

When receiving SIP INVITE the callee immediately responds to caller with 180 Ringing, the callee then may display an alert indicating that incoming call is received. Assuming that user accepts the call 200 OK is generated and sent to caller. This 200 OK message has SDP payload with RTP/RTCP ports that will be used by callee to listen for media packets. When 200 OK is received by caller both parties know the ports that will be used for the communication.

If I were you I wouldn't invent any protocols. I would rather try using 3rd party libraries such as pjsip, sofia-sip or some Android SIP stack.

If this is not the case, I would try to adapt the above message flow to your protocol. The problem is that the caller has to know in advance callee's IP and port where signalling message has to be sent. This may be difficult to achieve without any server involved (to query for callee port and IP).