From 527fdcbda6ea79d874ff13d5e38a341e71b6fe08 Mon Sep 17 00:00:00 2001
From: Simon Morlat <simon.morlat@linphone.org>
Date: Fri, 16 Jul 2010 15:31:17 +0200
Subject: [PATCH] add sip: when required to server address

---
 coreapi/proxy.c | 18 ++++++++----------
 mediastreamer2  |  2 +-
 oRTP            |  2 +-
 3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/coreapi/proxy.c b/coreapi/proxy.c
index 4d31f5071f..154ae06a26 100644
--- a/coreapi/proxy.c
+++ b/coreapi/proxy.c
@@ -90,22 +90,20 @@ bool_t linphone_proxy_config_is_registered(const LinphoneProxyConfig *obj){
  * - hostnames : sip:sip.example.net
 **/
 int linphone_proxy_config_set_server_addr(LinphoneProxyConfig *obj, const char *server_addr){
-	LinphoneAddress *addr;
-	char *try=NULL;
+	LinphoneAddress *addr=NULL;
+	char *modified=NULL;
 	
 	if (obj->reg_proxy!=NULL) ms_free(obj->reg_proxy);
 	obj->reg_proxy=NULL;
 	
 	if (server_addr!=NULL && strlen(server_addr)>0){
-		addr=linphone_address_new(server_addr);
-		if (!addr){
-			/*try to prepend 'sip:' */
-			if (strstr(server_addr,"sip:")==NULL){
-				try=ms_strdup_printf("sip:%s",server_addr);
-				addr=linphone_address_new(try);
-				ms_free(try);
-			}
+		if (strstr(server_addr,"sip:")==NULL){
+			modified=ms_strdup_printf("sip:%s",server_addr);
+			addr=linphone_address_new(modified);
+			ms_free(modified);
 		}
+		if (addr==NULL)
+			addr=linphone_address_new(server_addr);
 		if (addr){
 			obj->reg_proxy=linphone_address_as_string_uri_only(addr);
 			linphone_address_destroy(addr);
diff --git a/mediastreamer2 b/mediastreamer2
index 429baf423f..df9cac524b 160000
--- a/mediastreamer2
+++ b/mediastreamer2
@@ -1 +1 @@
-Subproject commit 429baf423f2db8673ffa98f7f7d6cbac0c23bde9
+Subproject commit df9cac524bbe77240127630fa5d253b19c8fdae7
diff --git a/oRTP b/oRTP
index d4868b6414..a8076d9487 160000
--- a/oRTP
+++ b/oRTP
@@ -1 +1 @@
-Subproject commit d4868b64141773b38ba6e8afe3a371fa57525b2b
+Subproject commit a8076d9487ee91d89df221256e0d3371e0fa3f50
-- 
GitLab