[sip-comm-dev] Re: svn commit: r7001 - trunk/src/net/java/sip/communicator/impl/protocol/sip


#1

Oh, that's a good idea!

Would be even better if we had a "Display Name" field in the advanced
tab of our SIP account wizard. Right above the authentication user name
would be great. This way users could enter something other than the user
part of their SIP URI in there.

Should be an easy hack. Any volunteers?

Emil

P.S. We could probably also implement a service whose implementations
would try to retrieve from the OS but this would be platform dependent
and hence trickier.

На 15.04.10 12:16, kpouer@dev.java.net написа:

···

Author: kpouer
Date: 2010-04-15 10:16:18+0000
New Revision: 7001

Modified:
   trunk/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java
   trunk/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java

Log:
add the display name of the service provider to the addressOfRecord of the registrar connection (so we have the display name in From headers when doing an INVITE)

Modified: trunk/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java?view=diff&rev=7001&p1=trunk/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java&p2=trunk/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java&r1=7000&r2=7001

--- trunk/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java (original)
+++ trunk/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java 2010-04-15 10:16:18+0000
@@ -422,6 +422,16 @@
             headerFactory = new HeaderFactoryImpl();
             addressFactory = new AddressFactoryImpl();

+ //initialize our display name
+ ourDisplayName = accountID.getAccountPropertyString(
+ ProtocolProviderFactory.DISPLAY_NAME);
+
+ if(ourDisplayName == null
+ || ourDisplayName.trim().length() == 0)
+ {
+ ourDisplayName = accountID.getUserID();
+ }
+
             //create a connection with the registrar
             initRegistrarConnection(accountID);

@@ -490,16 +500,6 @@
             //initialize our OPTIONS handler
             new ClientCapabilities(this);

- //initialize our display name
- ourDisplayName = accountID.getAccountPropertyString(
- ProtocolProviderFactory.DISPLAY_NAME);
-
- if(ourDisplayName == null
- || ourDisplayName.trim().length() == 0)
- {
- ourDisplayName = accountID.getUserID();
- }
-
             //init the security manager
             this.sipSecurityManager = new SipSecurityManager(accountID);
             sipSecurityManager.setHeaderFactory(headerFactory);

Modified: trunk/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java?view=diff&rev=7001&p1=trunk/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java&p2=trunk/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java&r1=7000&r2=7001

--- trunk/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java (original)
+++ trunk/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java 2010-04-15 10:16:18+0000
@@ -1044,13 +1044,14 @@
         if(sipUriHost == null)
             sipUriHost = getRegistrarAddress().getHostName();

- SipURI ourSipURI = null;
+ SipURI ourSipURI;
         try
         {
             ourSipURI = sipProvider.getAddressFactory().createSipURI(
                             ourUserID, sipUriHost);
             ourSipAddressOfRecord = sipProvider.getAddressFactory()
                 .createAddress(sipProvider.getOurDisplayName(), ourSipURI);
+ ourSipAddressOfRecord.setDisplayName(sipProvider.getOurDisplayName());
         }
         catch (ParseException ex)
         {

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: commits-help@sip-communicator.dev.java.net

--
Emil Ivov, Ph.D. 67000 Strasbourg,
Project Lead France
SIP Communicator
emcho@sip-communicator.org PHONE: +33.1.77.62.43.30
http://sip-communicator.org FAX: +33.1.77.62.47.31

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

That's good idea, I will try to do that

Matthieu

···

2010/4/15 Emil Ivov <emcho@sip-communicator.org>:

Oh, that's a good idea!

Would be even better if we had a "Display Name" field in the advanced
tab of our SIP account wizard. Right above the authentication user name
would be great. This way users could enter something other than the user
part of their SIP URI in there.

Should be an easy hack. Any volunteers?

Emil

P.S. We could probably also implement a service whose implementations
would try to retrieve from the OS but this would be platform dependent
and hence trickier.

На 15.04.10 12:16, kpouer@dev.java.net написа:

Author: kpouer
Date: 2010-04-15 10:16:18+0000
New Revision: 7001

Modified:
trunk/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java
trunk/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java

Log:
add the display name of the service provider to the addressOfRecord of the registrar connection (so we have the display name in From headers when doing an INVITE)

Modified: trunk/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java?view=diff&rev=7001&p1=trunk/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java&p2=trunk/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java&r1=7000&r2=7001

--- trunk/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java (original)
+++ trunk/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java 2010-04-15 10:16:18+0000
@@ -422,6 +422,16 @@
headerFactory = new HeaderFactoryImpl();
addressFactory = new AddressFactoryImpl();

+ //initialize our display name
+ ourDisplayName = accountID.getAccountPropertyString(
+ ProtocolProviderFactory.DISPLAY_NAME);
+
+ if(ourDisplayName == null
+ || ourDisplayName.trim().length() == 0)
+ {
+ ourDisplayName = accountID.getUserID();
+ }
+
//create a connection with the registrar
initRegistrarConnection(accountID);

@@ -490,16 +500,6 @@
//initialize our OPTIONS handler
new ClientCapabilities(this);

- //initialize our display name
- ourDisplayName = accountID.getAccountPropertyString(
- ProtocolProviderFactory.DISPLAY_NAME);
-
- if(ourDisplayName == null
- || ourDisplayName.trim().length() == 0)
- {
- ourDisplayName = accountID.getUserID();
- }
-
//init the security manager
this.sipSecurityManager = new SipSecurityManager(accountID);
sipSecurityManager.setHeaderFactory(headerFactory);

Modified: trunk/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java?view=diff&rev=7001&p1=trunk/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java&p2=trunk/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java&r1=7000&r2=7001

--- trunk/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java (original)
+++ trunk/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java 2010-04-15 10:16:18+0000
@@ -1044,13 +1044,14 @@
if(sipUriHost == null)
sipUriHost = getRegistrarAddress().getHostName();

- SipURI ourSipURI = null;
+ SipURI ourSipURI;
try
{
ourSipURI = sipProvider.getAddressFactory().createSipURI(
ourUserID, sipUriHost);
ourSipAddressOfRecord = sipProvider.getAddressFactory()
.createAddress(sipProvider.getOurDisplayName(), ourSipURI);
+ ourSipAddressOfRecord.setDisplayName(sipProvider.getOurDisplayName());
}
catch (ParseException ex)
{

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: commits-help@sip-communicator.dev.java.net

--
Emil Ivov, Ph.D. 67000 Strasbourg,
Project Lead France
SIP Communicator
emcho@sip-communicator.org PHONE: +33.1.77.62.43.30
http://sip-communicator.org FAX: +33.1.77.62.47.31

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net