RTP/SRTP support in Android

2,558 views
Skip to first unread message

ilnadi

unread,
Jun 9, 2011, 8:12:26 AM6/9/11
to csipsim...@googlegroups.com
I am trying to assess the level of RTP support in Android.  I realize the answer is changing as android.net.rtp just became public in API 12.  Could someone enlighten me as to how much of the SRTP/ZRTP code was already present in Android and how much needed to be added by this project?

Régis Montoya

unread,
Jun 9, 2011, 8:30:55 AM6/9/11
to csipsim...@googlegroups.com, ilnadi
Hi,

CSipSimple rely on pjsip sip library. This one do everything in native
code (I mean C code).
So it's completely independant of what is provided by the android API
and it only rely on very low level native apis. Pjsip wrap these api to
provide a library that is cross platform : pjsip works on windows,
linux, symbian, iphone .... The portage I did of pjsip for android rely
on the linux implementation for RTP and transport stuff. (the only main
thing that I needed to port is the audio driver).

So regarding your question, everything is added by the fact the pjsip
library is included.

For SRTP that's directly included in the pjsip library and as for ZRTP
Werner Dietmann contributed to pjsip a portage of the ZRTP lib for pjsip.

Besides ZRTP and TLS support in pjsip need a link to the openssl
library. This one is not included in the NDK. As consequence, to ensure
compatibility, CSipSimple also rebuild and embbed the openssl library in
TLS builds.

As an additional and more global info, you should have a look to the
stock android SIP application source code. (it's available on android
GIT repository).
It is actually the reason why google introduced the support of rtp. (and
they also introduced many other things required for a sip client that
was not necessarily there previously - specialy on audio api layer).

ilnadi

unread,
Jun 9, 2011, 10:26:49 PM6/9/11
to csipsim...@googlegroups.com, ilnadi
Thank you, that was exactly what I was looking for.  Excusing my ignorance (I do not work with NDK or native Android code) I have been poking around http://android.git.kernel.org/ and have not been able to locate any of the SIP/RTP/SSL code.  Could someone point me to the project path for these packages?

Régis Montoya

unread,
Jun 10, 2011, 8:06:58 AM6/10/11
to csipsim...@googlegroups.com, ilnadi

The main source code of the sip stock app is available here :

http://149.20.20.141/?p=platform/frameworks/base.git;a=tree;f=voip;h=dbd0a574b43c57d2f8f2a3a3adf840418d83bcdd;hb=HEAD

(it's android.git.kernel.org but somehow it does not resolve anymore ;).

this is the main source of the stock sip service. The java part contains :
* the service (com.android....)
* things to manage RTP and media
(http://149.20.20.141/?p=platform/frameworks/base.git;a=tree;f=voip/java/android/net/rtp;h=3996ccbaf684320ea0fb2c351934be155b2af497;hb=HEAD)
* the api bindings
The native part (jni folder) :
* The audio driver,
* the actual code for RTP and media (codecs, rtp stream, echo
suppressor...)

Then there is the part that parse sip header that is in another project
(http://149.20.20.141/?p=platform/external/nist-sip.git;a=tree;f=java;h=b420c1f8b1fbfa321a4d75e9189aaefbcacf2947;hb=HEAD).
As far as I understood it use nist sip stack.
And finally the UI which is in the Telephony app project of the android
source.

So if you only need something that does RTP you can dive into their
source code on the service part. However that's very basic (and
currently does not support SRTP for example).
You can also try to use low layers of pjsip which are maybe more
reliable and more complete than the android current implementation and
support srtp and zrtp. (csipsimple use this through pjsua - the sip user
agent on the top of pjsip libraries).


ilnadi

unread,
Jun 10, 2011, 8:55:16 AM6/10/11
to csipsim...@googlegroups.com, ilnadi
Thank you.
Reply all
Reply to author
Forward
0 new messages