diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c
index c1139e88cb0c5ce80a5189783848ffc330e6f837..f8ed10ce010e3a368d1add474270b1ceec1713b5 100644
--- a/coreapi/linphonecore.c
+++ b/coreapi/linphonecore.c
@@ -489,6 +489,8 @@ static void sip_config_read(LinphoneCore *lc)
 		sal_use_session_timers(lc->sal,200);
 	}
 
+	sal_use_rport(lc->sal,lp_config_get_int(lc->config,"sip","use_rport",1));
+
 	tmp=lp_config_get_int(lc->config,"sip","use_rfc2833",0);
 	linphone_core_set_use_rfc2833_for_dtmf(lc,tmp);
 
diff --git a/coreapi/sal.h b/coreapi/sal.h
index 5794427e4252e4c4c21913c0361d3d708a95b35b..c0b5f19b3f0d6d17fc8370906f1ff6b04cc9b960 100644
--- a/coreapi/sal.h
+++ b/coreapi/sal.h
@@ -262,6 +262,8 @@ unsigned int sal_get_keepalive_period(Sal *ctx);
 void sal_use_session_timers(Sal *ctx, int expires);
 void sal_use_double_registrations(Sal *ctx, bool_t enabled);
 void sal_use_one_matching_codec_policy(Sal *ctx, bool_t one_matching_codec);
+void sal_use_rport(Sal *ctx, bool_t use_rports);
+
 int sal_iterate(Sal *sal);
 MSList * sal_get_pending_auths(Sal *sal);
 
diff --git a/coreapi/sal_eXosip2.c b/coreapi/sal_eXosip2.c
index 1ab04b835934d79b03ec8aa1533376a77b3c0edc..1987285f908a5782d22da4deffcb4d9c57038cc6 100644
--- a/coreapi/sal_eXosip2.c
+++ b/coreapi/sal_eXosip2.c
@@ -273,6 +273,7 @@ Sal * sal_init(){
 	sal=ms_new0(Sal,1);
 	sal->keepalive_period=30;
 	sal->double_reg=TRUE;
+	sal->use_rports=TRUE;
 	return sal;
 }
 
@@ -366,6 +367,7 @@ int sal_listen_port(Sal *ctx, const char *addr, int port, SalTransport tr, int i
 	eXosip_set_option(13,&err); /*13=EXOSIP_OPT_SRV_WITH_NAPTR, as it is an enum value, we can't use it unless we are sure of the
 					version of eXosip, which is not the case*/
 	/*see if it looks like an IPv6 address*/
+	eXosip_set_option(EXOSIP_OPT_USE_RPORT,&ctx->use_rports);
 	ipv6=strchr(addr,':')!=NULL;
 	eXosip_enable_ipv6(ipv6);
 
@@ -411,6 +413,10 @@ void sal_use_double_registrations(Sal *ctx, bool_t enabled){
 	ctx->double_reg=enabled;
 }
 
+void sal_use_rport(Sal *ctx, bool_t use_rports){
+	ctx->use_rports=use_rports;
+}
+
 static int extract_received_rport(osip_message_t *msg, const char **received, int *rportval){
 	osip_via_t *via=NULL;
 	osip_generic_param_t *param=NULL;
diff --git a/coreapi/sal_eXosip2.h b/coreapi/sal_eXosip2.h
index d55263627b126be99d18c0f7993c7ff7994aef21..1f83a85ebb153119c9368f487a0e06ece9fce3ab 100644
--- a/coreapi/sal_eXosip2.h
+++ b/coreapi/sal_eXosip2.h
@@ -42,6 +42,7 @@ struct Sal{
 	void *up;
 	bool_t one_matching_codec;
 	bool_t double_reg;
+	bool_t use_rports;
 };
 
 struct SalOp{
diff --git a/coreapi/sal_eXosip2_presence.c b/coreapi/sal_eXosip2_presence.c
index 958e29463a687ade38d92fa43f0de24fdff1451a..4a18c4611bbe46b27c1d04b5cad44cc8f035fec3 100644
--- a/coreapi/sal_eXosip2_presence.c
+++ b/coreapi/sal_eXosip2_presence.c
@@ -136,7 +136,7 @@ int sal_subscribe_presence(SalOp *op, const char *from, const char *to){
 	eXosip_lock();
 	eXosip_subscribe_build_initial_request(&msg,sal_op_get_to(op),sal_op_get_from(op),
 	    	sal_op_get_route(op),"presence",600);
-	if (msg!=NULL){
+	if (msg==NULL){
 		ms_error("Could not build subscribe request to %s",to);
 		eXosip_unlock();
 		return -1;