From e0e17c83f68e61a6c0648e726c621d3153472aa1 Mon Sep 17 00:00:00 2001
From: Alexandre Savard <alexandre.savard@savoirfairelinux.net>
Date: Wed, 7 Oct 2009 10:39:23 -0400
Subject: [PATCH] [#2274] Set display name for "Contact" sip header as the
 hostname

---
 sflphone-common/src/sip/sipaccount.cpp |  4 ++++
 sflphone-common/src/sip/sipaccount.h   | 16 ++++++++--------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/sflphone-common/src/sip/sipaccount.cpp b/sflphone-common/src/sip/sipaccount.cpp
index a0dcc76227..7f0e8843cc 100644
--- a/sflphone-common/src/sip/sipaccount.cpp
+++ b/sflphone-common/src/sip/sipaccount.cpp
@@ -514,6 +514,10 @@ std::string SIPAccount::getContactHeader (const std::string& address, const std:
         transport = "";
     }
 
+    _displayName = Manager::instance().getConfigString(_accountID, DISPLAY_NAME);
+
+    _debug("Display Name: %s\n", _displayName.c_str());
+
     int len = pj_ansi_snprintf (contact, PJSIP_MAX_URL_SIZE,
 
                                 "%s%s<%s%s%s%s%s%s:%d%s>",
diff --git a/sflphone-common/src/sip/sipaccount.h b/sflphone-common/src/sip/sipaccount.h
index 873647b2d5..8ad7451fb2 100644
--- a/sflphone-common/src/sip/sipaccount.h
+++ b/sflphone-common/src/sip/sipaccount.h
@@ -321,7 +321,7 @@ class SIPAccount : public Account
         
         pjsip_transport_type_e _transportType;
 
-		pjsip_transport* _transport;
+	pjsip_transport* _transport;
 
         // Special hack that is not here to stay
         // See #1852
@@ -337,19 +337,19 @@ class SIPAccount : public Account
         // a sip transport. 
         pjsip_tls_setting * _tlsSetting;	                                                  
 
-		// The STUN server name, if applicable
+        // The STUN server name, if applicable
         pj_str_t _stunServerName;	                                                  
 
-		// The STUN server port, if applicable
-		pj_uint16_t _stunPort;
+	// The STUN server port, if applicable
+	pj_uint16_t _stunPort;
         
         // Display Name that can be used in  SIP URI.        
         std::string _displayName;        
 
-		// The actual address we use in the SDP to be contacted
-		// it needs to be per account, otherwise the same address is used for every account
-		std::string _actualSessionAddress;
-		pj_uint16_t _actualSessionPort;
+	// The actual address we use in the SDP to be contacted
+	// it needs to be per account, otherwise the same address is used for every account
+	std::string _actualSessionAddress;
+        pj_uint16_t _actualSessionPort;
 };
 
 #endif
-- 
GitLab