[jitsi-dev] Re: [jitsi~svn:9907] Add computername provisioning property


#1

Nice! Thanks Ingo!

Just a very minor comment: could we please change the name to "hostname"
so that we would be more in line with cross platform naming?

Emil

···

On 28.09.12, 05:42, ibauersachs@java.net wrote:

Project: jitsi
Repository: svn
Revision: 9907
Author: ibauersachs
Date: 2012-09-28 03:42:29 UTC
Link:

Log Message:
------------
Add computername provisioning property

Revisions:
----------
9907

Modified Paths:
---------------
trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceImpl.java

Diffs:
------
Index: trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceImpl.java

--- trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceImpl.java (revision 9906)
+++ trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceImpl.java (revision 9907)
@@ -311,6 +311,21 @@
                 url = url.replace("${ipaddr}", ipaddr.getHostAddress());
             }

+ if(url.indexOf("\{computername\}"\) \!= \-1\) \+ \{ \+ String name; \+ if\(OSUtils\.IS\_WINDOWS\) \+ \{ \+ // avoid reverse DNS lookup \+ name = System\.getenv\("COMPUTERNAME"\); \+ \} \+ else \+ \{ \+ name = ipaddr\.getHostName\(\); \+ \} \+ url = url\.replace\("{computername}", name);
+ }
+
             if(url.indexOf("${hwaddr}") != -1)
             {
                 if(ipaddr != null)


#2

Sure, done with c9911.

Ingo

···

-----Original Message-----
From: Emil Ivov [mailto:emcho@jitsi.org]
Sent: Freitag, 28. September 2012 10:24
To: Jitsi Developers
Subject: [jitsi-dev] Re: [jitsi~svn:9907] Add computername provisioning
property
Nice! Thanks Ingo!

Just a very minor comment: could we please change the name to "hostname"
so that we would be more in line with cross platform naming?

Emil

On 28.09.12, 05:42, ibauersachs@java.net wrote:

Project: jitsi
Repository: svn
Revision: 9907
Author: ibauersachs
Date: 2012-09-28 03:42:29 UTC
Link:

Log Message:
------------
Add computername provisioning property

Revisions:
----------
9907

Modified Paths:
---------------

trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceIm
pl.java

Diffs:
------
Index:

trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceIm
pl.java

===================================================================
---

trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceIm
pl.java (revision 9906)

+++

trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceIm
pl.java (revision 9907)

@@ -311,6 +311,21 @@
                 url = url.replace("${ipaddr}", ipaddr.getHostAddress());
             }
+ if(url.indexOf("${computername}") != -1)
+ {
+ String name;
+ if(OSUtils.IS_WINDOWS)
+ {
+ // avoid reverse DNS lookup
+ name = System.getenv("COMPUTERNAME");
+ }
+ else
+ {
+ name = ipaddr.getHostName();
+ }
+ url = url.replace("${computername}", name);
+ }
+
             if(url.indexOf("${hwaddr}") != -1)
             {
                 if(ipaddr != null)


#3

Hi,

It's very useful to get the host name for provisioning. Thanks.

THe following JIRA ticket is still open though:
http://java.net/jira/browse/JITSI-1037

The advantage of this patch is that you can get whatever system variable you need, including host name.

In any case, you might want to close the JIRA feature request since it's quite old now.

Thanks,

Vieri

···

--- On Fri, 9/28/12, Ingo Bauersachs <ingo@jitsi.org> wrote:

Sure, done with c9911.

Ingo

> -----Original Message-----
> From: Emil Ivov [mailto:emcho@jitsi.org]
> Sent: Freitag, 28. September 2012 10:24
> To: Jitsi Developers
> Subject: [jitsi-dev] Re: [jitsi~svn:9907] Add
computername provisioning
> property
> Nice! Thanks Ingo!
>
> Just a very minor comment: could we please change the
name to "hostname"
> so that we would be more in line with cross platform
naming?
>
> Emil
>
> On 28.09.12, 05:42, ibauersachs@java.net > wrote:
>> Project: jitsi
>> Repository: svn
>> Revision: 9907
>> Author: ibauersachs
>> Date: 2012-09-28
03:42:29 UTC
>> Link:
>>
>> Log Message:
>> ------------
>> Add computername provisioning property
>>
>>
>> Revisions:
>> ----------
>> 9907
>>
>>
>> Modified Paths:
>> ---------------
>>
>
trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceIm
> pl.java
>>
>>
>> Diffs:
>> ------
>> Index:
>
trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceIm
> pl.java
>>

>> ---
>
trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceIm
> pl.java (revision 9906)
>> +++
>
trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceIm
> pl.java (revision 9907)
>> @@ -311,6 +311,21 @@
>>
url = url.replace("${ipaddr}",
ipaddr.getHostAddress());
>> }
>> +
if(url.indexOf("${computername}") != -1)
>> + {
>> +
String name;
>> +
if(OSUtils.IS_WINDOWS)
>> +
{
>> +
// avoid reverse DNS lookup
>> +
name = System.getenv("COMPUTERNAME");
>> +
}
>> +
else
>> +
{
>> +
name = ipaddr.getHostName();
>> +
}
>> +
url = url.replace("${computername}", name);
>> + }
>> +
>>
if(url.indexOf("${hwaddr}") != -1)
>> {
>>
if(ipaddr != null)
>>
>>
>>


#4

Hey Vieri

Thanks for the reminder!
I applied a modified version of your patch that uses regular expressions.
Could you (or Emil) please close the issue JITSI-1037 if you're satisfied
with the implementation?

Regards,
Ingo

From: Vieri [mailto:rentorbuy@yahoo.com]
Sent: Samstag, 29. September 2012 04:58
To: dev@jitsi.java.net
Subject: [jitsi-dev] Re: [jitsi~svn:9907] Add computername provisioning
property

Hi,

It's very useful to get the host name for provisioning. Thanks.

THe following JIRA ticket is still open though:
http://java.net/jira/browse/JITSI-1037

The advantage of this patch is that you can get whatever system variable

you

need, including host name.

In any case, you might want to close the JIRA feature request since it's
quite old now.

Thanks,

Vieri

> Sure, done with c9911.
>
> Ingo
>
> > From: Emil Ivov [mailto:emcho@jitsi.org]
> > Sent: Freitag, 28. September 2012 10:24
> > To: Jitsi Developers
> > Subject: [jitsi-dev] Re: [jitsi~svn:9907] Add
> computername provisioning
> > property
> > Nice! Thanks Ingo!
> >
> > Just a very minor comment: could we please change the
> name to "hostname"
> > so that we would be more in line with cross platform
> naming?
> >
> > Emil
> >
> >> Project: jitsi
> >> Repository: svn
> >> Revision: 9907
> >> Author: ibauersachs
> >> Date: 2012-09-28
> 03:42:29 UTC
> >> Link:
> >>
> >> Log Message:
> >> ------------
> >> Add computername provisioning property
> >>
> >>
> >> Revisions:
> >> ----------
> >> 9907
> >>
> >>
> >> Modified Paths:
> >> ---------------
> >>
> >
>

trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceI
m

> > pl.java
> >>
> >>
> >> Diffs:
> >> ------
> >> Index:
> >
>

trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceI
m

> > pl.java
> >>
> ===================================================================
> >> ---
> >
>

trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceI
m

> > pl.java (revision 9906)
> >> +++
> >
>

trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceI
m

···

-----Original Message-----
--- On Fri, 9/28/12, Ingo Bauersachs <ingo@jitsi.org> wrote:
> > -----Original Message-----
> > On 28.09.12, 05:42, ibauersachs@java.net > > wrote:
> > pl.java (revision 9907)
> >> @@ -311,6 +311,21 @@
> >>
> url = url.replace("${ipaddr}",
> ipaddr.getHostAddress());
> >> }
> >> +
> if(url.indexOf("${computername}") != -1)
> >> + {
> >> +
> String name;
> >> +
> if(OSUtils.IS_WINDOWS)
> >> +
> {
> >> +
> // avoid reverse DNS lookup
> >> +
> name = System.getenv("COMPUTERNAME");
> >> +
> }
> >> +
> else
> >> +
> {
> >> +
> name = ipaddr.getHostName();
> >> +
> }
> >> +
> url = url.replace("${computername}", name);
> >> + }
> >> +
> >>
> if(url.indexOf("${hwaddr}") != -1)
> >> {
> >>
> if(ipaddr != null)
> >>
> >>
> >>
>
>


#5

I'll leave that to Emil :wink:

Thanks Ingo!

···

--- On Sat, 9/29/12, Ingo Bauersachs <ingo@jitsi.org> wrote:

Hey Vieri

Thanks for the reminder!
I applied a modified version of your patch that uses regular
expressions.
Could you (or Emil) please close the issue JITSI-1037 if
you're satisfied
with the implementation?

Regards,
Ingo

> -----Original Message-----
> From: Vieri [mailto:rentorbuy@yahoo.com]
> Sent: Samstag, 29. September 2012 04:58
> To: dev@jitsi.java.net
> Subject: [jitsi-dev] Re: [jitsi~svn:9907] Add
computername provisioning
> property
>
> Hi,
>
> It's very useful to get the host name for provisioning.
Thanks.
>
> THe following JIRA ticket is still open though:
> http://java.net/jira/browse/JITSI-1037
>
> The advantage of this patch is that you can get
whatever system variable
you
> need, including host name.
>
> In any case, you might want to close the JIRA feature
request since it's
> quite old now.
>
> Thanks,
>
> Vieri
>
> --- On Fri, 9/28/12, Ingo Bauersachs <ingo@jitsi.org> > wrote:
>
> > Sure, done with c9911.
> >
> > Ingo
> >
> > > -----Original Message-----
> > > From: Emil Ivov [mailto:emcho@jitsi.org]
> > > Sent: Freitag, 28. September 2012 10:24
> > > To: Jitsi Developers
> > > Subject: [jitsi-dev] Re: [jitsi~svn:9907]
Add
> > computername provisioning
> > > property
> > > Nice! Thanks Ingo!
> > >
> > > Just a very minor comment: could we please
change the
> > name to "hostname"
> > > so that we would be more in line with cross
platform
> > naming?
> > >
> > > Emil
> > >
> > > On 28.09.12, 05:42, ibauersachs@java.net > > > wrote:
> > >> Project: jitsi
> > >> Repository: svn
> > >> Revision: 9907
> > >> Author: ibauersachs
> > >> Date: 2012-09-28
> > 03:42:29 UTC
> > >> Link:
> > >>
> > >> Log Message:
> > >> ------------
> > >> Add computername provisioning property
> > >>
> > >>
> > >> Revisions:
> > >> ----------
> > >> 9907
> > >>
> > >>
> > >> Modified Paths:
> > >> ---------------
> > >>
> > >
> >
>
trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceI
m
> > > pl.java
> > >>
> > >>
> > >> Diffs:
> > >> ------
> > >> Index:
> > >
> >
>
trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceI
m
> > > pl.java
> > >>
> >

> > >> ---
> > >
> >
>
trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceI
m
> > > pl.java (revision 9906)
> > >> +++
> > >
> >
>
trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceI
m
> > > pl.java (revision 9907)
> > >> @@ -311,6 +311,21 @@
> > >>
> > url = url.replace("${ipaddr}",
> > ipaddr.getHostAddress());
> > >> }
> > >> +
> > if(url.indexOf("${computername}") != -1)
> > >> + {
> > >> +
> > String name;
> > >> +
> > if(OSUtils.IS_WINDOWS)
> > >> +
> > {
> > >> +
> > // avoid reverse DNS lookup
> > >> +
> > name = System.getenv("COMPUTERNAME");
> > >> +
> > }
> > >> +
> > else
> > >> +
> > {
> > >> +
> > name = ipaddr.getHostName();
> > >> +
> > }
> > >> +
> > url = url.replace("${computername}", name);
> > >> + }
> > >> +
> > >>
> > if(url.indexOf("${hwaddr}") != -1)
> > >> {
> > >>
> > if(ipaddr != null)
> > >>
> > >>
> > >>
> >
> >


#6

Thanks Ingo,

I've acked Vieri's contrib on https://jitsi.org/team and I've also added
the lines in the provisioning manual on https://jitsi.org/provisioning.
Please let me know if you think I've missed something.

Cheers,
Emil

···

On 30.09.12, 03:37, Ingo Bauersachs wrote:

Hey Vieri

Thanks for the reminder!
I applied a modified version of your patch that uses regular expressions.
Could you (or Emil) please close the issue JITSI-1037 if you're satisfied
with the implementation?

Regards,
Ingo

-----Original Message-----
From: Vieri [mailto:rentorbuy@yahoo.com]
Sent: Samstag, 29. September 2012 04:58
To: dev@jitsi.java.net
Subject: [jitsi-dev] Re: [jitsi~svn:9907] Add computername provisioning
property

Hi,

It's very useful to get the host name for provisioning. Thanks.

THe following JIRA ticket is still open though:
http://java.net/jira/browse/JITSI-1037

The advantage of this patch is that you can get whatever system variable

you

need, including host name.

In any case, you might want to close the JIRA feature request since it's
quite old now.

Thanks,

Vieri

--- On Fri, 9/28/12, Ingo Bauersachs <ingo@jitsi.org> wrote:

Sure, done with c9911.

Ingo

-----Original Message-----
From: Emil Ivov [mailto:emcho@jitsi.org]
Sent: Freitag, 28. September 2012 10:24
To: Jitsi Developers
Subject: [jitsi-dev] Re: [jitsi~svn:9907] Add

computername provisioning

property
Nice! Thanks Ingo!

Just a very minor comment: could we please change the

name to "hostname"

so that we would be more in line with cross platform

naming?

Emil

On 28.09.12, 05:42, ibauersachs@java.net >>> wrote:

Project: jitsi
Repository: svn
Revision: 9907
Author: ibauersachs
Date: 2012-09-28

03:42:29 UTC

Link:

Log Message:
------------
Add computername provisioning property

Revisions:
----------
9907

Modified Paths:
---------------

trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceI
m

pl.java

Diffs:
------
Index:

trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceI
m

pl.java

===================================================================

---

trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceI
m

pl.java (revision 9906)

+++

trunk/src/net/java/sip/communicator/plugin/provisioning/ProvisioningServiceI
m

pl.java (revision 9907)

@@ -311,6 +311,21 @@

    url = url.replace("${ipaddr}",
ipaddr.getHostAddress());

              }
+

if(url.indexOf("${computername}") != -1)

+ {
+

  String name;

+

  if(OSUtils.IS_WINDOWS)

+

  {

+

      // avoid reverse DNS lookup

+

      name = System.getenv("COMPUTERNAME");

+

  }

+

  else

+

  {

+

      name = ipaddr.getHostName();

+

  }

+

  url = url.replace("${computername}", name);

+ }
+

if(url.indexOf("${hwaddr}") != -1)

              {

    if(ipaddr != null)

--
Emil Ivov, Ph.D. 67000 Strasbourg,
Project Lead France
Jitsi
emcho@jitsi.org PHONE: +33.1.77.62.43.30
https://jitsi.org FAX: +33.1.77.62.47.31