Thread: [Asterisk-java-devel] Live and getVersion() issue
Brought to you by:
srt
From: T. L. P. T. <tom...@gm...> - 2008-03-26 02:31:13
|
Hello: I'm developing some simple applications using Asterisk-Java and I came across with an issue while using the Live API. One of the methods of the AsteriskServer interface is getVersion(). This method has two signatures and if it's called without arguments, the method should return a String object with the version informed by Asterisk when a "show version" command is executed through a CommandAction. The string that's used along with the CommandAction object as a parameter of the constructor is "show version". This String is defined as a constant (private static final) at org.asteriskjava.live.internal.AsteriskServerImpl. This CLI command is valid for versions of Asterisk older than 1.6, but the next release of Asterisk will have the definition of this command deprecated; being necessary to use "core show version" instead. I tried to make a patch to solve this issue. My first approach was to determine the Asterisk version using the AsteriskVersion object defined at any ManagerConnection object, to execute the method isAtLeast(); and then use the correct show version command. But this field is protected and I can't access it from the AsteriskServer object. Should I fill a report in the JIRA bug tracker? Is there any way to access this object (AsteriskVersion) without modifying the interface of the ManagerConnection object? I still want to provide a patch :-) Thanks in advance. Best regards, Tomás. |
From: Stefan R. <ste...@re...> - 2008-03-26 03:08:37
Attachments:
signature.asc
|
Hi Thomas, We could add a getVersion() method to ManagerConnection that is public and returns an AsteriskVersion object. Feel free to provide a patch for that and update the implementation of AsteriskServer to work properly with 1.6. Open an issue in Jira and attach the patch and I'll integrate it. Thanks for your support, Stefan Tomás Laureano Peralta Tormey wrote: > Hello: > I'm developing some simple applications using Asterisk-Java and I > came across with an issue while using the Live API. > One of the methods of the AsteriskServer interface is getVersion(). > This method has two signatures and if it's called without arguments, > the method should return a String object with the version informed by > Asterisk when a "show version" command is executed through a > CommandAction. The string that's used along with the CommandAction > object as a parameter of the constructor is "show version". This > String is defined as a constant (private static final) at > org.asteriskjava.live.internal.AsteriskServerImpl. > This CLI command is valid for versions of Asterisk older than 1.6, > but the next release of Asterisk will have the definition of this > command deprecated; being necessary to use "core show version" > instead. > > I tried to make a patch to solve this issue. My first approach was to > determine the Asterisk version using the AsteriskVersion object > defined at any ManagerConnection object, to execute the method > isAtLeast(); and then use the correct show version command. But this > field is protected and I can't access it from the AsteriskServer > object. > > Should I fill a report in the JIRA bug tracker? Is there any way to > access this object (AsteriskVersion) without modifying the interface > of the ManagerConnection object? I still want to provide a patch :-) > > Thanks in advance. > > Best regards, Tomás. > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel -- reuter network consulting Neusser Str. 110 50760 Koeln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: ste...@re... Jabber: ste...@re... WWW: http://www.reucon.com Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
From: T. L. P. T. <tom...@gm...> - 2008-03-26 03:17:00
|
Stefan: Thank you for your quick and productive answer. I'm starting with Java and I have the feeling that modifying the interface to add a new method wasn't a good practice. I will provide the patch as soon as I can get it tested. Thank you again. Best regards, Tomás. On 3/26/08, Stefan Reuter <ste...@re...> wrote: > Hi Thomas, > > We could add a getVersion() method to ManagerConnection that is public > and returns an AsteriskVersion object. > Feel free to provide a patch for that and update the implementation of > AsteriskServer to work properly with 1.6. Open an issue in Jira and > attach the patch and I'll integrate it. > > Thanks for your support, > > Stefan > > Tomás Laureano Peralta Tormey wrote: > > Hello: > > I'm developing some simple applications using Asterisk-Java and I > > came across with an issue while using the Live API. > > One of the methods of the AsteriskServer interface is getVersion(). > > This method has two signatures and if it's called without arguments, > > the method should return a String object with the version informed by > > Asterisk when a "show version" command is executed through a > > CommandAction. The string that's used along with the CommandAction > > object as a parameter of the constructor is "show version". This > > String is defined as a constant (private static final) at > > org.asteriskjava.live.internal.AsteriskServerImpl. > > This CLI command is valid for versions of Asterisk older than 1.6, > > but the next release of Asterisk will have the definition of this > > command deprecated; being necessary to use "core show version" > > instead. > > > > I tried to make a patch to solve this issue. My first approach was to > > determine the Asterisk version using the AsteriskVersion object > > defined at any ManagerConnection object, to execute the method > > isAtLeast(); and then use the correct show version command. But this > > field is protected and I can't access it from the AsteriskServer > > object. > > > > Should I fill a report in the JIRA bug tracker? Is there any way to > > access this object (AsteriskVersion) without modifying the interface > > of the ManagerConnection object? I still want to provide a patch :-) > > > > Thanks in advance. > > > > Best regards, Tomás. > > > > ------------------------------------------------------------------------- > > Check out the new SourceForge.net Marketplace. > > It's the best place to buy or sell services for > > just about anything Open Source. > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > _______________________________________________ > > Asterisk-java-devel mailing list > > Ast...@li... > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > > > -- > reuter network consulting > Neusser Str. 110 > 50760 Koeln > Germany > Telefon: +49 221 1305699-0 > Telefax: +49 221 1305699-90 > E-Mail: ste...@re... > Jabber: ste...@re... > WWW: http://www.reucon.com > > Steuernummern 215/5140/1791 USt-IdNr. DE220701760 > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > > > |
From: Stefan R. <ste...@re...> - 2008-03-31 03:31:17
Attachments:
signature.asc
|
Tomás, did it work? Any help required? =Stefan Tomás Laureano Peralta Tormey wrote: > Stefan: > Thank you for your quick and productive answer. I'm starting with > Java and I have the feeling that modifying the interface to add a new > method wasn't a good practice. > I will provide the patch as soon as I can get it tested. > > Thank you again. > > Best regards, Tomás. > > On 3/26/08, Stefan Reuter <ste...@re...> wrote: >> Hi Thomas, >> >> We could add a getVersion() method to ManagerConnection that is public >> and returns an AsteriskVersion object. >> Feel free to provide a patch for that and update the implementation of >> AsteriskServer to work properly with 1.6. Open an issue in Jira and >> attach the patch and I'll integrate it. >> >> Thanks for your support, >> >> Stefan >> >> Tomás Laureano Peralta Tormey wrote: >>> Hello: >>> I'm developing some simple applications using Asterisk-Java and I >>> came across with an issue while using the Live API. >>> One of the methods of the AsteriskServer interface is getVersion(). >>> This method has two signatures and if it's called without arguments, >>> the method should return a String object with the version informed by >>> Asterisk when a "show version" command is executed through a >>> CommandAction. The string that's used along with the CommandAction >>> object as a parameter of the constructor is "show version". This >>> String is defined as a constant (private static final) at >>> org.asteriskjava.live.internal.AsteriskServerImpl. >>> This CLI command is valid for versions of Asterisk older than 1.6, >>> but the next release of Asterisk will have the definition of this >>> command deprecated; being necessary to use "core show version" >>> instead. >>> >>> I tried to make a patch to solve this issue. My first approach was to >>> determine the Asterisk version using the AsteriskVersion object >>> defined at any ManagerConnection object, to execute the method >>> isAtLeast(); and then use the correct show version command. But this >>> field is protected and I can't access it from the AsteriskServer >>> object. >>> >>> Should I fill a report in the JIRA bug tracker? Is there any way to >>> access this object (AsteriskVersion) without modifying the interface >>> of the ManagerConnection object? I still want to provide a patch :-) >>> >>> Thanks in advance. >>> >>> Best regards, Tomás. |
From: T. L. P. T. <tom...@gm...> - 2008-03-31 13:38:56
|
Stefan: I was busy the last days, but I made some tests with this patch on my lab environment. I think that I will have a patch ready in the next days. Thanks for your interest. Best regards, Tomás. On Mon, Mar 31, 2008 at 12:30 AM, Stefan Reuter <ste...@re...> wrote: > Tomás, > > did it work? Any help required? > > =Stefan > > > > Tomás Laureano Peralta Tormey wrote: > > Stefan: > > Thank you for your quick and productive answer. I'm starting with > > Java and I have the feeling that modifying the interface to add a new > > method wasn't a good practice. > > I will provide the patch as soon as I can get it tested. > > > > Thank you again. > > > > Best regards, Tomás. > > > > On 3/26/08, Stefan Reuter <ste...@re...> wrote: > >> Hi Thomas, > >> > >> We could add a getVersion() method to ManagerConnection that is public > >> and returns an AsteriskVersion object. > >> Feel free to provide a patch for that and update the implementation of > >> AsteriskServer to work properly with 1.6. Open an issue in Jira and > >> attach the patch and I'll integrate it. > >> > >> Thanks for your support, > >> > >> Stefan > >> > >> Tomás Laureano Peralta Tormey wrote: > >>> Hello: > >>> I'm developing some simple applications using Asterisk-Java and I > >>> came across with an issue while using the Live API. > >>> One of the methods of the AsteriskServer interface is getVersion(). > >>> This method has two signatures and if it's called without arguments, > >>> the method should return a String object with the version informed by > >>> Asterisk when a "show version" command is executed through a > >>> CommandAction. The string that's used along with the CommandAction > >>> object as a parameter of the constructor is "show version". This > >>> String is defined as a constant (private static final) at > >>> org.asteriskjava.live.internal.AsteriskServerImpl. > >>> This CLI command is valid for versions of Asterisk older than 1.6, > >>> but the next release of Asterisk will have the definition of this > >>> command deprecated; being necessary to use "core show version" > >>> instead. > >>> > >>> I tried to make a patch to solve this issue. My first approach was to > >>> determine the Asterisk version using the AsteriskVersion object > >>> defined at any ManagerConnection object, to execute the method > >>> isAtLeast(); and then use the correct show version command. But this > >>> field is protected and I can't access it from the AsteriskServer > >>> object. > >>> > >>> Should I fill a report in the JIRA bug tracker? Is there any way to > >>> access this object (AsteriskVersion) without modifying the interface > >>> of the ManagerConnection object? I still want to provide a patch :-) > >>> > >>> Thanks in advance. > >>> > >>> Best regards, Tomás. > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > > |
From: T. L. P. T. <tom...@gm...> - 2008-04-02 19:15:57
|
Developers: I have reported this issue in JIRA and uploaded a patch. The URL is: http://jira.reucon.com/browse/AJ-130 I have some doubts with my patch: * Is correct to define a new private static final String SHOW_VERSION_1_6_COMMAND? * The added private field Asterisk coreVersion, should be named this way or maybe something like branchReleaseVersion? * In the documentation of the new method getVersion of the Manager component, the 'since' field should be 1.0? Thanks in advance. Best regards, Tomás. On Mon, Mar 31, 2008 at 10:39 AM, Tomás Laureano Peralta Tormey < tom...@gm...> wrote: > Stefan: > I was busy the last days, but I made some tests with this patch on my > lab environment. I think that I will have a patch ready in the next > days. > Thanks for your interest. > > Best regards, Tomás. > > On Mon, Mar 31, 2008 at 12:30 AM, Stefan Reuter > <ste...@re...> wrote: > > Tomás, > > > > did it work? Any help required? > > > > =Stefan > > > > > > > > Tomás Laureano Peralta Tormey wrote: > > > Stefan: > > > Thank you for your quick and productive answer. I'm starting with > > > Java and I have the feeling that modifying the interface to add a new > > > method wasn't a good practice. > > > I will provide the patch as soon as I can get it tested. > > > > > > Thank you again. > > > > > > Best regards, Tomás. > > > > > > On 3/26/08, Stefan Reuter <ste...@re...> wrote: > > >> Hi Thomas, > > >> > > >> We could add a getVersion() method to ManagerConnection that is > public > > >> and returns an AsteriskVersion object. > > >> Feel free to provide a patch for that and update the implementation > of > > >> AsteriskServer to work properly with 1.6. Open an issue in Jira and > > >> attach the patch and I'll integrate it. > > >> > > >> Thanks for your support, > > >> > > >> Stefan > > >> > > >> Tomás Laureano Peralta Tormey wrote: > > >>> Hello: > > >>> I'm developing some simple applications using Asterisk-Java and I > > >>> came across with an issue while using the Live API. > > >>> One of the methods of the AsteriskServer interface is > getVersion(). > > >>> This method has two signatures and if it's called without > arguments, > > >>> the method should return a String object with the version informed > by > > >>> Asterisk when a "show version" command is executed through a > > >>> CommandAction. The string that's used along with the CommandAction > > >>> object as a parameter of the constructor is "show version". This > > >>> String is defined as a constant (private static final) at > > >>> org.asteriskjava.live.internal.AsteriskServerImpl. > > >>> This CLI command is valid for versions of Asterisk older than 1.6, > > >>> but the next release of Asterisk will have the definition of this > > >>> command deprecated; being necessary to use "core show version" > > >>> instead. > > >>> > > >>> I tried to make a patch to solve this issue. My first approach was > to > > >>> determine the Asterisk version using the AsteriskVersion object > > >>> defined at any ManagerConnection object, to execute the method > > >>> isAtLeast(); and then use the correct show version command. But > this > > >>> field is protected and I can't access it from the AsteriskServer > > >>> object. > > >>> > > >>> Should I fill a report in the JIRA bug tracker? Is there any way > to > > >>> access this object (AsteriskVersion) without modifying the > interface > > >>> of the ManagerConnection object? I still want to provide a patch > :-) > > >>> > > >>> Thanks in advance. > > >>> > > >>> Best regards, Tomás. > > > > > > > ------------------------------------------------------------------------- > > Check out the new SourceForge.net Marketplace. > > It's the best place to buy or sell services for > > just about anything Open Source. > > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > _______________________________________________ > > Asterisk-java-devel mailing list > > Ast...@li... > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > > > > > |
From: Stefan R. <ste...@re...> - 2008-04-05 06:38:28
Attachments:
signature.asc
|
Hi Thomas, > I have reported this issue in JIRA and uploaded a patch. The URL is: > http://jira.reucon.com/browse/AJ-1 Thanks for you patch, I've applied it to svn and resolved AJ-130 for 1.0.0. > * Is correct to define a new private static final String > SHOW_VERSION_1_6_COMMAND? Yep that's fine. > * The added private field Asterisk coreVersion, should be named this way > or maybe something like branchReleaseVersion? I don't think we need it at all since we can just get it from eventConnection.getVersion() and don't have to store it twice. For now I've removed it. > * In the documentation of the new method getVersion of the Manager > component, the 'since' field should be 1.0? In the future we will always use three digit version numbers so the version that will contain your fix is 1.0.0, hence @since 1.0.0. When referencing a static field/constant you should just use Class.FIELD, e.g. AsteriskVersion.ASTERISK_1_6 instead of someInstance.FIELD. =Stefan -- reuter network consulting Neusser Str. 110 50760 Koeln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: ste...@re... Jabber: ste...@re... WWW: http://www.reucon.com Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
From: T. L. P. T. <tom...@gm...> - 2008-04-05 18:53:01
|
Stefan: Thank you for your answers and the useful advices. Best regards, Tomás. On 4/5/08, Stefan Reuter <ste...@re...> wrote: > > Hi Thomas, > > > I have reported this issue in JIRA and uploaded a patch. The URL is: > > http://jira.reucon.com/browse/AJ-1 > > Thanks for you patch, I've applied it to svn and resolved AJ-130 for > 1.0.0. > > > * Is correct to define a new private static final String > > SHOW_VERSION_1_6_COMMAND? > > Yep that's fine. > > > * The added private field Asterisk coreVersion, should be named this way > > or maybe something like branchReleaseVersion? > > I don't think we need it at all since we can just get it from > eventConnection.getVersion() and don't have to store it twice. For now > I've removed it. > > > * In the documentation of the new method getVersion of the Manager > > component, the 'since' field should be 1.0? > > In the future we will always use three digit version numbers so the > version that will contain your fix is 1.0.0, hence @since 1.0.0. > > When referencing a static field/constant you should just use > Class.FIELD, e.g. AsteriskVersion.ASTERISK_1_6 instead of > someInstance.FIELD. > > =Stefan > > -- > reuter network consulting > Neusser Str. 110 > 50760 Koeln > Germany > Telefon: +49 221 1305699-0 > Telefax: +49 221 1305699-90 > E-Mail: ste...@re... > Jabber: ste...@re... > WWW: http://www.reucon.com > > Steuernummern 215/5140/1791 USt-IdNr. DE220701760 > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Register now and save $200. Hurry, offer ends at 11:59 p.m., > Monday, April 7! Use priority code J8TLD2. > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > > > |