Re: [Asterisk-java-devel] org.asteriskjava.fastagi.internal.AgiReaderImpl doesn't haven't multiline
Brought to you by:
srt
From: Steve P. <sp...@ge...> - 2006-12-27 19:39:36
|
Stefan Reuter wrote: > Hi Steve, > > Steve Prior wrote: > >>The big thing stopping me from fixing this right now is that I don't >>know exactly what the format for a multi-line response to >>getFullVariable is defined to be. Anyone know what this is? > > > Can you point me to some documentation regarding Lumenvox so I can have > a look at what behavior it expects? > > =Stefan I don't have this documentation, but I don't think I'm actually asking for anything Lumenvox specific. It's more about how the AGI protocol works. Here's a bit of my asterisk log while running the normal pizza demo: -- Executing Set("IAX2/66.225.202.80:4569-4", "TOPPING=<item index=0> <toppinglist> <item index=0> <ingredient> onions </ingredient> </item> <item index=1> <ingredient> pepperoni </ingredient> </item> </toppinglist> </item> ") in new stack So as you can see the demo is setting the value of an asterisk variable to a value which spans lines (and happens to be an XML fragment, but I don't think you care about that). The problem appears when I try to call getFullVariable() on a variable which returns such a multiline value - the current implementation of AgiImpl only reads the first line which here is "TOPPING=<item index=0> and doesn't follow through and read the rest of the lines up to the following double quotes. Now I'm sure there is some complication in the AGI protocol as to how to handle escaped quotes (if they are allowed at all). So I think the solution is to modify AgiImpl to read the full set of lines for a response and not stop at one - up until it reads the close quote. Then I can simply get that multiline string to my java code, interpret the XML as I see fit, and should be all set. So multiline variable values has been a possibility all along, it's just never been encountered before now. Thanks Steve |