[Asterisk-Dev] Fastman aka Flash-Astman + String Terminations
Steven Critchfield
critch at basesys.com
Sat Oct 18 09:43:46 MST 2003
On Sat, 2003-10-18 at 10:55, Tilghman Lesher wrote:
> On Saturday 18 October 2003 10:25, Brancaleoni Matteo wrote:
> > I'm trying to develop a Fastman, aka a sort of Gastman
> > but with Flash (so the name F-Astman). This because
> > we can have a lightweight, fast & nice gastman-alike
> > interface in a web browser, on any platform the flash
> > plugins runs on .
> > With flash is rather easy to build a such app, since
> > it has persistent tcp sockets, so a movie can connect
> > to the asterisk manager and do the work.
> >
> > I've got a preliminary test working... a little
> > app that logins on a ast manager, and display live
> > the events... very simple, just to test the connection
> > from flash <-> asterisk.
> >
> > Now the issue ;)
> > Flash wants that strings sent from the server have
> > a null char as EOL (is to say '\0'), or they don't get
> > detected. And of course * doesn't send '\0' and the end
> > of each string sent by the manager.
>
> This is a technical violation of most of the RFCs. Most protocols
> specify the "\r\n" combination as the line delimiter for network
> traffic. Requiring a NUL afterwards or instead of this delimiter makes
> this type of string handling unsuitable for most network applications.
>
> Since Flash is certainly able to deal with HTTP requests and responses
> (which don't embed NULs after every line), it makes me think that this
> NUL is not a requirement, but that there is a different method for
> network applications. You might want to look into that.
>
According to this web site,
http://www.dagblastit.com/java/sockets.html
It isn't needing a \0 at the end of every line, just at the end of each
message. The socket connection that Matteo is using is intended to pass
XML messages. Macromedia has chosen a \0 as a end of message terminator.
The idea being that they have just passed the entire C string from one
side to the other. I won't argue whether or not it is a good thing they
did this. For what they wanted it to do, it works.
As to this problem, Matteo, maybe you should see if it could be a
session variable that is set during the connection request/login. This
would make it possible for the config to be untouched and the app to
work just fine.
--
Steven Critchfield <critch at basesys.com>
More information about the asterisk-dev
mailing list