Re: [Asterisk-java-devel] Live and getVersion() issue
Brought to you by:
srt
From: Stefan R. <ste...@re...> - 2008-03-31 03:31:17
|
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. |