diff --git a/build/android/Android.mk b/build/android/Android.mk
index 18fbbdbfd3cd1bbd0405ec2ab8ee47050859b6b5..d815a11a9e971e83ebe4df85c070b4fe26020154 100755
--- a/build/android/Android.mk
+++ b/build/android/Android.mk
@@ -64,7 +64,8 @@ LOCAL_SRC_FILES := \
 	xml.c \
 	xml2lpc.c \
 	lpc2xml.c \
-	remote_provisioning.c
+	remote_provisioning.c \
+	quality_reporting.c
 
 ifndef LINPHONE_VERSION
 LINPHONE_VERSION = "Devel"
diff --git a/build/vsx/LibLinphone/LibLinphone.vcxproj b/build/vsx/LibLinphone/LibLinphone.vcxproj
index 9bc9aadf9ca46e7f25d9dd752469c01c590f09ba..bc1f56695ff132eb5ee13301a4f65e270f144e75 100644
--- a/build/vsx/LibLinphone/LibLinphone.vcxproj
+++ b/build/vsx/LibLinphone/LibLinphone.vcxproj
@@ -203,6 +203,7 @@
     <ClCompile Include="..\..\..\coreapi\offeranswer.c" />
     <ClCompile Include="..\..\..\coreapi\presence.c" />
     <ClCompile Include="..\..\..\coreapi\proxy.c" />
+    <ClCompile Include="..\..\..\coreapi\quality_reporting.c" />
     <ClCompile Include="..\..\..\coreapi\sal.c" />
     <ClCompile Include="..\..\..\coreapi\siplogin.c" />
     <ClCompile Include="..\..\..\coreapi\sipsetup.c" />
@@ -275,4 +276,4 @@
   <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" Condition="'$(Platform)'=='ARM'" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/coreapi/CMakeLists.txt b/coreapi/CMakeLists.txt
index 8b265095023ca489d1ed897bd901b6eb4a55ebeb..05ae3d81106ce2252dfc1d6e834d10475a3a36ff 100644
--- a/coreapi/CMakeLists.txt
+++ b/coreapi/CMakeLists.txt
@@ -74,6 +74,7 @@ set(SOURCE_FILES
 	offeranswer.c
 	presence.c
 	proxy.c
+	quality_reporting.c
 	remote_provisioning.c
 	sal.c
 	siplogin.c
diff --git a/coreapi/Makefile.am b/coreapi/Makefile.am
index 68d78447f28dec30bf706ea4ad9f2820e30e5221..5edc54059120eac0487482a0b98637408aca7d27 100644
--- a/coreapi/Makefile.am
+++ b/coreapi/Makefile.am
@@ -56,6 +56,7 @@ liblinphone_la_SOURCES=\
 	xml2lpc.c \
 	lpc2xml.c \
 	remote_provisioning.c \
+	quality_reporting.c \
 	$(GITVERSION_FILE)
 
 if BUILD_UPNP
diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c
index eb4a0055186e9964b388c64a6f6f5e663757d6b9..c095898ae2886866663df29243b66e5e9235e2cf 100644
--- a/coreapi/linphonecall.c
+++ b/coreapi/linphonecall.c
@@ -782,6 +782,7 @@ void linphone_call_set_state(LinphoneCall *call, LinphoneCallState cstate, const
 			 Indeed it does not change the state of the call (still paused or running)*/
 			call->state=cstate;
 		}
+		
 		if (cstate==LinphoneCallEnd || cstate==LinphoneCallError){
 			switch(call->non_op_error.reason){
 				case SalReasonDeclined:
diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c
index bd852968e87ebadd6d6df46f74938dcc664ab9d1..23090babaafbbea9fb1e52c39a5ba3f62f6d74e2 100644
--- a/coreapi/linphonecore.c
+++ b/coreapi/linphonecore.c
@@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "sipsetup.h"
 #include "lpconfig.h"
 #include "private.h"
+#include "quality_reporting.h"
 
 #include <math.h>
 #include <ortp/telephonyevents.h>
@@ -3469,6 +3470,8 @@ static void terminate_call(LinphoneCore *lc, LinphoneCall *call){
 	/*stop ringing*/
 	linphone_core_stop_ringing(lc);
 
+	linphone_quality_reporting_submit(call);
+
 	linphone_call_stop_media_streams(call);
 
 #ifdef BUILD_UPNP
diff --git a/coreapi/quality_reporting.c b/coreapi/quality_reporting.c
new file mode 100644
index 0000000000000000000000000000000000000000..e3d25c42406177a13a136a6531e0f20a4f9a8529
--- /dev/null
+++ b/coreapi/quality_reporting.c
@@ -0,0 +1,125 @@
+/*
+linphone
+Copyright (C) 2014 - Belledonne Communications, Grenoble, France
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "../config.h"
+#endif
+
+#include "linphonecore.h"
+#include "private.h"
+#include "sal/sal.h"
+
+#define PRINT2(x, f) ms_message(#x ": " #f, x)
+#define PRINT(x) PRINT2(x, "%s")
+
+void linphone_quality_reporting_submit(LinphoneCall* call) {
+	// example at http://tools.ietf.org/html/rfc6035#section-4.7.3
+	// only if this is a linphone account
+	// only if call succeeded
+	// to: collector@sip.linphone.com
+	// executed AFTER BYE's "OK" response has been received
+	// expires value?
+	// un envoi à faire par stream ? (ssrc différent pour chaque stream)
+	// memory leaks
+	
+	LinphoneContent content = {0};
+ 	LinphoneAddress *addr;
+	int expires = 3600;
+	const char *remote_identity;
+	const char *local_identity;
+	const char *orig_identity;
+	const char *local_ip = call->localdesc->addr; //or call->localip ?
+	const char *remote_ip = "TODO";
+	uint32_t local_ssrc = rtp_session_get_send_ssrc(call->audiostream->ms.session);
+	uint32_t remote_ssrc = rtp_session_get_recv_ssrc(call->audiostream->ms.session);
+
+	int local_port = 0; //TODO
+	int remote_port = 0;//linphone_address_get_port(linphone_call_get_remote_address(call));
+
+	if (call->dir == LinphoneCallIncoming) {
+		remote_identity = linphone_address_as_string(call->log->from);
+		local_identity = linphone_address_as_string(call->log->to);
+		orig_identity = remote_identity;
+	} else {
+		remote_identity = linphone_address_as_string(call->log->to);
+		local_identity = linphone_address_as_string(call->log->from);
+		orig_identity = local_identity;
+	}
+
+	ms_message("Submitting PUBLISH packet for call between %s and %s", local_identity, remote_identity);
+
+	PRINT(call->dest_proxy->contact_params);
+	PRINT(call->dest_proxy->contact_uri_params);
+	PRINT(call->dest_proxy->dial_prefix);
+	PRINT(call->dest_proxy->realm);
+	PRINT(call->dest_proxy->type);
+	PRINT(call->dest_proxy->reg_identity);
+	PRINT(call->dest_proxy->reg_proxy);
+	PRINT(call->dest_proxy->reg_route);
+
+	PRINT(sal_op_get_route(call->op));
+	PRINT(sal_op_get_from(call->op));
+	PRINT(sal_op_get_to(call->op));
+	PRINT(sal_op_get_proxy(call->op));
+	PRINT(sal_op_get_remote_contact(call->op));
+	PRINT(sal_op_get_network_origin(call->op));
+
+	PRINT(call->log->refkey);
+	PRINT(call->localdesc->addr);
+
+	PRINT2(call->log->start_date_time, "%ld");
+	PRINT2(call->log->start_date_time + call->log->duration, "%ld");
+	PRINT(linphone_timestamp_to_rfc3339_string(call->log->start_date_time));
+
+
+	content.type = ms_strdup("application");
+	content.subtype = ms_strdup("vq-rtcpxr");
+	content.data = ms_strdup_printf(_("VQSessionReport: CallTerm\r\n"));
+	content.data = ms_strdup_printf(_("%sCallID: %s\r\n"), content.data, call->log->call_id);
+	content.data = ms_strdup_printf(_("%sLocalID: %s\r\n"), content.data, local_identity);
+	content.data = ms_strdup_printf(_("%sRemoteID: %s\r\n"), content.data, remote_identity);
+	content.data = ms_strdup_printf(_("%sOrigID: %s\r\n"), content.data, orig_identity);
+
+	// content.data = ms_strdup_printf(_("%sLocalGroup: %s\r\n"), content.data, "TO_DO");
+	// content.data = ms_strdup_printf(_("%sRemoteGroup: %s\r\n"), content.data, "TO_DO");
+	content.data = ms_strdup_printf(_("%sLocalAddr: IP=%s PORT=%d SSRC=%d\r\n"), content.data, local_ip, local_port, local_ssrc);
+	// content.data = ms_strdup_printf(_("%sLocalMAC: %s\r\n"), content.data, "TO_DO");
+	content.data = ms_strdup_printf(_("%sRemoteAddr: IP=%s PORT=%d SSRC=%d\r\n"), content.data, remote_ip, remote_port, remote_ssrc);
+	// content.data = ms_strdup_printf(_("%sRemoteMAC: %s\r\n"), content.data, "TO_DO");
+	
+	content.data = ms_strdup_printf(_("%sLocalMetrics:\r\n"), content.data);
+	content.data = ms_strdup_printf(_("%sTimestamps: START=%s STOP=%s\r\n"), content.data, 
+		linphone_timestamp_to_rfc3339_string(call->log->start_date_time), 
+		linphone_timestamp_to_rfc3339_string(call->log->start_date_time + call->log->duration));
+	content.data = ms_strdup_printf(_("%sRemoteMetrics:\r\n"), content.data, "TO_DO");
+
+	content.data = ms_strdup_printf(_("%sRemoteMetrics:\r\n"), content.data, "TO_DO");
+	content.data = ms_strdup_printf(_("%sTimestamps: %s\r\n"), content.data, "TO_DO");
+	content.data = ms_strdup_printf(_("%sDialogID: %s\r\n"), content.data, "TO_DO");
+
+	content.size = strlen((char*)content.data);
+ 
+	addr = linphone_address_new("sip:collector@sip.linphone.org");
+
+	ms_message("packet content: %s", (char*)content.data);
+	linphone_core_publish(call->core, addr, "vq-rtcpxr", expires, &content);
+
+	linphone_address_destroy(addr);
+}
+
diff --git a/coreapi/quality_reporting.h b/coreapi/quality_reporting.h
new file mode 100644
index 0000000000000000000000000000000000000000..f56d2b1bd08202073d6a6099445909e780ffe8c1
--- /dev/null
+++ b/coreapi/quality_reporting.h
@@ -0,0 +1,34 @@
+/*
+linphone
+Copyright (C) 2014 - Belledonne Communications, Grenoble, France
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+*/
+
+#ifndef quality_reporting_h
+#define quality_reporting_h
+
+#include "linphonecore.h"
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+void linphone_quality_reporting_submit(LinphoneCall* call);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif