Re: [Asterisk-java-users] Re: Problem with ReplyBuilderImpl.java and
Brought to you by:
srt
From: Stefan R. <sr...@re...> - 2005-03-30 01:35:28
|
Hi Steve, On Tue, 2005-03-29 at 16:21 -0800, Steve Drach wrote: > I've looked at it a little bit more and I now understand that "result" > is the part of the > string after "result=" in the reply, so the code as it stands is > correct. I fixed the javadoc for getResult to make this more obvious - the old comment was in fact a bit short :) > The problem > I'm facing is there is no way to get the raw reply string out of > AGIReply, and that is > what I need to duplicate the functionality of fastagi-test. I see two > solutions to this: > (1) save the raw reply first line in a new attribute in AGIReply, or > (2) change the > toString method to produce a canonical raw first line, or some > combination of both. What do you exactly need the raw reply for? When looking at the fastagi-test script supplied with asterisk the checkresult subroutine checks the status code and the result. All parts of the reply are available in AGIReply, so these two checks could be implemented using getStatusCode() == SC_SUCCESS and checking for getResult() to be a String representation of an Integer. The raw reply string is only printed in case of a failure. If it is a real requirement to have the raw reply available I can easily add it as you suggested but as the purpose of asterisk-java is to hide the raw protocol from the Java developer I am not sure it really makes much sense. What do you think? =Stefan |