[moving to sip-implementors, as this isn't really a spec issue]

> -----Original Message-----
> From: Gayraud, Richard [mailto:[EMAIL PROTECTED]]
> 
...
> However, I wonder if a SIP proxy really needs to 
> support NULL bytes in bodies ?

Yes. It does.

> In this case, a simple 
> proxy can't carry SIP messages with standard C strings 
> (and can't do some basic processing with libc).

I can't say that I understand the problem you're running
in to. The body of a SIP message might contain a wide variety
of binary data, such as a small JPEG, an ISUP message, etc.
These almost certainly *will* contain characters that you
can't just handle as normal strings (null in particular).

So, after you read the message headers, use the "content-length"
header to read the remaining message bytes into a buffer. Use
the "content-type" and "content-encoding" to determine how to
handle that buffer. In some cases, you'll be able to handle it as
plain text (e.g. SDP). In others, you'll need to handle it as
pure binary data. In the latter case, it's no different than
if you'd read the data off a disk somewhere: of *course* you
can't treat a JPEG as text; it makes no sense.

A SIP proxy (with rare exception) doesn't even need to go that
far. It can do whatever processing it needs to on the headers,
and store the body off in a buffer. It never looks at that
buffer. When you go to send the message out, just tack that
buffer back on the end. Your proxy (again, with rare exceptions)
should not care *what* the body contains.

/a

_______________________________________________
Sip-implementors mailing list
[EMAIL PROTECTED]
http://lists.cs.columbia.edu/mailman/listinfo/sip-implementors

Reply via email to