diff --git a/.gitmodules b/.gitmodules
index a6fbc5c56..f488bd83e 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -52,3 +52,6 @@
[submodule "submodules/externals/vo-amrwbenc"]
path = submodules/externals/vo-amrwbenc
url = git://opencore-amr.git.sourceforge.net/gitroot/opencore-amr/vo-amrwbenc
+[submodule "submodules/bcg729"]
+ path = submodules/bcg729
+ url = git://git.linphone.org/bcg729.git
diff --git a/README b/README
index bef6b6f95..4db671064 100644
--- a/README
+++ b/README
@@ -20,6 +20,7 @@ BUILD_AMRNB 0 (don't build amrnb codec), light (try to use amrnb codec
BUILD_AMRWB 0 (don't build amrwb codec), 1 (build your own amrwb codec) | 1
BUILD_GPLV3_ZRTP 0 (don't support ZRTP), 1 (support ZRTP and make the whole program GPLv3)
BUILD_SILK 0 (don't build silk plugin), 1 (build silk) [silk is Skype nonfree patented audio codec]
+BUILD_G720 0 (don't build g729 plugin), 1 (build g729) [g729 is nonfree patented audio codec, contact Sipro lab for more details]
BUILD_TUNNEL 0 (don't build tunnel), 1 (build tunnel) [requires a tunnel implementation in submodules/linphone/tunnel]
In order to use ZRTP you also need to define the media_encryption property to
diff --git a/jni/Android.mk b/jni/Android.mk
index a1eb9fc23..b6787c761 100755
--- a/jni/Android.mk
+++ b/jni/Android.mk
@@ -8,7 +8,10 @@ ifeq ($(BUILD_AMRWB),)
BUILD_AMRWB=0
endif
ifeq ($(BUILD_AMRWB),)
-BUILD_SRTP=1
+BUILD_AMRWB=0
+endif
+ifeq ($(BUILD_G729),)
+BUILD_G729=0
endif
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
@@ -135,3 +138,8 @@ endif
ifneq ($(BUILD_AMRWB), 0)
include $(linphone-root-dir)/submodules/externals/build/vo-amrwbenc/Android.mk
endif
+
+ifneq ($(BUILD_G729), 0)
+include $(linphone-root-dir)/submodules/bcg729/Android.mk
+include $(linphone-root-dir)/submodules/bcg729/msbcg729/Android.mk
+endif
diff --git a/jni/Application.mk b/jni/Application.mk
index 5f1397cba..63d92357c 100644
--- a/jni/Application.mk
+++ b/jni/Application.mk
@@ -42,6 +42,10 @@ ifeq ($(BUILD_SILK),1)
APP_MODULES +=libmssilk
endif
+ifeq ($(BUILD_G729),1)
+APP_MODULES +=libbcg729 libmsbcg729
+endif
+
ifeq ($(RING),yes)
APP_MODULES += libring
endif
diff --git a/res/values/non_localizable_strings.xml b/res/values/non_localizable_strings.xml
index 93edf37c4..601123870 100644
--- a/res/values/non_localizable_strings.xml
+++ b/res/values/non_localizable_strings.xml
@@ -56,6 +56,7 @@
pref_codec_pcmu_key
pref_codec_gsm_key
pref_codec_g722_key
+ pref_codec_g729_key
pref_codec_amr_key
pref_codec_amrwb_key
pref_codec_ilbc_key
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2543d421b..bdd3d68bb 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -158,6 +158,7 @@
silk 12 Khz
silk 16 Khz
silk 24 Khz
+ g729
Codecs
Place a call
Debug
diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml
index c76cd7115..36bca9175 100644
--- a/res/xml/preferences.xml
+++ b/res/xml/preferences.xml
@@ -78,6 +78,10 @@
android:title="@string/pref_codec_amr"
android:defaultValue="true"
android:shouldDisableView="true" />
+