You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Johny Kadarisman <jk...@gmail.com> on 2008/05/29 17:05:03 UTC
ByteBuffer Anomaly??
Hi, I found anomaly, that yet to find what went wrong on these ByteBuffer?
I'm trying to decode a specific switch protocol, that based on
content-length information. So following is from my decoder class that
trying to search the length from 'in' buffer.
Attached is the log output from last run, here you can before doing
anything, The buffer dump show content-length of "1619". Then I continue
with logic to parse this into integer, with in.get(i) methods. But, from
this methods, it return '3284'. Which, I believe from previous buffer. Now,
At the end of these routines, I dump again this 'in' bytebuffer. This time,
it still showing the content-length of '1619'. After this, the subsequent
protocol parsing is getting screw, since the length is not chop properly.
This symptom occurs on high load messages from the server, during low load,
everything seems fine.
Anybody encounter similar problem? your hints is appreciated.
Thanks,
Johny K.
================================================================
private int getContentLength(ByteBuffer in, int last) {
String str = getBufferString(in); // in.getHexDump();
logger.debug("last = "+last);
logger.debug("***** Buffer in getContentLength 1 *****\n"+str);
for (int i = 0; i < last; i++) {
boolean found = false;
for (int j = 0; j < CONTENT_LENGTH.length; j++) {
if (in.get(i + j) != CONTENT_LENGTH[j]) {
found = false;
break;
}
found = true;
}
if (found) {
// retrieve value from this position till next 0x0D 0x0A
logger.debug("Found content-length index at "+i);
StringBuilder contentLength = new StringBuilder();
for (int j = i + CONTENT_LENGTH.length; j < last; j++) {
if (in.get(j) == 0x0A)
break;
contentLength.append(new String( new byte[] { in.get(j)
}));
logger.debug("["+new String( new byte[]
{in.get(j)})+"]");
}
// if content-length worth of data has been received then
the message is complete
str = getBufferString(in); // in.getHexDump();
logger.debug("***** Buffer in getContentLength 2
*****\n"+str);
logger.debug("ContentLength = "+contentLength);
logger.debug("total buffer length = "+in.remaining());
return Integer.parseInt(contentLength.toString().trim());
}
}
return -1;
}
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 1 *****
Content-Length: 1619
Content-Type: text/event-plain
Channel-State: CS_NEW
Channel-State-Number: 0
Channel-Name: sofia/external/nobody%40192.168.3.12
Unique-ID: fd2229c0-2d6c-11dd-9acd-0b28d09a52aa
Call-Direction: inbound
Answer-State: ringing
variable_sip_from_user: nobody
variable_sip_from_uri: nobody%40192.168.3.12
variable_sip_from_host: 192.168.3.12
variable_sip_from_tag: 02H917ryecvgp
variable_sofia_profile_name: external
variable_sofia_profile_domain_name: external
variable_sip_req_user: 6001
variable_sip_req_port: 5080
variable_sip_req_uri: 6001%40192.168.3.11%3A5080
variable_sip_req_host: 192.168.3.11
variable_sip_to_user: 6001
variable_sip_to_port: 5080
variable_sip_to_uri: 6001%40192.168.3.11%3A5080
variable_sip_to_host: 192.168.3.11
variable_sip_contact_user: mod_sofia
variable_sip_contact_port: 5060
variable_sip_contact_uri: mod_sofia%40192.168.3.12%3A5060
variable_sip_contact_host: 192.168.3.12
variable_channel_name: sofia/external/nobody%40192.168.3.12
variable_endpoint_disposition: INBOUND%20CALL
variable_sip_call_id: 824f7531-a82e-122b-8485-000f1f644b48
variable_sip_user_agent: FreeSWITCH-mod_sofia/1.0.pre4-8539
variable_sip_via_host: 192.168.3.12
variable_sip_via_rport: 5060
variable_max_forwards: 70
Event-Name: CHANNEL_CREATE
Core-UUID: ed9888ba-2c94-11dd-
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - Found
content-length index at 0
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [ ]
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [3]
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [2]
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [8]
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [4]
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 2 *****
Content-Length: 1619
Content-Type: text/event-plain
Channel-State: CS_NEW
Channel-State-Number: 0
Channel-Name: sofia/external/nobody%40192.168.3.12
Unique-ID: fd2229c0-2d6c-11dd-9acd-0b28d09a52aa
Call-Direction: inbound
Answer-State: ringing
variable_sip_from_user: nobody
variable_sip_from_uri: nobody%40192.168.3.12
variable_sip_from_host: 192.168.3.12
variable_sip_from_tag: 02H917ryecvgp
variable_sofia_profile_name: external
variable_sofia_profile_domain_name: external
variable_sip_req_user: 6001
variable_sip_req_port: 5080
variable_sip_req_uri: 6001%40192.168.3.11%3A5080
variable_sip_req_host: 192.168.3.11
variable_sip_to_user: 6001
variable_sip_to_port: 5080
variable_sip_to_uri: 6001%40192.168.3.11%3A5080
variable_sip_to_host: 192.168.3.11
variable_sip_contact_user: mod_sofia
variable_sip_contact_port: 5060
variable_sip_contact_uri: mod_sofia%40192.168.3.12%3A5060
variable_sip_contact_host: 192.168.3.12
variable_channel_name: sofia/external/nobody%40192.168.3.12
variable_endpoint_disposition: INBOUND%20CALL
variable_sip_call_id: 824f7531-a82e-122b-8485-000f1f644b48
variable_sip_user_agent: FreeSWITCH-mod_sofia/1.0.pre4-8539
variable_sip_via_host: 192.168.3.12
variable_sip_via_rport: 5060
variable_max_forwards: 70
Event-Name: CHANNEL_CREATE
Core-UUID: ed9888ba-2c94-11dd-
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - ContentLength
= 3284
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - total buffer
length = 1295
Re: ByteBuffer Anomaly??
Posted by Emmanuel Lecharny <el...@apache.org>.
Johny Kadarisman wrote:
> Thanks Steve, I finally found the solutions of my problem. I miss understood
> the bytebuffer behaviour.
> I try to mimic the http example, since the protocol i'm working is similar
> to it. But the problem in my case, the session is not terminate on each
> request. So, In certain cases, Mina call decodable methods with bytebuffer
> contained previous request. In the example, It check the http methods using
> absolute methods. Which lead me to the assumption that, buffer will always
> contain a new bytes. Which is wrong. After I change all the buffer related
> access to relative mode. Now, everything working good.
>
Yeah, this is quite a common error. The fact is that ByteBuffers are
used as if they contain the data ready to be processed by the user's
codec. This was somehow leading to mistakes, up to a point we started
thinking about removing completely the ByteBuffer/IoBuffer class to
replace it by an InputStream (sort of).
Buffers are generally speaking intended to store temporary data while
they are copied from one layer to another. We used them with a modified
semantic ad it was far from perfect. For instance, in order to offer
extended functionalities like extended buffers ( ByteBuffers which size
can be increased as we receive new bytes) we had to rewrite a complete
proxy on top of the NIO byteBuffer. At the end of the day, it
represented something like 20% of the code base.
2.0 should be much more easier to use.
Thanks !
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
Re: ByteBuffer Anomaly??
Posted by Johny Kadarisman <jk...@gmail.com>.
Thanks Steve, I finally found the solutions of my problem. I miss understood
the bytebuffer behaviour.
I try to mimic the http example, since the protocol i'm working is similar
to it. But the problem in my case, the session is not terminate on each
request. So, In certain cases, Mina call decodable methods with bytebuffer
contained previous request. In the example, It check the http methods using
absolute methods. Which lead me to the assumption that, buffer will always
contain a new bytes. Which is wrong. After I change all the buffer related
access to relative mode. Now, everything working good.
Thanks, Rgds,
Johny K.
On Mon, Jun 2, 2008 at 3:29 AM, Steve Ulrich <st...@proemion.com>
wrote:
> Hi!
>
> Did you made sure, you read previous the message completely from the
> ByteBuffer? The part you don't read at the *decode* method is passed to the
> decodable (and decode) method again.
> So if a message is 5 bytes and you read up to the 4th byte in you
> decode-process, than the 5th byte is the first one at the next call of
> decodable. You just have to do a byteBuffer.get() oder
> byteBuffer.position(byteBuffer.position+1) at the end of your decode method,
> to consume that byte.
>
> hth & regards
>
> Steve
>
> > Johny Kadarisman [mailto:jkr888@gmail.com] wrote:
> >
> > Emannuel,
> >
> > I think I found the problem. The decodable() methods doesn't receive a
> > clean
> > bytebuffer (or with a left over unused byte from previous decoder) even
> > after I successfully decode the message.
> >
> > Which module is actually responsible to call compact() method on the
> > bytebuffer?
> >
> >
> > On Fri, May 30, 2008 at 9:47 AM, Emmanuel Lecharny
> > <el...@apache.org>
> > wrote:
> >
> > > Johny Kadarisman wrote:
> > >
> > >> I run for standalone, its correct. Any changes from my previous
> > code?
> > >>
> > >>
> > >
> > > I replaced the debug calls by System.out, removed the response object
> > > (didn't had the code for it), used a HashMap to store parameters, and
> > that's
> > > it.
> > >
> > > One more point : doing str.getBytes() is not good. Depending on your
> > local
> > > default String encoding, you may have a totally different result from
> > one
> > > machine to another one. You should do getBytes( encoding ) where
> > encoding is
> > > the encoding used for your string. In your case, "UTF-8" should be
> > ok.
> > >
> > >
> > >
> > > --
> > > --
> > > cordialement, regards,
> > > Emmanuel Lécharny
> > > www.iktek.com
> > > directory.apache.org
> > >
> > >
> > >
>
AW: ByteBuffer Anomaly??
Posted by Steve Ulrich <st...@proemion.com>.
Hi!
Did you made sure, you read previous the message completely from the ByteBuffer? The part you don't read at the *decode* method is passed to the decodable (and decode) method again.
So if a message is 5 bytes and you read up to the 4th byte in you decode-process, than the 5th byte is the first one at the next call of decodable. You just have to do a byteBuffer.get() oder byteBuffer.position(byteBuffer.position+1) at the end of your decode method, to consume that byte.
hth & regards
Steve
> Johny Kadarisman [mailto:jkr888@gmail.com] wrote:
>
> Emannuel,
>
> I think I found the problem. The decodable() methods doesn't receive a
> clean
> bytebuffer (or with a left over unused byte from previous decoder) even
> after I successfully decode the message.
>
> Which module is actually responsible to call compact() method on the
> bytebuffer?
>
>
> On Fri, May 30, 2008 at 9:47 AM, Emmanuel Lecharny
> <el...@apache.org>
> wrote:
>
> > Johny Kadarisman wrote:
> >
> >> I run for standalone, its correct. Any changes from my previous
> code?
> >>
> >>
> >
> > I replaced the debug calls by System.out, removed the response object
> > (didn't had the code for it), used a HashMap to store parameters, and
> that's
> > it.
> >
> > One more point : doing str.getBytes() is not good. Depending on your
> local
> > default String encoding, you may have a totally different result from
> one
> > machine to another one. You should do getBytes( encoding ) where
> encoding is
> > the encoding used for your string. In your case, "UTF-8" should be
> ok.
> >
> >
> >
> > --
> > --
> > cordialement, regards,
> > Emmanuel Lécharny
> > www.iktek.com
> > directory.apache.org
> >
> >
> >
Re: ByteBuffer Anomaly??
Posted by Johny Kadarisman <jk...@gmail.com>.
Emannuel,
I think I found the problem. The decodable() methods doesn't receive a clean
bytebuffer (or with a left over unused byte from previous decoder) even
after I successfully decode the message.
Which module is actually responsible to call compact() method on the
bytebuffer?
On Fri, May 30, 2008 at 9:47 AM, Emmanuel Lecharny <el...@apache.org>
wrote:
> Johny Kadarisman wrote:
>
>> I run for standalone, its correct. Any changes from my previous code?
>>
>>
>
> I replaced the debug calls by System.out, removed the response object
> (didn't had the code for it), used a HashMap to store parameters, and that's
> it.
>
> One more point : doing str.getBytes() is not good. Depending on your local
> default String encoding, you may have a totally different result from one
> machine to another one. You should do getBytes( encoding ) where encoding is
> the encoding used for your string. In your case, "UTF-8" should be ok.
>
>
>
> --
> --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
>
>
>
Re: ByteBuffer Anomaly??
Posted by Emmanuel Lecharny <el...@apache.org>.
Johny Kadarisman wrote:
> I run for standalone, its correct. Any changes from my previous code?
>
I replaced the debug calls by System.out, removed the response object
(didn't had the code for it), used a HashMap to store parameters, and
that's it.
One more point : doing str.getBytes() is not good. Depending on your
local default String encoding, you may have a totally different result
from one machine to another one. You should do getBytes( encoding )
where encoding is the encoding used for your string. In your case,
"UTF-8" should be ok.
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
Re: ByteBuffer Anomaly??
Posted by Johny Kadarisman <jk...@gmail.com>.
I run for standalone, its correct. Any changes from my previous code?
On Fri, May 30, 2008 at 9:11 AM, Emmanuel Lecharny <el...@apache.org>
wrote:
> Hi,
>
> I have ported your code on a standalone class to test it :
>
>
> import java.io.BufferedReader;
> import java.io.IOException;
> import java.io.Reader;
> import java.io.StringReader;
> import java.nio.charset.CharacterCodingException;
> import java.nio.charset.Charset;
> import java.nio.charset.CharsetDecoder;
> import java.util.HashMap;
> import java.util.HashSet;
> import java.util.Map;
> import java.util.Set;
>
> import org.apache.mina.common.ByteBuffer;
> import org.apache.mina.common.IoSession;
> import org.apache.mina.filter.codec.demux.MessageDecoderResult;
>
> public class FSResponseDecoder {
>
> private static final byte[] CONTENT_LENGTH = new
> String("Content-Length:").getBytes();
>
> private CharsetDecoder decoder = Charset.defaultCharset().newDecoder();
>
> public FSResponseDecoder() {
> }
>
> synchronized public MessageDecoderResult decodable(IoSession session,
> ByteBuffer in) {
> try {
> return messageComplete(in) ? MessageDecoderResult.OK
> : MessageDecoderResult.NEED_DATA;
> } catch (Exception ex) {
> ex.printStackTrace();
> }
>
> return MessageDecoderResult.NOT_OK;
> }
>
> public MessageDecoderResult decode(IoSession session, ByteBuffer in)
> throws Exception {
> // Try to decode body
>
> System.out.println("[[[[[ Decode function on session "+session);
>
> decodeBody(in);
>
> System.out.println("]]]]] Finish decode function on session
> "+session);
>
> return MessageDecoderResult.OK;
> }
>
> private String getBufferString(ByteBuffer in) {
> int size = in.remaining();
>
> if (size == 0) {
> return "empty";
> }
>
> StringBuffer out = new StringBuffer(size);
>
> while(in.hasRemaining()) {
> out.append((char) in.get());
> }
>
> in.flip();
>
> return out.toString();
> }
>
> private int getEndOfHeader(ByteBuffer in,int last) {
> int eoh = -1;
> for (int i = 0; i < last; i++) {
> if (in.get(i) == (byte) 0x0A && in.get(i + 1) == (byte) 0x0A) {
> eoh = i + 1;
> break;
> }
> }
> return eoh;
> }
>
> private boolean messageComplete(ByteBuffer in) throws Exception {
> int sizeToRead = 0;
> int last = in.remaining() - 1;
>
> System.out.println("***** New Buffer to analyze *****");
>
> String str = getBufferString(in); // in.getHexDump();
>
> System.out.println("Buffer Dump\n"+str);
>
> int eoh = getEndOfHeader(in, last);
>
> if (eoh == -1)
> return false;
>
>
> if (in.get(0) == (byte) 'C' && in.get(1) == (byte) 'o' &&
> in.get(2) == (byte) 'n' &&
> in.get(3) == (byte) 't' && in.get(4) == (byte) 'e' &&
> in.get(5) == (byte) 'n' &&
> in.get(6) == (byte) 't' && in.get(7) == (byte) '-' &&
> in.get(8) == (byte) 'L' &&
> in.get(9) == (byte) 'e' && in.get(10) == (byte) 'n' &&
> in.get(11) == (byte) 'g' &&
> in.get(12) == (byte) 't' && in.get(13) == (byte) 'h')
> {
>
> int contentLength = getContentLength(in, last);
>
> boolean result;
>
> if (contentLength>0) {
> result = contentLength + eoh <= in.remaining();
> sizeToRead = contentLength + (eoh+1);
> System.out.println("content_length["+contentLength+"]
> eoh["+eoh+"] == in.remaining["+in.remaining()+"] ==> "+result);
> if (result)
> System.out.println("sizeToRead is >>>> "+sizeToRead);
> }
> else
> result = false;
>
> return (result);
>
> }
>
> sizeToRead = eoh+1;
> System.out.println("sizeToRead is >>>> "+sizeToRead);
>
> return true;
> }
>
>
> private int getContentLength(ByteBuffer in, int last) {
>
> String str = getBufferString(in); // in.getHexDump();
> System.out.println("last = "+last);
> System.out.println("***** Buffer in getContentLength 1 *****\n"+str);
>
> for (int i = 0; i < last; i++) {
> boolean found = false;
> for (int j = 0; j < CONTENT_LENGTH.length; j++) {
> if (in.get(i + j) != CONTENT_LENGTH[j]) {
> found = false;
> break;
> }
> found = true;
> }
> if (found) {
> // retrieve value from this position till next 0x0D 0x0A
> System.out.println("Found content-length index at "+i);
>
> StringBuilder contentLength = new StringBuilder();
> for (int j = i + CONTENT_LENGTH.length; j < last; j++) {
> if (in.get(j) == 0x0A)
> break;
> contentLength.append(new String( new byte[] { in.get(j)
> }));
> System.out.println("["+new String( new byte[]
> {in.get(j)})+"]");
> }
> // if content-length worth of data has been received then the
> message is complete
>
> str = getBufferString(in); // in.getHexDump();
> System.out.println("***** Buffer in getContentLength
> 2*****\n"+str);
>
> System.out.println("ContentLength = "+contentLength);
> System.out.println("total buffer length = "+in.remaining());
> return Integer.parseInt(contentLength.toString().trim());
> }
> }
> return -1;
> }
>
> private void decodeBody(ByteBuffer in) {
> try {
>
> int sizeToRead = 0;
> int last = in.remaining() - 1;
> int eoh = getEndOfHeader(in, last);
>
> if (in.get(0) == (byte) 'C' && in.get(1) == (byte) 'o' &&
> in.get(2) == (byte) 'n' &&
> in.get(3) == (byte) 't' && in.get(4) == (byte) 'e'
> && in.get(5) == (byte) 'n' &&
> in.get(6) == (byte) 't' && in.get(7) == (byte) '-'
> && in.get(8) == (byte) 'L' &&
> in.get(9) == (byte) 'e' && in.get(10) == (byte) 'n'
> && in.get(11) == (byte) 'g' &&
> in.get(12) == (byte) 't' && in.get(13) == (byte)
> 'h')
> {
> int contentLength = getContentLength(in, last);
> sizeToRead = contentLength + (eoh+1);
> }
> else
> sizeToRead = eoh+1;
>
> System.out.println("Parsing request with sizeToRead =
> "+sizeToRead);
> parseRequest(new StringReader(in.getString(sizeToRead,
> decoder)));
> } catch (CharacterCodingException ex) {
> ex.printStackTrace();
> } catch (Exception e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> }
>
> private void parseRequest(Reader is) {
>
> BufferedReader rdr = new BufferedReader(is);
> Map<String, String> response = new HashMap<String,String>();
>
> try {
> // Get request URL.
> String line;
>
> // Read header
> System.out.println("Reading parameters:");
> while ((line = rdr.readLine()) != null && line.length() > 0) {
> String[] tokens = line.split(": ");
> response.put(tokens[0], tokens[1] );
> System.out.println(tokens[0]+": "+tokens[1]);
> }
>
> // determine content-type of this response
> String contentType = response.get("Content-Type");
>
> // If method 'POST' then read Content-Length worth of data
> if (contentType.equalsIgnoreCase("text/event-xml") ||
> contentType.equalsIgnoreCase("text/event-plain")) {
> int len = Integer.parseInt(response.get("Content-Length"));
> char[] buf = new char[len];
> if (rdr.read(buf) == len) {
> line = String.copyValueOf(buf);
> }
> String str = line;
> response.put("Event-Data", str);
> }
>
> } catch (IOException ex) {
> ex.printStackTrace();
> }
>
> }
>
> public static void main(String[] args) throws Exception
> {
> FSResponseDecoder decoder = new FSResponseDecoder();
> String str =
> "Content-Length: 1619\n"+
> "Content-Type: text/event-plain\n"+
> "\n"+
> "Channel-State: CS_NEW\n"+
> "Channel-State-Number: 0\n"+
> "Channel-Name: sofia/external/nobody%40192.168.3.12\n"+
> "Unique-ID: fd2229c0-2d6c-11dd-9acd-0b28d09a52aa\n"+
> "Call-Direction: inbound\n"+
> "Answer-State: ringing\n"+
> "variable_sip_from_user: nobody\n"+
> "variable_sip_from_uri: nobody%40192.168.3.12\n"+
> "variable_sip_from_host: 192.168.3.12\n"+
> "variable_sip_from_tag: 02H917ryecvgp\n"+
> "variable_sofia_profile_name: external\n"+
> "variable_sofia_profile_domain_name: external\n"+
> "variable_sip_req_user: 6001\n"+
> "variable_sip_req_port: 5080\n"+
> "variable_sip_req_uri: 6001%40192.168.3.11%3A5080\n"+
> "variable_sip_req_host: 192.168.3.11\n"+
> "variable_sip_to_user: 6001\n"+
> "variable_sip_to_port: 5080\n"+
> "variable_sip_to_uri: 6001%40192.168.3.11%3A5080\n"+
> "variable_sip_to_host: 192.168.3.11\n"+
> "variable_sip_contact_user: mod_sofia\n"+
> "variable_sip_contact_port: 5060\n"+
> "variable_sip_contact_uri: mod_sofia%40192.168.3.12%3A5060\n"+
> "variable_sip_contact_host: 192.168.3.12\n"+
> "variable_channel_name: sofia/external/nobody%40192.168.3.12\n"+
> "variable_endpoint_disposition: INBOUND%20CALL\n"+
> "variable_sip_call_id: 824f7531-a82e-122b-8485-000f1f644b48\n"+
> "variable_sip_user_agent: FreeSWITCH-mod_sofia/1.0.pre4-8539\n"+
> "variable_sip_via_host: 192.168.3.12\n"+
> "variable_sip_via_rport: 5060\n"+
> "variable_max_forwards: 70\n"+
> "Event-Name: CHANNEL_CREATE\n"+
> "Core-UUID: ed9888ba-2c94-11dd-";
> int capacity = str.getBytes().length;
> ByteBuffer bb = ByteBuffer.allocate( capacity );
> bb.put( str.getBytes() );
> decoder.decode( null, bb );
> }
> }
>
>
> Here are the logs :
>
> [[[[[ Decode function on session null
> last = 752
> ***** Buffer in getContentLength 1 *****
>
>
> seems correct. Can you test it ?
>
>
> --
> --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
>
>
>
Re: ByteBuffer Anomaly??
Posted by Emmanuel Lecharny <el...@apache.org>.
Hi,
I have ported your code on a standalone class to test it :
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.apache.mina.common.ByteBuffer;
import org.apache.mina.common.IoSession;
import org.apache.mina.filter.codec.demux.MessageDecoderResult;
public class FSResponseDecoder {
private static final byte[] CONTENT_LENGTH = new
String("Content-Length:").getBytes();
private CharsetDecoder decoder = Charset.defaultCharset().newDecoder();
public FSResponseDecoder() {
}
synchronized public MessageDecoderResult decodable(IoSession
session, ByteBuffer in) {
try {
return messageComplete(in) ? MessageDecoderResult.OK
: MessageDecoderResult.NEED_DATA;
} catch (Exception ex) {
ex.printStackTrace();
}
return MessageDecoderResult.NOT_OK;
}
public MessageDecoderResult decode(IoSession session, ByteBuffer in)
throws Exception {
// Try to decode body
System.out.println("[[[[[ Decode function on session "+session);
decodeBody(in);
System.out.println("]]]]] Finish decode function on session
"+session);
return MessageDecoderResult.OK;
}
private String getBufferString(ByteBuffer in) {
int size = in.remaining();
if (size == 0) {
return "empty";
}
StringBuffer out = new StringBuffer(size);
while(in.hasRemaining()) {
out.append((char) in.get());
}
in.flip();
return out.toString();
}
private int getEndOfHeader(ByteBuffer in,int last) {
int eoh = -1;
for (int i = 0; i < last; i++) {
if (in.get(i) == (byte) 0x0A && in.get(i + 1) == (byte) 0x0A) {
eoh = i + 1;
break;
}
}
return eoh;
}
private boolean messageComplete(ByteBuffer in) throws Exception {
int sizeToRead = 0;
int last = in.remaining() - 1;
System.out.println("***** New Buffer to analyze *****");
String str = getBufferString(in); // in.getHexDump();
System.out.println("Buffer Dump\n"+str);
int eoh = getEndOfHeader(in, last);
if (eoh == -1)
return false;
if (in.get(0) == (byte) 'C' && in.get(1) == (byte) 'o' &&
in.get(2) == (byte) 'n' &&
in.get(3) == (byte) 't' && in.get(4) == (byte) 'e' &&
in.get(5) == (byte) 'n' &&
in.get(6) == (byte) 't' && in.get(7) == (byte) '-' &&
in.get(8) == (byte) 'L' &&
in.get(9) == (byte) 'e' && in.get(10) == (byte) 'n' &&
in.get(11) == (byte) 'g' &&
in.get(12) == (byte) 't' && in.get(13) == (byte) 'h')
{
int contentLength = getContentLength(in, last);
boolean result;
if (contentLength>0) {
result = contentLength + eoh <= in.remaining();
sizeToRead = contentLength + (eoh+1);
System.out.println("content_length["+contentLength+"]
eoh["+eoh+"] == in.remaining["+in.remaining()+"] ==> "+result);
if (result)
System.out.println("sizeToRead is >>>> "+sizeToRead);
}
else
result = false;
return (result);
}
sizeToRead = eoh+1;
System.out.println("sizeToRead is >>>> "+sizeToRead);
return true;
}
private int getContentLength(ByteBuffer in, int last) {
String str = getBufferString(in); // in.getHexDump();
System.out.println("last = "+last);
System.out.println("***** Buffer in getContentLength 1
*****\n"+str);
for (int i = 0; i < last; i++) {
boolean found = false;
for (int j = 0; j < CONTENT_LENGTH.length; j++) {
if (in.get(i + j) != CONTENT_LENGTH[j]) {
found = false;
break;
}
found = true;
}
if (found) {
// retrieve value from this position till next 0x0D 0x0A
System.out.println("Found content-length index at "+i);
StringBuilder contentLength = new StringBuilder();
for (int j = i + CONTENT_LENGTH.length; j < last; j++) {
if (in.get(j) == 0x0A)
break;
contentLength.append(new String( new byte[] { in.get(j)
}));
System.out.println("["+new String( new byte[]
{in.get(j)})+"]");
}
// if content-length worth of data has been received
then the message is complete
str = getBufferString(in); // in.getHexDump();
System.out.println("***** Buffer in getContentLength
2*****\n"+str);
System.out.println("ContentLength = "+contentLength);
System.out.println("total buffer length = "+in.remaining());
return Integer.parseInt(contentLength.toString().trim());
}
}
return -1;
}
private void decodeBody(ByteBuffer in) {
try {
int sizeToRead = 0;
int last = in.remaining() - 1;
int eoh = getEndOfHeader(in, last);
if (in.get(0) == (byte) 'C' && in.get(1) == (byte) 'o' &&
in.get(2) == (byte) 'n' &&
in.get(3) == (byte) 't' && in.get(4) == (byte) 'e'
&& in.get(5) == (byte) 'n' &&
in.get(6) == (byte) 't' && in.get(7) == (byte) '-'
&& in.get(8) == (byte) 'L' &&
in.get(9) == (byte) 'e' && in.get(10) == (byte) 'n'
&& in.get(11) == (byte) 'g' &&
in.get(12) == (byte) 't' && in.get(13) == (byte)
'h')
{
int contentLength = getContentLength(in, last);
sizeToRead = contentLength + (eoh+1);
}
else
sizeToRead = eoh+1;
System.out.println("Parsing request with sizeToRead =
"+sizeToRead);
parseRequest(new StringReader(in.getString(sizeToRead,
decoder)));
} catch (CharacterCodingException ex) {
ex.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private void parseRequest(Reader is) {
BufferedReader rdr = new BufferedReader(is);
Map<String, String> response = new HashMap<String,String>();
try {
// Get request URL.
String line;
// Read header
System.out.println("Reading parameters:");
while ((line = rdr.readLine()) != null && line.length() > 0) {
String[] tokens = line.split(": ");
response.put(tokens[0], tokens[1] );
System.out.println(tokens[0]+": "+tokens[1]);
}
// determine content-type of this response
String contentType = response.get("Content-Type");
// If method 'POST' then read Content-Length worth of data
if (contentType.equalsIgnoreCase("text/event-xml") ||
contentType.equalsIgnoreCase("text/event-plain")) {
int len = Integer.parseInt(response.get("Content-Length"));
char[] buf = new char[len];
if (rdr.read(buf) == len) {
line = String.copyValueOf(buf);
}
String str = line;
response.put("Event-Data", str);
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
public static void main(String[] args) throws Exception
{
FSResponseDecoder decoder = new FSResponseDecoder();
String str =
"Content-Length: 1619\n"+
"Content-Type: text/event-plain\n"+
"\n"+
"Channel-State: CS_NEW\n"+
"Channel-State-Number: 0\n"+
"Channel-Name: sofia/external/nobody%40192.168.3.12\n"+
"Unique-ID: fd2229c0-2d6c-11dd-9acd-0b28d09a52aa\n"+
"Call-Direction: inbound\n"+
"Answer-State: ringing\n"+
"variable_sip_from_user: nobody\n"+
"variable_sip_from_uri: nobody%40192.168.3.12\n"+
"variable_sip_from_host: 192.168.3.12\n"+
"variable_sip_from_tag: 02H917ryecvgp\n"+
"variable_sofia_profile_name: external\n"+
"variable_sofia_profile_domain_name: external\n"+
"variable_sip_req_user: 6001\n"+
"variable_sip_req_port: 5080\n"+
"variable_sip_req_uri: 6001%40192.168.3.11%3A5080\n"+
"variable_sip_req_host: 192.168.3.11\n"+
"variable_sip_to_user: 6001\n"+
"variable_sip_to_port: 5080\n"+
"variable_sip_to_uri: 6001%40192.168.3.11%3A5080\n"+
"variable_sip_to_host: 192.168.3.11\n"+
"variable_sip_contact_user: mod_sofia\n"+
"variable_sip_contact_port: 5060\n"+
"variable_sip_contact_uri: mod_sofia%40192.168.3.12%3A5060\n"+
"variable_sip_contact_host: 192.168.3.12\n"+
"variable_channel_name: sofia/external/nobody%40192.168.3.12\n"+
"variable_endpoint_disposition: INBOUND%20CALL\n"+
"variable_sip_call_id: 824f7531-a82e-122b-8485-000f1f644b48\n"+
"variable_sip_user_agent: FreeSWITCH-mod_sofia/1.0.pre4-8539\n"+
"variable_sip_via_host: 192.168.3.12\n"+
"variable_sip_via_rport: 5060\n"+
"variable_max_forwards: 70\n"+
"Event-Name: CHANNEL_CREATE\n"+
"Core-UUID: ed9888ba-2c94-11dd-";
int capacity = str.getBytes().length;
ByteBuffer bb = ByteBuffer.allocate( capacity );
bb.put( str.getBytes() );
decoder.decode( null, bb );
}
}
Here are the logs :
[[[[[ Decode function on session null
last = 752
***** Buffer in getContentLength 1 *****
seems correct. Can you test it ?
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
Re: ByteBuffer Anomaly??
Posted by Johny Kadarisman <jk...@gmail.com>.
I trace the traffic with Wireshark, why it seems like we get it in chunk (a
few call to decodable, with increment bytebuffer). While in packet trace,
the other party send the whole thing in one big packet. And wireshark also
receive it as big package.
On Thu, May 29, 2008 at 5:37 PM, Emmanuel Lecharny <el...@apache.org>
wrote:
> Difficult to say from the code and the logs...
>
> ByteBuffer might not contain all the bytes you are expecting, but only
> partial data. I see at least a potential failure in
> the messageComplet() method :
>
> ...
>
> if (in.get(0) == (byte) 'C' && in.get(1) == (byte) 'o' &&
> in.get(2) == (byte) 'n' &&
> in.get(3) == (byte) 't' && in.get(4) == (byte) 'e' &&
> in.get(5) == (byte) 'n' &&
> in.get(6) == (byte) 't' && in.get(7) == (byte) '-' &&
> in.get(8) == (byte) 'L' &&
> in.get(9) == (byte) 'e' && in.get(10) == (byte) 'n' &&
> in.get(11) == (byte) 'g' &&
> in.get(12) == (byte) 't' && in.get(13) == (byte) 'h')
>
> ...
>
> might fail if the incoming ByteBuffer does not contains at least 14 bytes,
> which is something perfectly possible.
>
> Remember that the server will read all the available bytes, but as those
> bytes can be sent in small pieces, you will have to deal with fragments.
>
>
> Johny Kadarisman wrote:
>
>> Thanks Emmanuel,
>>
>> I did your suggestion, it seems like still hit same problem.
>>
>> Here is the complete protocol code, I try to mimic http codec, with some
>> customization. Little warning, its quite messy, and i think i need to
>> refactor it soon. also, I attached the latest log from my run.
>>
>> =================================================
>>
>> import java.io.BufferedReader;
>> import java.io.IOException;
>> import java.io.Reader;
>> import java.io.StringReader;
>> import java.nio.charset.CharacterCodingException;
>> import java.nio.charset.Charset;
>> import java.nio.charset.CharsetDecoder;
>>
>> import org.apache.mina.common.ByteBuffer;
>> import org.apache.mina.common.IoSession;
>> import org.apache.mina.filter.codec.ProtocolDecoderOutput;
>> import org.apache.mina.filter.codec.demux.MessageDecoderAdapter;
>> import org.apache.mina.filter.codec.demux.MessageDecoderResult;
>> import org.slf4j.Logger;
>> import org.slf4j.LoggerFactory;
>>
>> public class FSResponseDecoder extends MessageDecoderAdapter {
>>
>> private final Logger logger = LoggerFactory.getLogger(getClass());
>>
>> private static final byte[] CONTENT_LENGTH = new
>> String("Content-Length:").getBytes();
>>
>> private CharsetDecoder decoder = Charset.defaultCharset().newDecoder();
>>
>> public FSResponseDecoder() {
>> }
>>
>> synchronized public MessageDecoderResult decodable(IoSession session,
>> ByteBuffer in) {
>> try {
>> return messageComplete(in) ? MessageDecoderResult.OK
>> : MessageDecoderResult.NEED_DATA;
>> } catch (Exception ex) {
>> ex.printStackTrace();
>> }
>>
>> return MessageDecoderResult.NOT_OK;
>> }
>>
>> public MessageDecoderResult decode(IoSession session, ByteBuffer in,
>> ProtocolDecoderOutput out) throws Exception {
>> // Try to decode body
>>
>> logger.debug("[[[[[ Decode function on session "+session);
>>
>> FSResponse m = decodeBody(in);
>>
>> // Return NEED_DATA if the body is not fully read.
>> if (m == null)
>> return MessageDecoderResult.NEED_DATA;
>>
>> out.write(m);
>>
>> logger.debug("]]]]] Finish decode function on session "+session);
>>
>> return MessageDecoderResult.OK;
>> }
>>
>> private String getBufferString(ByteBuffer in) {
>> int size = in.remaining();
>>
>> if (size == 0) {
>> return "empty";
>> }
>>
>> StringBuffer out = new StringBuffer(size);
>>
>> while(in.hasRemaining()) {
>> out.append((char) in.get());
>> }
>>
>> in.flip();
>>
>> return out.toString();
>> }
>>
>> private int getEndOfHeader(ByteBuffer in,int last) {
>> int eoh = -1;
>> for (int i = 0; i < last; i++) {
>> if (in.get(i) == (byte) 0x0A && in.get(i + 1) == (byte) 0x0A) {
>> eoh = i + 1;
>> break;
>> }
>> }
>> return eoh;
>> }
>>
>> private boolean messageComplete(ByteBuffer in) throws Exception {
>> int sizeToRead = 0;
>> int last = in.remaining() - 1;
>>
>> logger.debug("***** New Buffer to analyze *****");
>>
>> String str = getBufferString(in); // in.getHexDump();
>>
>> logger.debug("Buffer Dump\n"+str);
>>
>> int eoh = getEndOfHeader(in, last);
>>
>> if (eoh == -1)
>> return false;
>>
>>
>> if (in.get(0) == (byte) 'C' && in.get(1) == (byte) 'o' &&
>> in.get(2) == (byte) 'n' &&
>> in.get(3) == (byte) 't' && in.get(4) == (byte) 'e' &&
>> in.get(5) == (byte) 'n' &&
>> in.get(6) == (byte) 't' && in.get(7) == (byte) '-' &&
>> in.get(8) == (byte) 'L' &&
>> in.get(9) == (byte) 'e' && in.get(10) == (byte) 'n' &&
>> in.get(11) == (byte) 'g' &&
>> in.get(12) == (byte) 't' && in.get(13) == (byte) 'h')
>> {
>>
>> int contentLength = getContentLength(in, last);
>>
>> boolean result;
>>
>> if (contentLength>0) {
>> result = contentLength + eoh <= in.remaining();
>> sizeToRead = contentLength + (eoh+1);
>> logger.debug("content_length["+contentLength+"] +
>> eoh["+eoh+"] == in.remaining["+in.remaining()+"] ==> "+result);
>> if (result)
>> logger.debug("sizeToRead is >>>> "+sizeToRead);
>> }
>> else
>> result = false;
>>
>> return (result);
>>
>> }
>>
>> sizeToRead = eoh+1;
>> logger.debug("sizeToRead is >>>> "+sizeToRead);
>>
>> return true;
>> }
>>
>>
>> private int getContentLength(ByteBuffer in, int last) {
>>
>> String str = getBufferString(in); // in.getHexDump();
>> logger.debug("last = "+last);
>> logger.debug("***** Buffer in getContentLength 1 *****\n"+str);
>>
>> for (int i = 0; i < last; i++) {
>> boolean found = false;
>> for (int j = 0; j < CONTENT_LENGTH.length; j++) {
>> if (in.get(i + j) != CONTENT_LENGTH[j]) {
>> found = false;
>> break;
>> }
>> found = true;
>> }
>> if (found) {
>> // retrieve value from this position till next 0x0D 0x0A
>> logger.debug("Found content-length index at "+i);
>>
>> StringBuilder contentLength = new StringBuilder();
>> for (int j = i + CONTENT_LENGTH.length; j < last; j++) {
>> if (in.get(j) == 0x0A)
>> break;
>> contentLength.append(new String( new byte[] { in.get(j)
>> }));
>> logger.debug("["+new String( new byte[]
>> {in.get(j)})+"]");
>> }
>> // if content-length worth of data has been received then
>> the message is complete
>>
>> str = getBufferString(in); //
>> in.getHexDump();
>> logger.debug("***** Buffer in getContentLength 2
>> *****\n"+str);
>>
>> logger.debug("ContentLength = "+contentLength);
>> logger.debug("total buffer length = "+in.remaining());
>> return Integer.parseInt(contentLength.toString().trim());
>> }
>> }
>> return -1;
>> }
>>
>> private FSResponse decodeBody(ByteBuffer in) {
>> FSResponse response = new FSResponse();
>> try {
>>
>> int sizeToRead = 0;
>> int last = in.remaining() - 1;
>> int eoh = getEndOfHeader(in, last);
>>
>> if (in.get(0) == (byte) 'C' && in.get(1) == (byte) 'o' &&
>> in.get(2) == (byte) 'n' &&
>> in.get(3) == (byte) 't' && in.get(4) == (byte) 'e'
>> && in.get(5) == (byte) 'n' &&
>> in.get(6) == (byte) 't' && in.get(7) == (byte) '-'
>> && in.get(8) == (byte) 'L' &&
>> in.get(9) == (byte) 'e' && in.get(10) == (byte) 'n'
>> && in.get(11) == (byte) 'g' &&
>> in.get(12) == (byte) 't' && in.get(13) == (byte)
>> 'h')
>> {
>> int contentLength = getContentLength(in, last);
>> sizeToRead = contentLength + (eoh+1);
>> }
>> else
>> sizeToRead = eoh+1;
>>
>> logger.debug("Parsing request with sizeToRead = "+sizeToRead);
>> parseRequest(new StringReader(in.getString(sizeToRead,
>> decoder)), response);
>> return response;
>> } catch (CharacterCodingException ex) {
>> ex.printStackTrace();
>> } catch (Exception e) {
>> // TODO Auto-generated catch block
>> e.printStackTrace();
>> }
>>
>> return null;
>> }
>>
>> private void parseRequest(Reader is, FSResponse response) {
>>
>> BufferedReader rdr = new BufferedReader(is);
>>
>> try {
>> // Get request URL.
>> String line;
>>
>> // Read header
>> logger.debug("Reading parameters:");
>> while ((line = rdr.readLine()) != null && line.length() > 0) {
>> String[] tokens = line.split(": ");
>> response.setParameters(tokens[0], tokens[1] );
>> logger.debug(tokens[0]+": "+tokens[1]);
>> }
>>
>> // determine content-type of this response
>> String contentType = response.getParameter("Content-Type");
>>
>> // If method 'POST' then read Content-Length worth of data
>> if (contentType.equalsIgnoreCase("text/event-xml") ||
>> contentType.equalsIgnoreCase("text/event-plain")) {
>> int len =
>> Integer.parseInt(response.getParameter("Content-Length"));
>> char[] buf = new char[len];
>> if (rdr.read(buf) == len) {
>> line = String.copyValueOf(buf);
>> }
>> String str = line;
>> response.setParameters("Event-Data", str);
>> }
>>
>> } catch (IOException ex) {
>> ex.printStackTrace();
>> }
>>
>> }
>>
>> }
>>
>> ===============================================
>>
>> 14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - ***** New
>> Buffer to analyze *****
>> 14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - Buffer Dump
>> Content-Type: command/reply
>> Reply-Text: +OK accepted
>>
>>
>> 14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - sizeToRead
>> is
>>
>>
>>> 54
>>>>>>
>>>>>>
>>>>> 14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - [[[[[
>> Decode
>> function on session (SOCKET, R: /192.168.3.11:8021, L: /
>> 192.168.150.52:1578,
>> S: /192.168.3.11:8021)
>> 14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - Parsing
>> request with sizeToRead = 54
>> 14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - Reading
>> parameters:
>> 14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder -
>> Content-Type:
>> command/reply
>> 14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - Reply-Text:
>> +OK accepted
>> 14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - ]]]]]
>> Finish
>> decode function on session (SOCKET, R: /192.168.3.11:8021, L: /
>> 192.168.150.52:1578, S: /192.168.3.11:8021)
>> 14:55:08,253 [AnonymousIoService-4] INFO FSProtocolHandler - [/
>> 192.168.3.11:8021] RECEIVED:
>> <<<
>> Reply-Text: +OK accepted
>> Content-Type: command/reply
>> <<<
>> 14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - ***** New
>> Buffer to analyze *****
>> 14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - Buffer Dump
>> Content-Type: command/reply
>> Reply-Text: +OK event listener enabled plain
>>
>>
>> 14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - sizeToRead
>> is
>>
>>
>>> 74
>>>>>>
>>>>>>
>>>>> 14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - [[[[[
>> Decode
>> function on session (SOCKET, R: /192.168.3.11:8021, L: /
>> 192.168.150.52:1578,
>> S: /192.168.3.11:8021)
>> 14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - Parsing
>> request with sizeToRead = 74
>> 14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - Reading
>> parameters:
>> 14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder -
>> Content-Type:
>> command/reply
>> 14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - Reply-Text:
>> +OK event listener enabled plain
>> 14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - ]]]]]
>> Finish
>> decode function on session (SOCKET, R: /192.168.3.11:8021, L: /
>> 192.168.150.52:1578, S: /192.168.3.11:8021)
>> 14:55:08,519 [AnonymousIoService-5] INFO FSProtocolHandler - [/
>> 192.168.3.11:8021] RECEIVED:
>> <<<
>> Reply-Text: +OK event listener enabled plain
>> Content-Type: command/reply
>> <<<
>> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - ***** New
>> Buffer to analyze *****
>> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - Buffer Dump
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>>
>> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - last = 51
>> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 1 *****
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>>
>> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - Found
>> content-length index at 0
>> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - [ ]
>> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - [5]
>> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - [8]
>> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - [9]
>> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 2 *****
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>>
>> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder -
>> ContentLength
>> = 589
>> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - total
>> buffer
>> length = 52
>> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder -
>> content_length[589] + eoh[51] == in.remaining[52] ==> false
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** New
>> Buffer to analyze *****
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Buffer Dump
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>> Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> Fr
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 307
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 1 *****
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>> Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> Fr
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
>> content-length index at 0
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 2 *****
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>> Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> Fr
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> ContentLength
>> = 589
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - total
>> buffer
>> length = 308
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> content_length[589] + eoh[51] == in.remaining[308] ==> false
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** New
>> Buffer to analyze *****
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Buffer Dump
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>> Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_core.c
>> Event-Calling-Function: send_heartbeat
>> Event-Calling-Line-Number: 74
>>
>> Content-Length: 496
>> Content-Type: text/event-plain
>>
>> Task-ID: 1
>> Task-Desc: heartbeat
>> Task-Group: core
>> Task-Runtime: 1212074247
>> Event-Name: RE_SCHEDULE
>> Core-UUID: 4b87d46a-2d8c-11dd
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 819
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 1 *****
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>> Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_core.c
>> Event-Calling-Function: send_heartbeat
>> Event-Calling-Line-Number: 74
>>
>> Content-Length: 496
>> Content-Type: text/event-plain
>>
>> Task-ID: 1
>> Task-Desc: heartbeat
>> Task-Group: core
>> Task-Runtime: 1212074247
>> Event-Name: RE_SCHEDULE
>> Core-UUID: 4b87d46a-2d8c-11dd
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
>> content-length index at 0
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 2 *****
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>> Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_core.c
>> Event-Calling-Function: send_heartbeat
>> Event-Calling-Line-Number: 74
>>
>> Content-Length: 496
>> Content-Type: text/event-plain
>>
>> Task-ID: 1
>> Task-Desc: heartbeat
>> Task-Group: core
>> Task-Runtime: 1212074247
>> Event-Name: RE_SCHEDULE
>> Core-UUID: 4b87d46a-2d8c-11dd
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> ContentLength
>> = 589
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - total
>> buffer
>> length = 820
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> content_length[589] + eoh[51] == in.remaining[820] ==> true
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - sizeToRead
>> is
>>
>>
>>> 641
>>>>>>
>>>>>>
>>>>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [[[[[
>> Decode
>> function on session (SOCKET, R: /192.168.3.11:8021, L: /
>> 192.168.150.52:1578,
>> S: /192.168.3.11:8021)
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 819
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 1 *****
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>> Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_core.c
>> Event-Calling-Function: send_heartbeat
>> Event-Calling-Line-Number: 74
>>
>> Content-Length: 496
>> Content-Type: text/event-plain
>>
>> Task-ID: 1
>> Task-Desc: heartbeat
>> Task-Group: core
>> Task-Runtime: 1212074247
>> Event-Name: RE_SCHEDULE
>> Core-UUID: 4b87d46a-2d8c-11dd
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
>> content-length index at 0
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 2 *****
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>> Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_core.c
>> Event-Calling-Function: send_heartbeat
>> Event-Calling-Line-Number: 74
>>
>> Content-Length: 496
>> Content-Type: text/event-plain
>>
>> Task-ID: 1
>> Task-Desc: heartbeat
>> Task-Group: core
>> Task-Runtime: 1212074247
>> Event-Name: RE_SCHEDULE
>> Core-UUID: 4b87d46a-2d8c-11dd
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> ContentLength
>> = 589
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - total
>> buffer
>> length = 820
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Parsing
>> request with sizeToRead = 641
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Reading
>> parameters:
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> Content-Length: 589
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> Content-Type:
>> text/event-plain
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ]]]]]
>> Finish
>> decode function on session (SOCKET, R: /192.168.3.11:8021, L: /
>> 192.168.150.52:1578, S: /192.168.3.11:8021)
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** New
>> Buffer to analyze *****
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Buffer Dump
>> Content-Length: 496
>> Content-Type: text/event-plain
>>
>> Task-ID: 1
>> Task-Desc: heartbeat
>> Task-Group: core
>> Task-Runtime: 1212074247
>> Event-Name: RE_SCHEDULE
>> Core-UUID: 4b87d46a-2d8c-11dd
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 178
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 1 *****
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>> Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_core.c
>> Event-Calling-Function: send_heartbeat
>> Event-Calling-Line-Number: 74
>>
>> Content-Length: 496
>> Content-Type: text/event-plain
>>
>> Task-ID: 1
>> Task-Desc: heartbeat
>> Task-Group: core
>> Task-Runtime: 1212074247
>> Event-Name: RE_SCHEDULE
>> Core-UUID: 4b87d46a-2d8c-11dd
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
>> content-length index at 0
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
>> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 2 *****
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>> Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_core.c
>> Event-Calling-Function: send_heartbeat
>> Event-Calling-Line-Number: 74
>>
>> Content-Length: 496
>> Content-Type: text/event-plain
>>
>> Task-ID: 1
>> Task-Desc: heartbeat
>> Task-Group: core
>> Task-Runtime: 1212074247
>> Event-Name: RE_SCHEDULE
>> Core-UUID: 4b87d46a-2d8c-11dd
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> ContentLength
>> = 589
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - total
>> buffer
>> length = 820
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> content_length[589] + eoh[51] == in.remaining[820] ==> true
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - sizeToRead
>> is
>>
>>
>>> 641
>>>>>>
>>>>>>
>>>>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [[[[[
>> Decode
>> function on session (SOCKET, R: /192.168.3.11:8021, L: /
>> 192.168.150.52:1578,
>> S: /192.168.3.11:8021)
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 178
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 1 *****
>> Content-Length: 496
>> Content-Type: text/event-plain
>>
>> Task-ID: 1
>> Task-Desc: heartbeat
>> Task-Group: core
>> Task-Runtime: 1212074247
>> Event-Name: RE_SCHEDULE
>> Core-UUID: 4b87d46a-2d8c-11dd
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
>> content-length index at 0
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 2 *****
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>> Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_core.c
>> Event-Calling-Function: send_heartbeat
>> Event-Calling-Line-Number: 74
>>
>> Content-Length: 496
>> Content-Type: text/event-plain
>>
>> Task-ID: 1
>> Task-Desc: heartbeat
>> Task-Group: core
>> Task-Runtime: 1212074247
>> Event-Name: RE_SCHEDULE
>> Core-UUID: 4b87d46a-2d8c-11dd
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> ContentLength
>> = 589
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - total
>> buffer
>> length = 820
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Parsing
>> request with sizeToRead = 641
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Reading
>> parameters:
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> Content-Length: 589
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> Content-Type:
>> text/event-plain
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ]]]]]
>> Finish
>> decode function on session (SOCKET, R: /192.168.3.11:8021, L: /
>> 192.168.150.52:1578, S: /192.168.3.11:8021)
>> 14:55:26,282 [AnonymousIoService-7] INFO FSProtocolHandler - [/
>> 192.168.3.11:8021] RECEIVED:
>> <<<
>> Event-Data: Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_core.c
>> Event-Calling-Function: send_heartbeat
>> Event-Calling-Line-Number: 74
>>
>>
>> Content-Length: 589
>> Content-Type: text/event-plain
>> <<<
>> 14:55:26,282 [AnonymousIoService-7] INFO FSProtocolHandler - [/
>> 192.168.3.11:8021] RECEIVED:
>> <<<
>> Event-Data: Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_core.c
>> Event-Calling-Function: send_heartbeat
>> Event-Calling-Line-Number: 74
>>
>>
>> Content-Length: 589
>> Content-Type: text/event-plain
>> <<<
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** New
>> Buffer to analyze *****
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Buffer Dump
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>> Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_core.c
>> Event-Calling-Function: send_heartbeat
>> Event-Calling-Line-Number: 74
>>
>> -a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_scheduler.c
>> Event-Calling-Function: switch_scheduler_execute
>> Event-Calling-Line-Number: 70
>>
>>
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 1009
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 1 *****
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>> Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_core.c
>> Event-Calling-Function: send_heartbeat
>> Event-Calling-Line-Number: 74
>>
>> -a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_scheduler.c
>> Event-Calling-Function: switch_scheduler_execute
>> Event-Calling-Line-Number: 70
>>
>>
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
>> content-length index at 0
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 2 *****
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>> Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_core.c
>> Event-Calling-Function: send_heartbeat
>> Event-Calling-Line-Number: 74
>>
>> -a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_scheduler.c
>> Event-Calling-Function: switch_scheduler_execute
>> Event-Calling-Line-Number: 70
>>
>>
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> ContentLength
>> = 589
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - total
>> buffer
>> length = 1010
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> content_length[589] + eoh[51] == in.remaining[1010] ==> true
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - sizeToRead
>> is
>>
>>
>>> 641
>>>>>>
>>>>>>
>>>>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [[[[[
>> Decode
>> function on session (SOCKET, R: /192.168.3.11:8021, L: /
>> 192.168.150.52:1578,
>> S: /192.168.3.11:8021)
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 1009
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 1 *****
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>> Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_core.c
>> Event-Calling-Function: send_heartbeat
>> Event-Calling-Line-Number: 74
>>
>> -a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_scheduler.c
>> Event-Calling-Function: switch_scheduler_execute
>> Event-Calling-Line-Number: 70
>>
>>
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
>> content-length index at 0
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 2 *****
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>> Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_core.c
>> Event-Calling-Function: send_heartbeat
>> Event-Calling-Line-Number: 74
>>
>> -a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_scheduler.c
>> Event-Calling-Function: switch_scheduler_execute
>> Event-Calling-Line-Number: 70
>>
>>
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> ContentLength
>> = 589
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - total
>> buffer
>> length = 1010
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Parsing
>> request with sizeToRead = 641
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Reading
>> parameters:
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> Content-Length: 589
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> Content-Type:
>> text/event-plain
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ]]]]]
>> Finish
>> decode function on session (SOCKET, R: /192.168.3.11:8021, L: /
>> 192.168.150.52:1578, S: /192.168.3.11:8021)
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** New
>> Buffer to analyze *****
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Buffer Dump
>> -a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_scheduler.c
>> Event-Calling-Function: switch_scheduler_execute
>> Event-Calling-Line-Number: 70
>>
>>
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 368
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 1 *****
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>> Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_core.c
>> Event-Calling-Function: send_heartbeat
>> Event-Calling-Line-Number: 74
>>
>> -a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_scheduler.c
>> Event-Calling-Function: switch_scheduler_execute
>> Event-Calling-Line-Number: 70
>>
>>
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
>> content-length index at 0
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 2 *****
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>> Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_core.c
>> Event-Calling-Function: send_heartbeat
>> Event-Calling-Line-Number: 74
>>
>> -a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_scheduler.c
>> Event-Calling-Function: switch_scheduler_execute
>> Event-Calling-Line-Number: 70
>>
>>
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> ContentLength
>> = 589
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - total
>> buffer
>> length = 1010
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> content_length[589] + eoh[51] == in.remaining[1010] ==> true
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - sizeToRead
>> is
>>
>>
>>> 641
>>>>>>
>>>>>>
>>>>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [[[[[
>> Decode
>> function on session (SOCKET, R: /192.168.3.11:8021, L: /
>> 192.168.150.52:1578,
>> S: /192.168.3.11:8021)
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 368
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 1 *****
>> -a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_scheduler.c
>> Event-Calling-Function: switch_scheduler_execute
>> Event-Calling-Line-Number: 70
>>
>>
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
>> content-length index at 0
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 2 *****
>> Content-Length: 589
>> Content-Type: text/event-plain
>>
>> Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_core.c
>> Event-Calling-Function: send_heartbeat
>> Event-Calling-Line-Number: 74
>>
>> -a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_scheduler.c
>> Event-Calling-Function: switch_scheduler_execute
>> Event-Calling-Line-Number: 70
>>
>>
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> ContentLength
>> = 589
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - total
>> buffer
>> length = 1010
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Parsing
>> request with sizeToRead = 641
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Reading
>> parameters:
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> Content-Length: 589
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
>> Content-Type:
>> text/event-plain
>> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ]]]]]
>> Finish
>> decode function on session (SOCKET, R: /192.168.3.11:8021, L: /
>> 192.168.150.52:1578, S: /192.168.3.11:8021)
>> 14:55:26,282 [AnonymousIoService-7] INFO FSProtocolHandler - [/
>> 192.168.3.11:8021] RECEIVED:
>> <<<
>> Event-Data: Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_core.c
>> Event-Calling-Function: send_heartbeat
>> Event-Calling-Line-Number: 74
>>
>>
>> Content-Length: 589
>> Content-Type: text/event-plain
>> <<<
>> 14:55:26,282 [AnonymousIoService-7] INFO FSProtocolHandler - [/
>> 192.168.3.11:8021] RECEIVED:
>> <<<
>> Event-Data: Event-Info: System%20Ready
>> Up-Time:
>>
>> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
>> Session-Count: 0
>> Session-Per-Sec: 30
>> Event-Name: HEARTBEAT
>> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
>> FreeSWITCH-Hostname: COADAIN01
>> FreeSWITCH-IPv4: 192.168.3.11
>> FreeSWITCH-IPv6: 127.0.0.1
>> Event-Date-Local: 2008-05-29%2011%3A17%3A07
>> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
>> Event-Date-timestamp: 1212074227410211
>> Event-Calling-File: switch_core.c
>> Event-Calling-Function: send_heartbeat
>> Event-Calling-Line-Number: 74
>>
>>
>> Content-Length: 589
>> Content-Type: text/event-plain
>> <<<
>> 14:55:26,282 [AnonymousIoService-7] WARN FSProtocolHandler - [/
>> 192.168.3.11:8021] EXCEPTION:
>> org.apache.mina.filter.codec.ProtocolDecoderException:
>> java.lang.IllegalStateException: doDecode() can't return true when buffer
>> is
>> not consumed. (Hexdump: 65 65 53 57 49 54 43 48 2D 48 6F 73 74 6E 61 6D 65
>> 3A 20 43 4F 41 44 41 49 4E 30 31 0A 46 72 65 65 53 57 49 54 43 48 2D 49 50
>> 76 34 3A 20 31 39 32 2E 31 36 38 2E 33 2E 31 31 0A 46 72 65 65 53 57 49 54
>> 43 48 2D 49 50 76 36 3A 20 31 32 37 2E 30 2E 30 2E 31 0A 45 76 65 6E 74 2D
>> 44 61 74 65 2D 4C 6F 63 61 6C 3A 20 32 30 30 38 2D 30 35 2D 32 39 25 32 30
>> 31 31 25 33 41 31 37 25 33 41 30 37 0A 45 76 65 6E 74 2D 44 61 74 65 2D 47
>> 4D 54 3A 20 54 68 75 2C 25 32 30 32 39 25 32 30 4D 61 79 25 32 30 32 30 30
>> 38 25 32 30 31 35 25 33 41 31 37 25 33 41 30 37 25 32 30 47 4D 54 0A 45 76
>> 65 6E 74 2D 44 61 74 65 2D 74 69 6D 65 73 74 61 6D 70 3A 20 31 32 31 32 30
>> 37 34 32 32 37 34 31 30 32 31 31 0A 45 76 65 6E 74 2D 43 61 6C 6C 69 6E 67
>> 2D 46 69 6C 65 3A 20 73 77 69 74 63 68 5F 63 6F 72 65 2E 63 0A 45 76 65 6E
>> 74 2D 43 61 6C 6C 69 6E 67 2D 46 75 6E 63 74 69 6F 6E 3A 20 73 65 6E 64 5F
>> 68 65 61 72 74 62 65 61 74 0A 45 76 65 6E 74 2D 43 61 6C 6C 69 6E 67 2D 4C
>> 69 6E 65 2D 4E 75 6D 62 65 72 3A 20 37 34 0A 0A 43 6F 6E 74 65 6E 74 2D 4C
>> 65 6E 67 74 68 3A 20 34 39 36 0A 43 6F 6E 74 65 6E 74 2D 54 79 70 65 3A 20
>> 74 65 78 74 2F 65 76 65 6E 74 2D 70 6C 61 69 6E 0A 0A 54 61 73 6B 2D 49 44
>> 3A 20 31 0A 54 61 73 6B 2D 44 65 73 63 3A 20 68 65 61 72 74 62 65 61 74 0A
>> 54 61 73 6B 2D 47 72 6F 75 70 3A 20 63 6F 72 65 0A 54 61 73 6B 2D 52 75 6E
>> 74 69 6D 65 3A 20 31 32 31 32 30 37 34 32 34 37 0A 45 76 65 6E 74 2D 4E 61
>> 6D 65 3A 20 52 45 5F 53 43 48 45 44 55 4C 45 0A 43 6F 72 65 2D 55 55 49 44
>> 3A 20 34 62 38 37 64 34 36 61 2D 32 64 38 63 2D 31 31 64 64)
>> at
>>
>> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:165)
>> at
>>
>> org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
>> at
>>
>> org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
>> at
>>
>> org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
>> at
>>
>> org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220)
>> at
>>
>> org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
>> at
>>
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>> at
>>
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>> at
>>
>> org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
>> at java.lang.Thread.run(Thread.java:619)
>> Caused by: java.lang.IllegalStateException: doDecode() can't return true
>> when buffer is not consumed.
>> at
>>
>> org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:136)
>> at
>>
>> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:158)
>> ... 9 more
>> 14:55:26,282 [AnonymousIoService-7] WARN FSProtocolHandler - [/
>> 192.168.3.11:8021] EXCEPTION, please implement
>> com.swn.app.fs.FSProtocolHandler.exceptionCaught() for proper handling:
>> org.apache.mina.filter.codec.ProtocolDecoderException:
>> java.lang.IllegalStateException: doDecode() can't return true when buffer
>> is
>> not consumed. (Hexdump: 65 65 53 57 49 54 43 48 2D 48 6F 73 74 6E 61 6D 65
>> 3A 20 43 4F 41 44 41 49 4E 30 31 0A 46 72 65 65 53 57 49 54 43 48 2D 49 50
>> 76 34 3A 20 31 39 32 2E 31 36 38 2E 33 2E 31 31 0A 46 72 65 65 53 57 49 54
>> 43 48 2D 49 50 76 36 3A 20 31 32 37 2E 30 2E 30 2E 31 0A 45 76 65 6E 74 2D
>> 44 61 74 65 2D 4C 6F 63 61 6C 3A 20 32 30 30 38 2D 30 35 2D 32 39 25 32 30
>> 31 31 25 33 41 31 37 25 33 41 30 37 0A 45 76 65 6E 74 2D 44 61 74 65 2D 47
>> 4D 54 3A 20 54 68 75 2C 25 32 30 32 39 25 32 30 4D 61 79 25 32 30 32 30 30
>> 38 25 32 30 31 35 25 33 41 31 37 25 33 41 30 37 25 32 30 47 4D 54 0A 45 76
>> 65 6E 74 2D 44 61 74 65 2D 74 69 6D 65 73 74 61 6D 70 3A 20 31 32 31 32 30
>> 37 34 32 32 37 34 31 30 32 31 31 0A 45 76 65 6E 74 2D 43 61 6C 6C 69 6E 67
>> 2D 46 69 6C 65 3A 20 73 77 69 74 63 68 5F 63 6F 72 65 2E 63 0A 45 76 65 6E
>> 74 2D 43 61 6C 6C 69 6E 67 2D 46 75 6E 63 74 69 6F 6E 3A 20 73 65 6E 64 5F
>> 68 65 61 72 74 62 65 61 74 0A 45 76 65 6E 74 2D 43 61 6C 6C 69 6E 67 2D 4C
>> 69 6E 65 2D 4E 75 6D 62 65 72 3A 20 37 34 0A 0A 43 6F 6E 74 65 6E 74 2D 4C
>> 65 6E 67 74 68 3A 20 34 39 36 0A 43 6F 6E 74 65 6E 74 2D 54 79 70 65 3A 20
>> 74 65 78 74 2F 65 76 65 6E 74 2D 70 6C 61 69 6E 0A 0A 54 61 73 6B 2D 49 44
>> 3A 20 31 0A 54 61 73 6B 2D 44 65 73 63 3A 20 68 65 61 72 74 62 65 61 74 0A
>> 54 61 73 6B 2D 47 72 6F 75 70 3A 20 63 6F 72 65 0A 54 61 73 6B 2D 52 75 6E
>> 74 69 6D 65 3A 20 31 32 31 32 30 37 34 32 34 37 0A 45 76 65 6E 74 2D 4E 61
>> 6D 65 3A 20 52 45 5F 53 43 48 45 44 55 4C 45 0A 43 6F 72 65 2D 55 55 49 44
>> 3A 20 34 62 38 37 64 34 36 61 2D 32 64 38 63 2D 31 31 64 64)
>> at
>>
>> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:165)
>> at
>>
>> org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
>> at
>>
>> org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
>> at
>>
>> org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
>> at
>>
>> org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220)
>> at
>>
>> org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
>> at
>>
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>> at
>>
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>> at
>>
>> org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
>> at java.lang.Thread.run(Thread.java:619)
>> Caused by: java.lang.IllegalStateException: doDecode() can't return true
>> when buffer is not consumed.
>> at
>>
>> org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:136)
>> at
>>
>> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:158)
>> ... 9 more
>> 14:55:26,282 [AnonymousIoService-7] WARN FSProtocolHandler - [/
>> 192.168.3.11:8021] EXCEPTION:
>> org.apache.mina.filter.codec.ProtocolDecoderException:
>> java.lang.IllegalStateException: doDecode() can't return true when buffer
>> is
>> not consumed. (Hexdump: 2D 61 39 64 35 2D 32 31 65 34 31 33 65 34 30 31 66
>> 63 0A 46 72 65 65 53 57 49 54 43 48 2D 48 6F 73 74 6E 61 6D 65 3A 20 43 4F
>> 41 44 41 49 4E 30 31 0A 46 72 65 65 53 57 49 54 43 48 2D 49 50 76 34 3A 20
>> 31 39 32 2E 31 36 38 2E 33 2E 31 31 0A 46 72 65 65 53 57 49 54 43 48 2D 49
>> 50 76 36 3A 20 31 32 37 2E 30 2E 30 2E 31 0A 45 76 65 6E 74 2D 44 61 74 65
>> 2D 4C 6F 63 61 6C 3A 20 32 30 30 38 2D 30 35 2D 32 39 25 32 30 31 31 25 33
>> 41 31 37 25 33 41 30 37 0A 45 76 65 6E 74 2D 44 61 74 65 2D 47 4D 54 3A 20
>> 54 68 75 2C 25 32 30 32 39 25 32 30 4D 61 79 25 32 30 32 30 30 38 25 32 30
>> 31 35 25 33 41 31 37 25 33 41 30 37 25 32 30 47 4D 54 0A 45 76 65 6E 74 2D
>> 44 61 74 65 2D 74 69 6D 65 73 74 61 6D 70 3A 20 31 32 31 32 30 37 34 32 32
>> 37 34 31 30 32 31 31 0A 45 76 65 6E 74 2D 43 61 6C 6C 69 6E 67 2D 46 69 6C
>> 65 3A 20 73 77 69 74 63 68 5F 73 63 68 65 64 75 6C 65 72 2E 63 0A 45 76 65
>> 6E 74 2D 43 61 6C 6C 69 6E 67 2D 46 75 6E 63 74 69 6F 6E 3A 20 73 77 69 74
>> 63 68 5F 73 63 68 65 64 75 6C 65 72 5F 65 78 65 63 75 74 65 0A 45 76 65 6E
>> 74 2D 43 61 6C 6C 69 6E 67 2D 4C 69 6E 65 2D 4E 75 6D 62 65 72 3A 20 37 30
>> 0A 0A)
>> at
>>
>> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:165)
>> at
>>
>> org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
>> at
>>
>> org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
>> at
>>
>> org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
>> at
>>
>> org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220)
>> at
>>
>> org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
>> at
>>
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>> at
>>
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>> at
>>
>> org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
>> at java.lang.Thread.run(Thread.java:619)
>> Caused by: java.lang.IllegalStateException: doDecode() can't return true
>> when buffer is not consumed.
>> at
>>
>> org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:136)
>> at
>>
>> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:158)
>> ... 9 more
>> 14:55:26,282 [AnonymousIoService-7] WARN FSProtocolHandler - [/
>> 192.168.3.11:8021] EXCEPTION, please implement
>> com.swn.app.fs.FSProtocolHandler.exceptionCaught() for proper handling:
>> org.apache.mina.filter.codec.ProtocolDecoderException:
>> java.lang.IllegalStateException: doDecode() can't return true when buffer
>> is
>> not consumed. (Hexdump: 2D 61 39 64 35 2D 32 31 65 34 31 33 65 34 30 31 66
>> 63 0A 46 72 65 65 53 57 49 54 43 48 2D 48 6F 73 74 6E 61 6D 65 3A 20 43 4F
>> 41 44 41 49 4E 30 31 0A 46 72 65 65 53 57 49 54 43 48 2D 49 50 76 34 3A 20
>> 31 39 32 2E 31 36 38 2E 33 2E 31 31 0A 46 72 65 65 53 57 49 54 43 48 2D 49
>> 50 76 36 3A 20 31 32 37 2E 30 2E 30 2E 31 0A 45 76 65 6E 74 2D 44 61 74 65
>> 2D 4C 6F 63 61 6C 3A 20 32 30 30 38 2D 30 35 2D 32 39 25 32 30 31 31 25 33
>> 41 31 37 25 33 41 30 37 0A 45 76 65 6E 74 2D 44 61 74 65 2D 47 4D 54 3A 20
>> 54 68 75 2C 25 32 30 32 39 25 32 30 4D 61 79 25 32 30 32 30 30 38 25 32 30
>> 31 35 25 33 41 31 37 25 33 41 30 37 25 32 30 47 4D 54 0A 45 76 65 6E 74 2D
>> 44 61 74 65 2D 74 69 6D 65 73 74 61 6D 70 3A 20 31 32 31 32 30 37 34 32 32
>> 37 34 31 30 32 31 31 0A 45 76 65 6E 74 2D 43 61 6C 6C 69 6E 67 2D 46 69 6C
>> 65 3A 20 73 77 69 74 63 68 5F 73 63 68 65 64 75 6C 65 72 2E 63 0A 45 76 65
>> 6E 74 2D 43 61 6C 6C 69 6E 67 2D 46 75 6E 63 74 69 6F 6E 3A 20 73 77 69 74
>> 63 68 5F 73 63 68 65 64 75 6C 65 72 5F 65 78 65 63 75 74 65 0A 45 76 65 6E
>> 74 2D 43 61 6C 6C 69 6E 67 2D 4C 69 6E 65 2D 4E 75 6D 62 65 72 3A 20 37 30
>> 0A 0A)
>> at
>>
>> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:165)
>> at
>>
>> org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
>> at
>>
>> org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
>> at
>>
>> org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
>> at
>>
>> org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220)
>> at
>>
>> org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
>> at
>>
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>> at
>>
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>> at
>>
>> org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
>> at java.lang.Thread.run(Thread.java:619)
>> Caused by: java.lang.IllegalStateException: doDecode() can't return true
>> when buffer is not consumed.
>> at
>>
>> org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:136)
>> at
>>
>> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:158)
>> ... 9 more
>>
>>
>>
>
>
> --
> --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
>
>
>
Re: ByteBuffer Anomaly??
Posted by Emmanuel Lecharny <el...@apache.org>.
Difficult to say from the code and the logs...
ByteBuffer might not contain all the bytes you are expecting, but only
partial data. I see at least a potential failure in
the messageComplet() method :
...
if (in.get(0) == (byte) 'C' && in.get(1) == (byte) 'o' &&
in.get(2) == (byte) 'n' &&
in.get(3) == (byte) 't' && in.get(4) == (byte) 'e' &&
in.get(5) == (byte) 'n' &&
in.get(6) == (byte) 't' && in.get(7) == (byte) '-' &&
in.get(8) == (byte) 'L' &&
in.get(9) == (byte) 'e' && in.get(10) == (byte) 'n' &&
in.get(11) == (byte) 'g' &&
in.get(12) == (byte) 't' && in.get(13) == (byte) 'h')
...
might fail if the incoming ByteBuffer does not contains at least 14
bytes, which is something perfectly possible.
Remember that the server will read all the available bytes, but as those
bytes can be sent in small pieces, you will have to deal with fragments.
Johny Kadarisman wrote:
> Thanks Emmanuel,
>
> I did your suggestion, it seems like still hit same problem.
>
> Here is the complete protocol code, I try to mimic http codec, with some
> customization. Little warning, its quite messy, and i think i need to
> refactor it soon. also, I attached the latest log from my run.
>
> =================================================
>
> import java.io.BufferedReader;
> import java.io.IOException;
> import java.io.Reader;
> import java.io.StringReader;
> import java.nio.charset.CharacterCodingException;
> import java.nio.charset.Charset;
> import java.nio.charset.CharsetDecoder;
>
> import org.apache.mina.common.ByteBuffer;
> import org.apache.mina.common.IoSession;
> import org.apache.mina.filter.codec.ProtocolDecoderOutput;
> import org.apache.mina.filter.codec.demux.MessageDecoderAdapter;
> import org.apache.mina.filter.codec.demux.MessageDecoderResult;
> import org.slf4j.Logger;
> import org.slf4j.LoggerFactory;
>
> public class FSResponseDecoder extends MessageDecoderAdapter {
>
> private final Logger logger = LoggerFactory.getLogger(getClass());
>
> private static final byte[] CONTENT_LENGTH = new
> String("Content-Length:").getBytes();
>
> private CharsetDecoder decoder = Charset.defaultCharset().newDecoder();
>
> public FSResponseDecoder() {
> }
>
> synchronized public MessageDecoderResult decodable(IoSession session,
> ByteBuffer in) {
> try {
> return messageComplete(in) ? MessageDecoderResult.OK
> : MessageDecoderResult.NEED_DATA;
> } catch (Exception ex) {
> ex.printStackTrace();
> }
>
> return MessageDecoderResult.NOT_OK;
> }
>
> public MessageDecoderResult decode(IoSession session, ByteBuffer in,
> ProtocolDecoderOutput out) throws Exception {
> // Try to decode body
>
> logger.debug("[[[[[ Decode function on session "+session);
>
> FSResponse m = decodeBody(in);
>
> // Return NEED_DATA if the body is not fully read.
> if (m == null)
> return MessageDecoderResult.NEED_DATA;
>
> out.write(m);
>
> logger.debug("]]]]] Finish decode function on session "+session);
>
> return MessageDecoderResult.OK;
> }
>
> private String getBufferString(ByteBuffer in) {
> int size = in.remaining();
>
> if (size == 0) {
> return "empty";
> }
>
> StringBuffer out = new StringBuffer(size);
>
> while(in.hasRemaining()) {
> out.append((char) in.get());
> }
>
> in.flip();
>
> return out.toString();
> }
>
> private int getEndOfHeader(ByteBuffer in,int last) {
> int eoh = -1;
> for (int i = 0; i < last; i++) {
> if (in.get(i) == (byte) 0x0A && in.get(i + 1) == (byte) 0x0A) {
> eoh = i + 1;
> break;
> }
> }
> return eoh;
> }
>
> private boolean messageComplete(ByteBuffer in) throws Exception {
> int sizeToRead = 0;
> int last = in.remaining() - 1;
>
> logger.debug("***** New Buffer to analyze *****");
>
> String str = getBufferString(in); // in.getHexDump();
>
> logger.debug("Buffer Dump\n"+str);
>
> int eoh = getEndOfHeader(in, last);
>
> if (eoh == -1)
> return false;
>
>
> if (in.get(0) == (byte) 'C' && in.get(1) == (byte) 'o' &&
> in.get(2) == (byte) 'n' &&
> in.get(3) == (byte) 't' && in.get(4) == (byte) 'e' &&
> in.get(5) == (byte) 'n' &&
> in.get(6) == (byte) 't' && in.get(7) == (byte) '-' &&
> in.get(8) == (byte) 'L' &&
> in.get(9) == (byte) 'e' && in.get(10) == (byte) 'n' &&
> in.get(11) == (byte) 'g' &&
> in.get(12) == (byte) 't' && in.get(13) == (byte) 'h')
> {
>
> int contentLength = getContentLength(in, last);
>
> boolean result;
>
> if (contentLength>0) {
> result = contentLength + eoh <= in.remaining();
> sizeToRead = contentLength + (eoh+1);
> logger.debug("content_length["+contentLength+"] +
> eoh["+eoh+"] == in.remaining["+in.remaining()+"] ==> "+result);
> if (result)
> logger.debug("sizeToRead is >>>> "+sizeToRead);
> }
> else
> result = false;
>
> return (result);
>
> }
>
> sizeToRead = eoh+1;
> logger.debug("sizeToRead is >>>> "+sizeToRead);
>
> return true;
> }
>
>
> private int getContentLength(ByteBuffer in, int last) {
>
> String str = getBufferString(in); // in.getHexDump();
> logger.debug("last = "+last);
> logger.debug("***** Buffer in getContentLength 1 *****\n"+str);
>
> for (int i = 0; i < last; i++) {
> boolean found = false;
> for (int j = 0; j < CONTENT_LENGTH.length; j++) {
> if (in.get(i + j) != CONTENT_LENGTH[j]) {
> found = false;
> break;
> }
> found = true;
> }
> if (found) {
> // retrieve value from this position till next 0x0D 0x0A
> logger.debug("Found content-length index at "+i);
>
> StringBuilder contentLength = new StringBuilder();
> for (int j = i + CONTENT_LENGTH.length; j < last; j++) {
> if (in.get(j) == 0x0A)
> break;
> contentLength.append(new String( new byte[] { in.get(j)
> }));
> logger.debug("["+new String( new byte[]
> {in.get(j)})+"]");
> }
> // if content-length worth of data has been received then
> the message is complete
>
> str = getBufferString(in); // in.getHexDump();
> logger.debug("***** Buffer in getContentLength 2
> *****\n"+str);
>
> logger.debug("ContentLength = "+contentLength);
> logger.debug("total buffer length = "+in.remaining());
> return Integer.parseInt(contentLength.toString().trim());
> }
> }
> return -1;
> }
>
> private FSResponse decodeBody(ByteBuffer in) {
> FSResponse response = new FSResponse();
> try {
>
> int sizeToRead = 0;
> int last = in.remaining() - 1;
> int eoh = getEndOfHeader(in, last);
>
> if (in.get(0) == (byte) 'C' && in.get(1) == (byte) 'o' &&
> in.get(2) == (byte) 'n' &&
> in.get(3) == (byte) 't' && in.get(4) == (byte) 'e'
> && in.get(5) == (byte) 'n' &&
> in.get(6) == (byte) 't' && in.get(7) == (byte) '-'
> && in.get(8) == (byte) 'L' &&
> in.get(9) == (byte) 'e' && in.get(10) == (byte) 'n'
> && in.get(11) == (byte) 'g' &&
> in.get(12) == (byte) 't' && in.get(13) == (byte)
> 'h')
> {
> int contentLength = getContentLength(in, last);
> sizeToRead = contentLength + (eoh+1);
> }
> else
> sizeToRead = eoh+1;
>
> logger.debug("Parsing request with sizeToRead = "+sizeToRead);
> parseRequest(new StringReader(in.getString(sizeToRead,
> decoder)), response);
> return response;
> } catch (CharacterCodingException ex) {
> ex.printStackTrace();
> } catch (Exception e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
>
> return null;
> }
>
> private void parseRequest(Reader is, FSResponse response) {
>
> BufferedReader rdr = new BufferedReader(is);
>
> try {
> // Get request URL.
> String line;
>
> // Read header
> logger.debug("Reading parameters:");
> while ((line = rdr.readLine()) != null && line.length() > 0) {
> String[] tokens = line.split(": ");
> response.setParameters(tokens[0], tokens[1] );
> logger.debug(tokens[0]+": "+tokens[1]);
> }
>
> // determine content-type of this response
> String contentType = response.getParameter("Content-Type");
>
> // If method 'POST' then read Content-Length worth of data
> if (contentType.equalsIgnoreCase("text/event-xml") ||
> contentType.equalsIgnoreCase("text/event-plain")) {
> int len =
> Integer.parseInt(response.getParameter("Content-Length"));
> char[] buf = new char[len];
> if (rdr.read(buf) == len) {
> line = String.copyValueOf(buf);
> }
> String str = line;
> response.setParameters("Event-Data", str);
> }
>
> } catch (IOException ex) {
> ex.printStackTrace();
> }
>
> }
>
> }
>
> ===============================================
>
> 14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - ***** New
> Buffer to analyze *****
> 14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - Buffer Dump
> Content-Type: command/reply
> Reply-Text: +OK accepted
>
>
> 14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - sizeToRead is
>
>>>>> 54
>>>>>
> 14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - [[[[[ Decode
> function on session (SOCKET, R: /192.168.3.11:8021, L: /192.168.150.52:1578,
> S: /192.168.3.11:8021)
> 14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - Parsing
> request with sizeToRead = 54
> 14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - Reading
> parameters:
> 14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - Content-Type:
> command/reply
> 14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - Reply-Text:
> +OK accepted
> 14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - ]]]]] Finish
> decode function on session (SOCKET, R: /192.168.3.11:8021, L: /
> 192.168.150.52:1578, S: /192.168.3.11:8021)
> 14:55:08,253 [AnonymousIoService-4] INFO FSProtocolHandler - [/
> 192.168.3.11:8021] RECEIVED:
> <<<
> Reply-Text: +OK accepted
> Content-Type: command/reply
> <<<
> 14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - ***** New
> Buffer to analyze *****
> 14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - Buffer Dump
> Content-Type: command/reply
> Reply-Text: +OK event listener enabled plain
>
>
> 14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - sizeToRead is
>
>>>>> 74
>>>>>
> 14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - [[[[[ Decode
> function on session (SOCKET, R: /192.168.3.11:8021, L: /192.168.150.52:1578,
> S: /192.168.3.11:8021)
> 14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - Parsing
> request with sizeToRead = 74
> 14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - Reading
> parameters:
> 14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - Content-Type:
> command/reply
> 14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - Reply-Text:
> +OK event listener enabled plain
> 14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - ]]]]] Finish
> decode function on session (SOCKET, R: /192.168.3.11:8021, L: /
> 192.168.150.52:1578, S: /192.168.3.11:8021)
> 14:55:08,519 [AnonymousIoService-5] INFO FSProtocolHandler - [/
> 192.168.3.11:8021] RECEIVED:
> <<<
> Reply-Text: +OK event listener enabled plain
> Content-Type: command/reply
> <<<
> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - ***** New
> Buffer to analyze *****
> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - Buffer Dump
> Content-Length: 589
> Content-Type: text/event-plain
>
>
> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - last = 51
> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 1 *****
> Content-Length: 589
> Content-Type: text/event-plain
>
>
> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - Found
> content-length index at 0
> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - [ ]
> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - [5]
> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - [8]
> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - [9]
> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 2 *****
> Content-Length: 589
> Content-Type: text/event-plain
>
>
> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - ContentLength
> = 589
> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - total buffer
> length = 52
> 14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder -
> content_length[589] + eoh[51] == in.remaining[52] ==> false
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** New
> Buffer to analyze *****
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Buffer Dump
> Content-Length: 589
> Content-Type: text/event-plain
>
> Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> Fr
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 307
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 1 *****
> Content-Length: 589
> Content-Type: text/event-plain
>
> Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> Fr
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
> content-length index at 0
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 2 *****
> Content-Length: 589
> Content-Type: text/event-plain
>
> Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> Fr
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ContentLength
> = 589
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - total buffer
> length = 308
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder -
> content_length[589] + eoh[51] == in.remaining[308] ==> false
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** New
> Buffer to analyze *****
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Buffer Dump
> Content-Length: 589
> Content-Type: text/event-plain
>
> Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_core.c
> Event-Calling-Function: send_heartbeat
> Event-Calling-Line-Number: 74
>
> Content-Length: 496
> Content-Type: text/event-plain
>
> Task-ID: 1
> Task-Desc: heartbeat
> Task-Group: core
> Task-Runtime: 1212074247
> Event-Name: RE_SCHEDULE
> Core-UUID: 4b87d46a-2d8c-11dd
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 819
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 1 *****
> Content-Length: 589
> Content-Type: text/event-plain
>
> Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_core.c
> Event-Calling-Function: send_heartbeat
> Event-Calling-Line-Number: 74
>
> Content-Length: 496
> Content-Type: text/event-plain
>
> Task-ID: 1
> Task-Desc: heartbeat
> Task-Group: core
> Task-Runtime: 1212074247
> Event-Name: RE_SCHEDULE
> Core-UUID: 4b87d46a-2d8c-11dd
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
> content-length index at 0
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 2 *****
> Content-Length: 589
> Content-Type: text/event-plain
>
> Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_core.c
> Event-Calling-Function: send_heartbeat
> Event-Calling-Line-Number: 74
>
> Content-Length: 496
> Content-Type: text/event-plain
>
> Task-ID: 1
> Task-Desc: heartbeat
> Task-Group: core
> Task-Runtime: 1212074247
> Event-Name: RE_SCHEDULE
> Core-UUID: 4b87d46a-2d8c-11dd
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ContentLength
> = 589
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - total buffer
> length = 820
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder -
> content_length[589] + eoh[51] == in.remaining[820] ==> true
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - sizeToRead is
>
>>>>> 641
>>>>>
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [[[[[ Decode
> function on session (SOCKET, R: /192.168.3.11:8021, L: /192.168.150.52:1578,
> S: /192.168.3.11:8021)
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 819
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 1 *****
> Content-Length: 589
> Content-Type: text/event-plain
>
> Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_core.c
> Event-Calling-Function: send_heartbeat
> Event-Calling-Line-Number: 74
>
> Content-Length: 496
> Content-Type: text/event-plain
>
> Task-ID: 1
> Task-Desc: heartbeat
> Task-Group: core
> Task-Runtime: 1212074247
> Event-Name: RE_SCHEDULE
> Core-UUID: 4b87d46a-2d8c-11dd
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
> content-length index at 0
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 2 *****
> Content-Length: 589
> Content-Type: text/event-plain
>
> Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_core.c
> Event-Calling-Function: send_heartbeat
> Event-Calling-Line-Number: 74
>
> Content-Length: 496
> Content-Type: text/event-plain
>
> Task-ID: 1
> Task-Desc: heartbeat
> Task-Group: core
> Task-Runtime: 1212074247
> Event-Name: RE_SCHEDULE
> Core-UUID: 4b87d46a-2d8c-11dd
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ContentLength
> = 589
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - total buffer
> length = 820
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Parsing
> request with sizeToRead = 641
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Reading
> parameters:
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder -
> Content-Length: 589
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Content-Type:
> text/event-plain
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ]]]]] Finish
> decode function on session (SOCKET, R: /192.168.3.11:8021, L: /
> 192.168.150.52:1578, S: /192.168.3.11:8021)
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** New
> Buffer to analyze *****
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Buffer Dump
> Content-Length: 496
> Content-Type: text/event-plain
>
> Task-ID: 1
> Task-Desc: heartbeat
> Task-Group: core
> Task-Runtime: 1212074247
> Event-Name: RE_SCHEDULE
> Core-UUID: 4b87d46a-2d8c-11dd
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 178
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 1 *****
> Content-Length: 589
> Content-Type: text/event-plain
>
> Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_core.c
> Event-Calling-Function: send_heartbeat
> Event-Calling-Line-Number: 74
>
> Content-Length: 496
> Content-Type: text/event-plain
>
> Task-ID: 1
> Task-Desc: heartbeat
> Task-Group: core
> Task-Runtime: 1212074247
> Event-Name: RE_SCHEDULE
> Core-UUID: 4b87d46a-2d8c-11dd
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
> content-length index at 0
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
> 14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 2 *****
> Content-Length: 589
> Content-Type: text/event-plain
>
> Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_core.c
> Event-Calling-Function: send_heartbeat
> Event-Calling-Line-Number: 74
>
> Content-Length: 496
> Content-Type: text/event-plain
>
> Task-ID: 1
> Task-Desc: heartbeat
> Task-Group: core
> Task-Runtime: 1212074247
> Event-Name: RE_SCHEDULE
> Core-UUID: 4b87d46a-2d8c-11dd
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ContentLength
> = 589
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - total buffer
> length = 820
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
> content_length[589] + eoh[51] == in.remaining[820] ==> true
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - sizeToRead is
>
>>>>> 641
>>>>>
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [[[[[ Decode
> function on session (SOCKET, R: /192.168.3.11:8021, L: /192.168.150.52:1578,
> S: /192.168.3.11:8021)
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 178
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 1 *****
> Content-Length: 496
> Content-Type: text/event-plain
>
> Task-ID: 1
> Task-Desc: heartbeat
> Task-Group: core
> Task-Runtime: 1212074247
> Event-Name: RE_SCHEDULE
> Core-UUID: 4b87d46a-2d8c-11dd
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
> content-length index at 0
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 2 *****
> Content-Length: 589
> Content-Type: text/event-plain
>
> Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_core.c
> Event-Calling-Function: send_heartbeat
> Event-Calling-Line-Number: 74
>
> Content-Length: 496
> Content-Type: text/event-plain
>
> Task-ID: 1
> Task-Desc: heartbeat
> Task-Group: core
> Task-Runtime: 1212074247
> Event-Name: RE_SCHEDULE
> Core-UUID: 4b87d46a-2d8c-11dd
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ContentLength
> = 589
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - total buffer
> length = 820
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Parsing
> request with sizeToRead = 641
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Reading
> parameters:
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
> Content-Length: 589
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Content-Type:
> text/event-plain
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ]]]]] Finish
> decode function on session (SOCKET, R: /192.168.3.11:8021, L: /
> 192.168.150.52:1578, S: /192.168.3.11:8021)
> 14:55:26,282 [AnonymousIoService-7] INFO FSProtocolHandler - [/
> 192.168.3.11:8021] RECEIVED:
> <<<
> Event-Data: Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_core.c
> Event-Calling-Function: send_heartbeat
> Event-Calling-Line-Number: 74
>
>
> Content-Length: 589
> Content-Type: text/event-plain
> <<<
> 14:55:26,282 [AnonymousIoService-7] INFO FSProtocolHandler - [/
> 192.168.3.11:8021] RECEIVED:
> <<<
> Event-Data: Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_core.c
> Event-Calling-Function: send_heartbeat
> Event-Calling-Line-Number: 74
>
>
> Content-Length: 589
> Content-Type: text/event-plain
> <<<
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** New
> Buffer to analyze *****
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Buffer Dump
> Content-Length: 589
> Content-Type: text/event-plain
>
> Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_core.c
> Event-Calling-Function: send_heartbeat
> Event-Calling-Line-Number: 74
>
> -a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_scheduler.c
> Event-Calling-Function: switch_scheduler_execute
> Event-Calling-Line-Number: 70
>
>
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 1009
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 1 *****
> Content-Length: 589
> Content-Type: text/event-plain
>
> Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_core.c
> Event-Calling-Function: send_heartbeat
> Event-Calling-Line-Number: 74
>
> -a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_scheduler.c
> Event-Calling-Function: switch_scheduler_execute
> Event-Calling-Line-Number: 70
>
>
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
> content-length index at 0
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 2 *****
> Content-Length: 589
> Content-Type: text/event-plain
>
> Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_core.c
> Event-Calling-Function: send_heartbeat
> Event-Calling-Line-Number: 74
>
> -a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_scheduler.c
> Event-Calling-Function: switch_scheduler_execute
> Event-Calling-Line-Number: 70
>
>
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ContentLength
> = 589
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - total buffer
> length = 1010
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
> content_length[589] + eoh[51] == in.remaining[1010] ==> true
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - sizeToRead is
>
>>>>> 641
>>>>>
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [[[[[ Decode
> function on session (SOCKET, R: /192.168.3.11:8021, L: /192.168.150.52:1578,
> S: /192.168.3.11:8021)
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 1009
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 1 *****
> Content-Length: 589
> Content-Type: text/event-plain
>
> Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_core.c
> Event-Calling-Function: send_heartbeat
> Event-Calling-Line-Number: 74
>
> -a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_scheduler.c
> Event-Calling-Function: switch_scheduler_execute
> Event-Calling-Line-Number: 70
>
>
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
> content-length index at 0
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 2 *****
> Content-Length: 589
> Content-Type: text/event-plain
>
> Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_core.c
> Event-Calling-Function: send_heartbeat
> Event-Calling-Line-Number: 74
>
> -a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_scheduler.c
> Event-Calling-Function: switch_scheduler_execute
> Event-Calling-Line-Number: 70
>
>
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ContentLength
> = 589
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - total buffer
> length = 1010
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Parsing
> request with sizeToRead = 641
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Reading
> parameters:
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
> Content-Length: 589
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Content-Type:
> text/event-plain
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ]]]]] Finish
> decode function on session (SOCKET, R: /192.168.3.11:8021, L: /
> 192.168.150.52:1578, S: /192.168.3.11:8021)
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** New
> Buffer to analyze *****
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Buffer Dump
> -a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_scheduler.c
> Event-Calling-Function: switch_scheduler_execute
> Event-Calling-Line-Number: 70
>
>
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 368
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 1 *****
> Content-Length: 589
> Content-Type: text/event-plain
>
> Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_core.c
> Event-Calling-Function: send_heartbeat
> Event-Calling-Line-Number: 74
>
> -a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_scheduler.c
> Event-Calling-Function: switch_scheduler_execute
> Event-Calling-Line-Number: 70
>
>
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
> content-length index at 0
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 2 *****
> Content-Length: 589
> Content-Type: text/event-plain
>
> Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_core.c
> Event-Calling-Function: send_heartbeat
> Event-Calling-Line-Number: 74
>
> -a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_scheduler.c
> Event-Calling-Function: switch_scheduler_execute
> Event-Calling-Line-Number: 70
>
>
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ContentLength
> = 589
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - total buffer
> length = 1010
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
> content_length[589] + eoh[51] == in.remaining[1010] ==> true
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - sizeToRead is
>
>>>>> 641
>>>>>
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [[[[[ Decode
> function on session (SOCKET, R: /192.168.3.11:8021, L: /192.168.150.52:1578,
> S: /192.168.3.11:8021)
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 368
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 1 *****
> -a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_scheduler.c
> Event-Calling-Function: switch_scheduler_execute
> Event-Calling-Line-Number: 70
>
>
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
> content-length index at 0
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 2 *****
> Content-Length: 589
> Content-Type: text/event-plain
>
> Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_core.c
> Event-Calling-Function: send_heartbeat
> Event-Calling-Line-Number: 74
>
> -a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_scheduler.c
> Event-Calling-Function: switch_scheduler_execute
> Event-Calling-Line-Number: 70
>
>
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ContentLength
> = 589
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - total buffer
> length = 1010
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Parsing
> request with sizeToRead = 641
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Reading
> parameters:
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
> Content-Length: 589
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Content-Type:
> text/event-plain
> 14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ]]]]] Finish
> decode function on session (SOCKET, R: /192.168.3.11:8021, L: /
> 192.168.150.52:1578, S: /192.168.3.11:8021)
> 14:55:26,282 [AnonymousIoService-7] INFO FSProtocolHandler - [/
> 192.168.3.11:8021] RECEIVED:
> <<<
> Event-Data: Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_core.c
> Event-Calling-Function: send_heartbeat
> Event-Calling-Line-Number: 74
>
>
> Content-Length: 589
> Content-Type: text/event-plain
> <<<
> 14:55:26,282 [AnonymousIoService-7] INFO FSProtocolHandler - [/
> 192.168.3.11:8021] RECEIVED:
> <<<
> Event-Data: Event-Info: System%20Ready
> Up-Time:
> 0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
> Session-Count: 0
> Session-Per-Sec: 30
> Event-Name: HEARTBEAT
> Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
> FreeSWITCH-Hostname: COADAIN01
> FreeSWITCH-IPv4: 192.168.3.11
> FreeSWITCH-IPv6: 127.0.0.1
> Event-Date-Local: 2008-05-29%2011%3A17%3A07
> Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
> Event-Date-timestamp: 1212074227410211
> Event-Calling-File: switch_core.c
> Event-Calling-Function: send_heartbeat
> Event-Calling-Line-Number: 74
>
>
> Content-Length: 589
> Content-Type: text/event-plain
> <<<
> 14:55:26,282 [AnonymousIoService-7] WARN FSProtocolHandler - [/
> 192.168.3.11:8021] EXCEPTION:
> org.apache.mina.filter.codec.ProtocolDecoderException:
> java.lang.IllegalStateException: doDecode() can't return true when buffer is
> not consumed. (Hexdump: 65 65 53 57 49 54 43 48 2D 48 6F 73 74 6E 61 6D 65
> 3A 20 43 4F 41 44 41 49 4E 30 31 0A 46 72 65 65 53 57 49 54 43 48 2D 49 50
> 76 34 3A 20 31 39 32 2E 31 36 38 2E 33 2E 31 31 0A 46 72 65 65 53 57 49 54
> 43 48 2D 49 50 76 36 3A 20 31 32 37 2E 30 2E 30 2E 31 0A 45 76 65 6E 74 2D
> 44 61 74 65 2D 4C 6F 63 61 6C 3A 20 32 30 30 38 2D 30 35 2D 32 39 25 32 30
> 31 31 25 33 41 31 37 25 33 41 30 37 0A 45 76 65 6E 74 2D 44 61 74 65 2D 47
> 4D 54 3A 20 54 68 75 2C 25 32 30 32 39 25 32 30 4D 61 79 25 32 30 32 30 30
> 38 25 32 30 31 35 25 33 41 31 37 25 33 41 30 37 25 32 30 47 4D 54 0A 45 76
> 65 6E 74 2D 44 61 74 65 2D 74 69 6D 65 73 74 61 6D 70 3A 20 31 32 31 32 30
> 37 34 32 32 37 34 31 30 32 31 31 0A 45 76 65 6E 74 2D 43 61 6C 6C 69 6E 67
> 2D 46 69 6C 65 3A 20 73 77 69 74 63 68 5F 63 6F 72 65 2E 63 0A 45 76 65 6E
> 74 2D 43 61 6C 6C 69 6E 67 2D 46 75 6E 63 74 69 6F 6E 3A 20 73 65 6E 64 5F
> 68 65 61 72 74 62 65 61 74 0A 45 76 65 6E 74 2D 43 61 6C 6C 69 6E 67 2D 4C
> 69 6E 65 2D 4E 75 6D 62 65 72 3A 20 37 34 0A 0A 43 6F 6E 74 65 6E 74 2D 4C
> 65 6E 67 74 68 3A 20 34 39 36 0A 43 6F 6E 74 65 6E 74 2D 54 79 70 65 3A 20
> 74 65 78 74 2F 65 76 65 6E 74 2D 70 6C 61 69 6E 0A 0A 54 61 73 6B 2D 49 44
> 3A 20 31 0A 54 61 73 6B 2D 44 65 73 63 3A 20 68 65 61 72 74 62 65 61 74 0A
> 54 61 73 6B 2D 47 72 6F 75 70 3A 20 63 6F 72 65 0A 54 61 73 6B 2D 52 75 6E
> 74 69 6D 65 3A 20 31 32 31 32 30 37 34 32 34 37 0A 45 76 65 6E 74 2D 4E 61
> 6D 65 3A 20 52 45 5F 53 43 48 45 44 55 4C 45 0A 43 6F 72 65 2D 55 55 49 44
> 3A 20 34 62 38 37 64 34 36 61 2D 32 64 38 63 2D 31 31 64 64)
> at
> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:165)
> at
> org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
> at
> org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
> at
> org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
> at
> org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220)
> at
> org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> at
> org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.IllegalStateException: doDecode() can't return true
> when buffer is not consumed.
> at
> org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:136)
> at
> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:158)
> ... 9 more
> 14:55:26,282 [AnonymousIoService-7] WARN FSProtocolHandler - [/
> 192.168.3.11:8021] EXCEPTION, please implement
> com.swn.app.fs.FSProtocolHandler.exceptionCaught() for proper handling:
> org.apache.mina.filter.codec.ProtocolDecoderException:
> java.lang.IllegalStateException: doDecode() can't return true when buffer is
> not consumed. (Hexdump: 65 65 53 57 49 54 43 48 2D 48 6F 73 74 6E 61 6D 65
> 3A 20 43 4F 41 44 41 49 4E 30 31 0A 46 72 65 65 53 57 49 54 43 48 2D 49 50
> 76 34 3A 20 31 39 32 2E 31 36 38 2E 33 2E 31 31 0A 46 72 65 65 53 57 49 54
> 43 48 2D 49 50 76 36 3A 20 31 32 37 2E 30 2E 30 2E 31 0A 45 76 65 6E 74 2D
> 44 61 74 65 2D 4C 6F 63 61 6C 3A 20 32 30 30 38 2D 30 35 2D 32 39 25 32 30
> 31 31 25 33 41 31 37 25 33 41 30 37 0A 45 76 65 6E 74 2D 44 61 74 65 2D 47
> 4D 54 3A 20 54 68 75 2C 25 32 30 32 39 25 32 30 4D 61 79 25 32 30 32 30 30
> 38 25 32 30 31 35 25 33 41 31 37 25 33 41 30 37 25 32 30 47 4D 54 0A 45 76
> 65 6E 74 2D 44 61 74 65 2D 74 69 6D 65 73 74 61 6D 70 3A 20 31 32 31 32 30
> 37 34 32 32 37 34 31 30 32 31 31 0A 45 76 65 6E 74 2D 43 61 6C 6C 69 6E 67
> 2D 46 69 6C 65 3A 20 73 77 69 74 63 68 5F 63 6F 72 65 2E 63 0A 45 76 65 6E
> 74 2D 43 61 6C 6C 69 6E 67 2D 46 75 6E 63 74 69 6F 6E 3A 20 73 65 6E 64 5F
> 68 65 61 72 74 62 65 61 74 0A 45 76 65 6E 74 2D 43 61 6C 6C 69 6E 67 2D 4C
> 69 6E 65 2D 4E 75 6D 62 65 72 3A 20 37 34 0A 0A 43 6F 6E 74 65 6E 74 2D 4C
> 65 6E 67 74 68 3A 20 34 39 36 0A 43 6F 6E 74 65 6E 74 2D 54 79 70 65 3A 20
> 74 65 78 74 2F 65 76 65 6E 74 2D 70 6C 61 69 6E 0A 0A 54 61 73 6B 2D 49 44
> 3A 20 31 0A 54 61 73 6B 2D 44 65 73 63 3A 20 68 65 61 72 74 62 65 61 74 0A
> 54 61 73 6B 2D 47 72 6F 75 70 3A 20 63 6F 72 65 0A 54 61 73 6B 2D 52 75 6E
> 74 69 6D 65 3A 20 31 32 31 32 30 37 34 32 34 37 0A 45 76 65 6E 74 2D 4E 61
> 6D 65 3A 20 52 45 5F 53 43 48 45 44 55 4C 45 0A 43 6F 72 65 2D 55 55 49 44
> 3A 20 34 62 38 37 64 34 36 61 2D 32 64 38 63 2D 31 31 64 64)
> at
> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:165)
> at
> org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
> at
> org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
> at
> org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
> at
> org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220)
> at
> org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> at
> org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.IllegalStateException: doDecode() can't return true
> when buffer is not consumed.
> at
> org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:136)
> at
> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:158)
> ... 9 more
> 14:55:26,282 [AnonymousIoService-7] WARN FSProtocolHandler - [/
> 192.168.3.11:8021] EXCEPTION:
> org.apache.mina.filter.codec.ProtocolDecoderException:
> java.lang.IllegalStateException: doDecode() can't return true when buffer is
> not consumed. (Hexdump: 2D 61 39 64 35 2D 32 31 65 34 31 33 65 34 30 31 66
> 63 0A 46 72 65 65 53 57 49 54 43 48 2D 48 6F 73 74 6E 61 6D 65 3A 20 43 4F
> 41 44 41 49 4E 30 31 0A 46 72 65 65 53 57 49 54 43 48 2D 49 50 76 34 3A 20
> 31 39 32 2E 31 36 38 2E 33 2E 31 31 0A 46 72 65 65 53 57 49 54 43 48 2D 49
> 50 76 36 3A 20 31 32 37 2E 30 2E 30 2E 31 0A 45 76 65 6E 74 2D 44 61 74 65
> 2D 4C 6F 63 61 6C 3A 20 32 30 30 38 2D 30 35 2D 32 39 25 32 30 31 31 25 33
> 41 31 37 25 33 41 30 37 0A 45 76 65 6E 74 2D 44 61 74 65 2D 47 4D 54 3A 20
> 54 68 75 2C 25 32 30 32 39 25 32 30 4D 61 79 25 32 30 32 30 30 38 25 32 30
> 31 35 25 33 41 31 37 25 33 41 30 37 25 32 30 47 4D 54 0A 45 76 65 6E 74 2D
> 44 61 74 65 2D 74 69 6D 65 73 74 61 6D 70 3A 20 31 32 31 32 30 37 34 32 32
> 37 34 31 30 32 31 31 0A 45 76 65 6E 74 2D 43 61 6C 6C 69 6E 67 2D 46 69 6C
> 65 3A 20 73 77 69 74 63 68 5F 73 63 68 65 64 75 6C 65 72 2E 63 0A 45 76 65
> 6E 74 2D 43 61 6C 6C 69 6E 67 2D 46 75 6E 63 74 69 6F 6E 3A 20 73 77 69 74
> 63 68 5F 73 63 68 65 64 75 6C 65 72 5F 65 78 65 63 75 74 65 0A 45 76 65 6E
> 74 2D 43 61 6C 6C 69 6E 67 2D 4C 69 6E 65 2D 4E 75 6D 62 65 72 3A 20 37 30
> 0A 0A)
> at
> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:165)
> at
> org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
> at
> org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
> at
> org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
> at
> org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220)
> at
> org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> at
> org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.IllegalStateException: doDecode() can't return true
> when buffer is not consumed.
> at
> org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:136)
> at
> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:158)
> ... 9 more
> 14:55:26,282 [AnonymousIoService-7] WARN FSProtocolHandler - [/
> 192.168.3.11:8021] EXCEPTION, please implement
> com.swn.app.fs.FSProtocolHandler.exceptionCaught() for proper handling:
> org.apache.mina.filter.codec.ProtocolDecoderException:
> java.lang.IllegalStateException: doDecode() can't return true when buffer is
> not consumed. (Hexdump: 2D 61 39 64 35 2D 32 31 65 34 31 33 65 34 30 31 66
> 63 0A 46 72 65 65 53 57 49 54 43 48 2D 48 6F 73 74 6E 61 6D 65 3A 20 43 4F
> 41 44 41 49 4E 30 31 0A 46 72 65 65 53 57 49 54 43 48 2D 49 50 76 34 3A 20
> 31 39 32 2E 31 36 38 2E 33 2E 31 31 0A 46 72 65 65 53 57 49 54 43 48 2D 49
> 50 76 36 3A 20 31 32 37 2E 30 2E 30 2E 31 0A 45 76 65 6E 74 2D 44 61 74 65
> 2D 4C 6F 63 61 6C 3A 20 32 30 30 38 2D 30 35 2D 32 39 25 32 30 31 31 25 33
> 41 31 37 25 33 41 30 37 0A 45 76 65 6E 74 2D 44 61 74 65 2D 47 4D 54 3A 20
> 54 68 75 2C 25 32 30 32 39 25 32 30 4D 61 79 25 32 30 32 30 30 38 25 32 30
> 31 35 25 33 41 31 37 25 33 41 30 37 25 32 30 47 4D 54 0A 45 76 65 6E 74 2D
> 44 61 74 65 2D 74 69 6D 65 73 74 61 6D 70 3A 20 31 32 31 32 30 37 34 32 32
> 37 34 31 30 32 31 31 0A 45 76 65 6E 74 2D 43 61 6C 6C 69 6E 67 2D 46 69 6C
> 65 3A 20 73 77 69 74 63 68 5F 73 63 68 65 64 75 6C 65 72 2E 63 0A 45 76 65
> 6E 74 2D 43 61 6C 6C 69 6E 67 2D 46 75 6E 63 74 69 6F 6E 3A 20 73 77 69 74
> 63 68 5F 73 63 68 65 64 75 6C 65 72 5F 65 78 65 63 75 74 65 0A 45 76 65 6E
> 74 2D 43 61 6C 6C 69 6E 67 2D 4C 69 6E 65 2D 4E 75 6D 62 65 72 3A 20 37 30
> 0A 0A)
> at
> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:165)
> at
> org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
> at
> org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
> at
> org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
> at
> org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220)
> at
> org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> at
> org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.IllegalStateException: doDecode() can't return true
> when buffer is not consumed.
> at
> org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:136)
> at
> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:158)
> ... 9 more
>
>
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
Re: ByteBuffer Anomaly??
Posted by Johny Kadarisman <jk...@gmail.com>.
Thanks Emmanuel,
I did your suggestion, it seems like still hit same problem.
Here is the complete protocol code, I try to mimic http codec, with some
customization. Little warning, its quite messy, and i think i need to
refactor it soon. also, I attached the latest log from my run.
=================================================
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import org.apache.mina.common.ByteBuffer;
import org.apache.mina.common.IoSession;
import org.apache.mina.filter.codec.ProtocolDecoderOutput;
import org.apache.mina.filter.codec.demux.MessageDecoderAdapter;
import org.apache.mina.filter.codec.demux.MessageDecoderResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class FSResponseDecoder extends MessageDecoderAdapter {
private final Logger logger = LoggerFactory.getLogger(getClass());
private static final byte[] CONTENT_LENGTH = new
String("Content-Length:").getBytes();
private CharsetDecoder decoder = Charset.defaultCharset().newDecoder();
public FSResponseDecoder() {
}
synchronized public MessageDecoderResult decodable(IoSession session,
ByteBuffer in) {
try {
return messageComplete(in) ? MessageDecoderResult.OK
: MessageDecoderResult.NEED_DATA;
} catch (Exception ex) {
ex.printStackTrace();
}
return MessageDecoderResult.NOT_OK;
}
public MessageDecoderResult decode(IoSession session, ByteBuffer in,
ProtocolDecoderOutput out) throws Exception {
// Try to decode body
logger.debug("[[[[[ Decode function on session "+session);
FSResponse m = decodeBody(in);
// Return NEED_DATA if the body is not fully read.
if (m == null)
return MessageDecoderResult.NEED_DATA;
out.write(m);
logger.debug("]]]]] Finish decode function on session "+session);
return MessageDecoderResult.OK;
}
private String getBufferString(ByteBuffer in) {
int size = in.remaining();
if (size == 0) {
return "empty";
}
StringBuffer out = new StringBuffer(size);
while(in.hasRemaining()) {
out.append((char) in.get());
}
in.flip();
return out.toString();
}
private int getEndOfHeader(ByteBuffer in,int last) {
int eoh = -1;
for (int i = 0; i < last; i++) {
if (in.get(i) == (byte) 0x0A && in.get(i + 1) == (byte) 0x0A) {
eoh = i + 1;
break;
}
}
return eoh;
}
private boolean messageComplete(ByteBuffer in) throws Exception {
int sizeToRead = 0;
int last = in.remaining() - 1;
logger.debug("***** New Buffer to analyze *****");
String str = getBufferString(in); // in.getHexDump();
logger.debug("Buffer Dump\n"+str);
int eoh = getEndOfHeader(in, last);
if (eoh == -1)
return false;
if (in.get(0) == (byte) 'C' && in.get(1) == (byte) 'o' &&
in.get(2) == (byte) 'n' &&
in.get(3) == (byte) 't' && in.get(4) == (byte) 'e' &&
in.get(5) == (byte) 'n' &&
in.get(6) == (byte) 't' && in.get(7) == (byte) '-' &&
in.get(8) == (byte) 'L' &&
in.get(9) == (byte) 'e' && in.get(10) == (byte) 'n' &&
in.get(11) == (byte) 'g' &&
in.get(12) == (byte) 't' && in.get(13) == (byte) 'h')
{
int contentLength = getContentLength(in, last);
boolean result;
if (contentLength>0) {
result = contentLength + eoh <= in.remaining();
sizeToRead = contentLength + (eoh+1);
logger.debug("content_length["+contentLength+"] +
eoh["+eoh+"] == in.remaining["+in.remaining()+"] ==> "+result);
if (result)
logger.debug("sizeToRead is >>>> "+sizeToRead);
}
else
result = false;
return (result);
}
sizeToRead = eoh+1;
logger.debug("sizeToRead is >>>> "+sizeToRead);
return true;
}
private int getContentLength(ByteBuffer in, int last) {
String str = getBufferString(in); // in.getHexDump();
logger.debug("last = "+last);
logger.debug("***** Buffer in getContentLength 1 *****\n"+str);
for (int i = 0; i < last; i++) {
boolean found = false;
for (int j = 0; j < CONTENT_LENGTH.length; j++) {
if (in.get(i + j) != CONTENT_LENGTH[j]) {
found = false;
break;
}
found = true;
}
if (found) {
// retrieve value from this position till next 0x0D 0x0A
logger.debug("Found content-length index at "+i);
StringBuilder contentLength = new StringBuilder();
for (int j = i + CONTENT_LENGTH.length; j < last; j++) {
if (in.get(j) == 0x0A)
break;
contentLength.append(new String( new byte[] { in.get(j)
}));
logger.debug("["+new String( new byte[]
{in.get(j)})+"]");
}
// if content-length worth of data has been received then
the message is complete
str = getBufferString(in); // in.getHexDump();
logger.debug("***** Buffer in getContentLength 2
*****\n"+str);
logger.debug("ContentLength = "+contentLength);
logger.debug("total buffer length = "+in.remaining());
return Integer.parseInt(contentLength.toString().trim());
}
}
return -1;
}
private FSResponse decodeBody(ByteBuffer in) {
FSResponse response = new FSResponse();
try {
int sizeToRead = 0;
int last = in.remaining() - 1;
int eoh = getEndOfHeader(in, last);
if (in.get(0) == (byte) 'C' && in.get(1) == (byte) 'o' &&
in.get(2) == (byte) 'n' &&
in.get(3) == (byte) 't' && in.get(4) == (byte) 'e'
&& in.get(5) == (byte) 'n' &&
in.get(6) == (byte) 't' && in.get(7) == (byte) '-'
&& in.get(8) == (byte) 'L' &&
in.get(9) == (byte) 'e' && in.get(10) == (byte) 'n'
&& in.get(11) == (byte) 'g' &&
in.get(12) == (byte) 't' && in.get(13) == (byte)
'h')
{
int contentLength = getContentLength(in, last);
sizeToRead = contentLength + (eoh+1);
}
else
sizeToRead = eoh+1;
logger.debug("Parsing request with sizeToRead = "+sizeToRead);
parseRequest(new StringReader(in.getString(sizeToRead,
decoder)), response);
return response;
} catch (CharacterCodingException ex) {
ex.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
private void parseRequest(Reader is, FSResponse response) {
BufferedReader rdr = new BufferedReader(is);
try {
// Get request URL.
String line;
// Read header
logger.debug("Reading parameters:");
while ((line = rdr.readLine()) != null && line.length() > 0) {
String[] tokens = line.split(": ");
response.setParameters(tokens[0], tokens[1] );
logger.debug(tokens[0]+": "+tokens[1]);
}
// determine content-type of this response
String contentType = response.getParameter("Content-Type");
// If method 'POST' then read Content-Length worth of data
if (contentType.equalsIgnoreCase("text/event-xml") ||
contentType.equalsIgnoreCase("text/event-plain")) {
int len =
Integer.parseInt(response.getParameter("Content-Length"));
char[] buf = new char[len];
if (rdr.read(buf) == len) {
line = String.copyValueOf(buf);
}
String str = line;
response.setParameters("Event-Data", str);
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
===============================================
14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - ***** New
Buffer to analyze *****
14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - Buffer Dump
Content-Type: command/reply
Reply-Text: +OK accepted
14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - sizeToRead is
>>>> 54
14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - [[[[[ Decode
function on session (SOCKET, R: /192.168.3.11:8021, L: /192.168.150.52:1578,
S: /192.168.3.11:8021)
14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - Parsing
request with sizeToRead = 54
14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - Reading
parameters:
14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - Content-Type:
command/reply
14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - Reply-Text:
+OK accepted
14:55:08,253 [AnonymousIoService-4] DEBUG FSResponseDecoder - ]]]]] Finish
decode function on session (SOCKET, R: /192.168.3.11:8021, L: /
192.168.150.52:1578, S: /192.168.3.11:8021)
14:55:08,253 [AnonymousIoService-4] INFO FSProtocolHandler - [/
192.168.3.11:8021] RECEIVED:
<<<
Reply-Text: +OK accepted
Content-Type: command/reply
<<<
14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - ***** New
Buffer to analyze *****
14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - Buffer Dump
Content-Type: command/reply
Reply-Text: +OK event listener enabled plain
14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - sizeToRead is
>>>> 74
14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - [[[[[ Decode
function on session (SOCKET, R: /192.168.3.11:8021, L: /192.168.150.52:1578,
S: /192.168.3.11:8021)
14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - Parsing
request with sizeToRead = 74
14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - Reading
parameters:
14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - Content-Type:
command/reply
14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - Reply-Text:
+OK event listener enabled plain
14:55:08,519 [AnonymousIoService-5] DEBUG FSResponseDecoder - ]]]]] Finish
decode function on session (SOCKET, R: /192.168.3.11:8021, L: /
192.168.150.52:1578, S: /192.168.3.11:8021)
14:55:08,519 [AnonymousIoService-5] INFO FSProtocolHandler - [/
192.168.3.11:8021] RECEIVED:
<<<
Reply-Text: +OK event listener enabled plain
Content-Type: command/reply
<<<
14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - ***** New
Buffer to analyze *****
14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - Buffer Dump
Content-Length: 589
Content-Type: text/event-plain
14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - last = 51
14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 1 *****
Content-Length: 589
Content-Type: text/event-plain
14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - Found
content-length index at 0
14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - [ ]
14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - [5]
14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - [8]
14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - [9]
14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 2 *****
Content-Length: 589
Content-Type: text/event-plain
14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - ContentLength
= 589
14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder - total buffer
length = 52
14:55:26,063 [AnonymousIoService-6] DEBUG FSResponseDecoder -
content_length[589] + eoh[51] == in.remaining[52] ==> false
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** New
Buffer to analyze *****
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Buffer Dump
Content-Length: 589
Content-Type: text/event-plain
Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
Fr
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 307
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 1 *****
Content-Length: 589
Content-Type: text/event-plain
Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
Fr
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
content-length index at 0
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 2 *****
Content-Length: 589
Content-Type: text/event-plain
Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
Fr
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ContentLength
= 589
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - total buffer
length = 308
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder -
content_length[589] + eoh[51] == in.remaining[308] ==> false
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** New
Buffer to analyze *****
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Buffer Dump
Content-Length: 589
Content-Type: text/event-plain
Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74
Content-Length: 496
Content-Type: text/event-plain
Task-ID: 1
Task-Desc: heartbeat
Task-Group: core
Task-Runtime: 1212074247
Event-Name: RE_SCHEDULE
Core-UUID: 4b87d46a-2d8c-11dd
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 819
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 1 *****
Content-Length: 589
Content-Type: text/event-plain
Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74
Content-Length: 496
Content-Type: text/event-plain
Task-ID: 1
Task-Desc: heartbeat
Task-Group: core
Task-Runtime: 1212074247
Event-Name: RE_SCHEDULE
Core-UUID: 4b87d46a-2d8c-11dd
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
content-length index at 0
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 2 *****
Content-Length: 589
Content-Type: text/event-plain
Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74
Content-Length: 496
Content-Type: text/event-plain
Task-ID: 1
Task-Desc: heartbeat
Task-Group: core
Task-Runtime: 1212074247
Event-Name: RE_SCHEDULE
Core-UUID: 4b87d46a-2d8c-11dd
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ContentLength
= 589
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - total buffer
length = 820
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder -
content_length[589] + eoh[51] == in.remaining[820] ==> true
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - sizeToRead is
>>>> 641
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [[[[[ Decode
function on session (SOCKET, R: /192.168.3.11:8021, L: /192.168.150.52:1578,
S: /192.168.3.11:8021)
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 819
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 1 *****
Content-Length: 589
Content-Type: text/event-plain
Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74
Content-Length: 496
Content-Type: text/event-plain
Task-ID: 1
Task-Desc: heartbeat
Task-Group: core
Task-Runtime: 1212074247
Event-Name: RE_SCHEDULE
Core-UUID: 4b87d46a-2d8c-11dd
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
content-length index at 0
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 2 *****
Content-Length: 589
Content-Type: text/event-plain
Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74
Content-Length: 496
Content-Type: text/event-plain
Task-ID: 1
Task-Desc: heartbeat
Task-Group: core
Task-Runtime: 1212074247
Event-Name: RE_SCHEDULE
Core-UUID: 4b87d46a-2d8c-11dd
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ContentLength
= 589
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - total buffer
length = 820
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Parsing
request with sizeToRead = 641
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Reading
parameters:
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder -
Content-Length: 589
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Content-Type:
text/event-plain
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ]]]]] Finish
decode function on session (SOCKET, R: /192.168.3.11:8021, L: /
192.168.150.52:1578, S: /192.168.3.11:8021)
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** New
Buffer to analyze *****
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Buffer Dump
Content-Length: 496
Content-Type: text/event-plain
Task-ID: 1
Task-Desc: heartbeat
Task-Group: core
Task-Runtime: 1212074247
Event-Name: RE_SCHEDULE
Core-UUID: 4b87d46a-2d8c-11dd
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 178
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 1 *****
Content-Length: 589
Content-Type: text/event-plain
Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74
Content-Length: 496
Content-Type: text/event-plain
Task-ID: 1
Task-Desc: heartbeat
Task-Group: core
Task-Runtime: 1212074247
Event-Name: RE_SCHEDULE
Core-UUID: 4b87d46a-2d8c-11dd
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
content-length index at 0
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
14:55:26,266 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 2 *****
Content-Length: 589
Content-Type: text/event-plain
Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74
Content-Length: 496
Content-Type: text/event-plain
Task-ID: 1
Task-Desc: heartbeat
Task-Group: core
Task-Runtime: 1212074247
Event-Name: RE_SCHEDULE
Core-UUID: 4b87d46a-2d8c-11dd
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ContentLength
= 589
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - total buffer
length = 820
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
content_length[589] + eoh[51] == in.remaining[820] ==> true
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - sizeToRead is
>>>> 641
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [[[[[ Decode
function on session (SOCKET, R: /192.168.3.11:8021, L: /192.168.150.52:1578,
S: /192.168.3.11:8021)
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 178
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 1 *****
Content-Length: 496
Content-Type: text/event-plain
Task-ID: 1
Task-Desc: heartbeat
Task-Group: core
Task-Runtime: 1212074247
Event-Name: RE_SCHEDULE
Core-UUID: 4b87d46a-2d8c-11dd
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
content-length index at 0
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 2 *****
Content-Length: 589
Content-Type: text/event-plain
Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74
Content-Length: 496
Content-Type: text/event-plain
Task-ID: 1
Task-Desc: heartbeat
Task-Group: core
Task-Runtime: 1212074247
Event-Name: RE_SCHEDULE
Core-UUID: 4b87d46a-2d8c-11dd
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ContentLength
= 589
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - total buffer
length = 820
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Parsing
request with sizeToRead = 641
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Reading
parameters:
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
Content-Length: 589
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Content-Type:
text/event-plain
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ]]]]] Finish
decode function on session (SOCKET, R: /192.168.3.11:8021, L: /
192.168.150.52:1578, S: /192.168.3.11:8021)
14:55:26,282 [AnonymousIoService-7] INFO FSProtocolHandler - [/
192.168.3.11:8021] RECEIVED:
<<<
Event-Data: Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74
Content-Length: 589
Content-Type: text/event-plain
<<<
14:55:26,282 [AnonymousIoService-7] INFO FSProtocolHandler - [/
192.168.3.11:8021] RECEIVED:
<<<
Event-Data: Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74
Content-Length: 589
Content-Type: text/event-plain
<<<
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** New
Buffer to analyze *****
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Buffer Dump
Content-Length: 589
Content-Type: text/event-plain
Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74
-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_scheduler.c
Event-Calling-Function: switch_scheduler_execute
Event-Calling-Line-Number: 70
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 1009
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 1 *****
Content-Length: 589
Content-Type: text/event-plain
Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74
-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_scheduler.c
Event-Calling-Function: switch_scheduler_execute
Event-Calling-Line-Number: 70
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
content-length index at 0
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 2 *****
Content-Length: 589
Content-Type: text/event-plain
Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74
-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_scheduler.c
Event-Calling-Function: switch_scheduler_execute
Event-Calling-Line-Number: 70
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ContentLength
= 589
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - total buffer
length = 1010
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
content_length[589] + eoh[51] == in.remaining[1010] ==> true
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - sizeToRead is
>>>> 641
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [[[[[ Decode
function on session (SOCKET, R: /192.168.3.11:8021, L: /192.168.150.52:1578,
S: /192.168.3.11:8021)
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 1009
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 1 *****
Content-Length: 589
Content-Type: text/event-plain
Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74
-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_scheduler.c
Event-Calling-Function: switch_scheduler_execute
Event-Calling-Line-Number: 70
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
content-length index at 0
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 2 *****
Content-Length: 589
Content-Type: text/event-plain
Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74
-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_scheduler.c
Event-Calling-Function: switch_scheduler_execute
Event-Calling-Line-Number: 70
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ContentLength
= 589
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - total buffer
length = 1010
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Parsing
request with sizeToRead = 641
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Reading
parameters:
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
Content-Length: 589
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Content-Type:
text/event-plain
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ]]]]] Finish
decode function on session (SOCKET, R: /192.168.3.11:8021, L: /
192.168.150.52:1578, S: /192.168.3.11:8021)
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** New
Buffer to analyze *****
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Buffer Dump
-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_scheduler.c
Event-Calling-Function: switch_scheduler_execute
Event-Calling-Line-Number: 70
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 368
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 1 *****
Content-Length: 589
Content-Type: text/event-plain
Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74
-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_scheduler.c
Event-Calling-Function: switch_scheduler_execute
Event-Calling-Line-Number: 70
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
content-length index at 0
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 2 *****
Content-Length: 589
Content-Type: text/event-plain
Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74
-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_scheduler.c
Event-Calling-Function: switch_scheduler_execute
Event-Calling-Line-Number: 70
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ContentLength
= 589
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - total buffer
length = 1010
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
content_length[589] + eoh[51] == in.remaining[1010] ==> true
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - sizeToRead is
>>>> 641
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [[[[[ Decode
function on session (SOCKET, R: /192.168.3.11:8021, L: /192.168.150.52:1578,
S: /192.168.3.11:8021)
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - last = 368
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 1 *****
-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_scheduler.c
Event-Calling-Function: switch_scheduler_execute
Event-Calling-Line-Number: 70
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Found
content-length index at 0
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [ ]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [5]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [8]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - [9]
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 2 *****
Content-Length: 589
Content-Type: text/event-plain
Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74
-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_scheduler.c
Event-Calling-Function: switch_scheduler_execute
Event-Calling-Line-Number: 70
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ContentLength
= 589
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - total buffer
length = 1010
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Parsing
request with sizeToRead = 641
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Reading
parameters:
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder -
Content-Length: 589
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - Content-Type:
text/event-plain
14:55:26,282 [AnonymousIoService-7] DEBUG FSResponseDecoder - ]]]]] Finish
decode function on session (SOCKET, R: /192.168.3.11:8021, L: /
192.168.150.52:1578, S: /192.168.3.11:8021)
14:55:26,282 [AnonymousIoService-7] INFO FSProtocolHandler - [/
192.168.3.11:8021] RECEIVED:
<<<
Event-Data: Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74
Content-Length: 589
Content-Type: text/event-plain
<<<
14:55:26,282 [AnonymousIoService-7] INFO FSProtocolHandler - [/
192.168.3.11:8021] RECEIVED:
<<<
Event-Data: Event-Info: System%20Ready
Up-Time:
0%20years,%200%20days,%200%20hours,%2042%20minutes,%2059%20seconds,%20725%20milliseconds,%20671%20microseconds
Session-Count: 0
Session-Per-Sec: 30
Event-Name: HEARTBEAT
Core-UUID: 4b87d46a-2d8c-11dd-a9d5-21e413e401fc
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2011%3A17%3A07
Event-Date-GMT: Thu,%2029%20May%202008%2015%3A17%3A07%20GMT
Event-Date-timestamp: 1212074227410211
Event-Calling-File: switch_core.c
Event-Calling-Function: send_heartbeat
Event-Calling-Line-Number: 74
Content-Length: 589
Content-Type: text/event-plain
<<<
14:55:26,282 [AnonymousIoService-7] WARN FSProtocolHandler - [/
192.168.3.11:8021] EXCEPTION:
org.apache.mina.filter.codec.ProtocolDecoderException:
java.lang.IllegalStateException: doDecode() can't return true when buffer is
not consumed. (Hexdump: 65 65 53 57 49 54 43 48 2D 48 6F 73 74 6E 61 6D 65
3A 20 43 4F 41 44 41 49 4E 30 31 0A 46 72 65 65 53 57 49 54 43 48 2D 49 50
76 34 3A 20 31 39 32 2E 31 36 38 2E 33 2E 31 31 0A 46 72 65 65 53 57 49 54
43 48 2D 49 50 76 36 3A 20 31 32 37 2E 30 2E 30 2E 31 0A 45 76 65 6E 74 2D
44 61 74 65 2D 4C 6F 63 61 6C 3A 20 32 30 30 38 2D 30 35 2D 32 39 25 32 30
31 31 25 33 41 31 37 25 33 41 30 37 0A 45 76 65 6E 74 2D 44 61 74 65 2D 47
4D 54 3A 20 54 68 75 2C 25 32 30 32 39 25 32 30 4D 61 79 25 32 30 32 30 30
38 25 32 30 31 35 25 33 41 31 37 25 33 41 30 37 25 32 30 47 4D 54 0A 45 76
65 6E 74 2D 44 61 74 65 2D 74 69 6D 65 73 74 61 6D 70 3A 20 31 32 31 32 30
37 34 32 32 37 34 31 30 32 31 31 0A 45 76 65 6E 74 2D 43 61 6C 6C 69 6E 67
2D 46 69 6C 65 3A 20 73 77 69 74 63 68 5F 63 6F 72 65 2E 63 0A 45 76 65 6E
74 2D 43 61 6C 6C 69 6E 67 2D 46 75 6E 63 74 69 6F 6E 3A 20 73 65 6E 64 5F
68 65 61 72 74 62 65 61 74 0A 45 76 65 6E 74 2D 43 61 6C 6C 69 6E 67 2D 4C
69 6E 65 2D 4E 75 6D 62 65 72 3A 20 37 34 0A 0A 43 6F 6E 74 65 6E 74 2D 4C
65 6E 67 74 68 3A 20 34 39 36 0A 43 6F 6E 74 65 6E 74 2D 54 79 70 65 3A 20
74 65 78 74 2F 65 76 65 6E 74 2D 70 6C 61 69 6E 0A 0A 54 61 73 6B 2D 49 44
3A 20 31 0A 54 61 73 6B 2D 44 65 73 63 3A 20 68 65 61 72 74 62 65 61 74 0A
54 61 73 6B 2D 47 72 6F 75 70 3A 20 63 6F 72 65 0A 54 61 73 6B 2D 52 75 6E
74 69 6D 65 3A 20 31 32 31 32 30 37 34 32 34 37 0A 45 76 65 6E 74 2D 4E 61
6D 65 3A 20 52 45 5F 53 43 48 45 44 55 4C 45 0A 43 6F 72 65 2D 55 55 49 44
3A 20 34 62 38 37 64 34 36 61 2D 32 64 38 63 2D 31 31 64 64)
at
org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:165)
at
org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
at
org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
at
org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
at
org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220)
at
org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at
org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalStateException: doDecode() can't return true
when buffer is not consumed.
at
org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:136)
at
org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:158)
... 9 more
14:55:26,282 [AnonymousIoService-7] WARN FSProtocolHandler - [/
192.168.3.11:8021] EXCEPTION, please implement
com.swn.app.fs.FSProtocolHandler.exceptionCaught() for proper handling:
org.apache.mina.filter.codec.ProtocolDecoderException:
java.lang.IllegalStateException: doDecode() can't return true when buffer is
not consumed. (Hexdump: 65 65 53 57 49 54 43 48 2D 48 6F 73 74 6E 61 6D 65
3A 20 43 4F 41 44 41 49 4E 30 31 0A 46 72 65 65 53 57 49 54 43 48 2D 49 50
76 34 3A 20 31 39 32 2E 31 36 38 2E 33 2E 31 31 0A 46 72 65 65 53 57 49 54
43 48 2D 49 50 76 36 3A 20 31 32 37 2E 30 2E 30 2E 31 0A 45 76 65 6E 74 2D
44 61 74 65 2D 4C 6F 63 61 6C 3A 20 32 30 30 38 2D 30 35 2D 32 39 25 32 30
31 31 25 33 41 31 37 25 33 41 30 37 0A 45 76 65 6E 74 2D 44 61 74 65 2D 47
4D 54 3A 20 54 68 75 2C 25 32 30 32 39 25 32 30 4D 61 79 25 32 30 32 30 30
38 25 32 30 31 35 25 33 41 31 37 25 33 41 30 37 25 32 30 47 4D 54 0A 45 76
65 6E 74 2D 44 61 74 65 2D 74 69 6D 65 73 74 61 6D 70 3A 20 31 32 31 32 30
37 34 32 32 37 34 31 30 32 31 31 0A 45 76 65 6E 74 2D 43 61 6C 6C 69 6E 67
2D 46 69 6C 65 3A 20 73 77 69 74 63 68 5F 63 6F 72 65 2E 63 0A 45 76 65 6E
74 2D 43 61 6C 6C 69 6E 67 2D 46 75 6E 63 74 69 6F 6E 3A 20 73 65 6E 64 5F
68 65 61 72 74 62 65 61 74 0A 45 76 65 6E 74 2D 43 61 6C 6C 69 6E 67 2D 4C
69 6E 65 2D 4E 75 6D 62 65 72 3A 20 37 34 0A 0A 43 6F 6E 74 65 6E 74 2D 4C
65 6E 67 74 68 3A 20 34 39 36 0A 43 6F 6E 74 65 6E 74 2D 54 79 70 65 3A 20
74 65 78 74 2F 65 76 65 6E 74 2D 70 6C 61 69 6E 0A 0A 54 61 73 6B 2D 49 44
3A 20 31 0A 54 61 73 6B 2D 44 65 73 63 3A 20 68 65 61 72 74 62 65 61 74 0A
54 61 73 6B 2D 47 72 6F 75 70 3A 20 63 6F 72 65 0A 54 61 73 6B 2D 52 75 6E
74 69 6D 65 3A 20 31 32 31 32 30 37 34 32 34 37 0A 45 76 65 6E 74 2D 4E 61
6D 65 3A 20 52 45 5F 53 43 48 45 44 55 4C 45 0A 43 6F 72 65 2D 55 55 49 44
3A 20 34 62 38 37 64 34 36 61 2D 32 64 38 63 2D 31 31 64 64)
at
org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:165)
at
org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
at
org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
at
org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
at
org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220)
at
org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at
org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalStateException: doDecode() can't return true
when buffer is not consumed.
at
org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:136)
at
org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:158)
... 9 more
14:55:26,282 [AnonymousIoService-7] WARN FSProtocolHandler - [/
192.168.3.11:8021] EXCEPTION:
org.apache.mina.filter.codec.ProtocolDecoderException:
java.lang.IllegalStateException: doDecode() can't return true when buffer is
not consumed. (Hexdump: 2D 61 39 64 35 2D 32 31 65 34 31 33 65 34 30 31 66
63 0A 46 72 65 65 53 57 49 54 43 48 2D 48 6F 73 74 6E 61 6D 65 3A 20 43 4F
41 44 41 49 4E 30 31 0A 46 72 65 65 53 57 49 54 43 48 2D 49 50 76 34 3A 20
31 39 32 2E 31 36 38 2E 33 2E 31 31 0A 46 72 65 65 53 57 49 54 43 48 2D 49
50 76 36 3A 20 31 32 37 2E 30 2E 30 2E 31 0A 45 76 65 6E 74 2D 44 61 74 65
2D 4C 6F 63 61 6C 3A 20 32 30 30 38 2D 30 35 2D 32 39 25 32 30 31 31 25 33
41 31 37 25 33 41 30 37 0A 45 76 65 6E 74 2D 44 61 74 65 2D 47 4D 54 3A 20
54 68 75 2C 25 32 30 32 39 25 32 30 4D 61 79 25 32 30 32 30 30 38 25 32 30
31 35 25 33 41 31 37 25 33 41 30 37 25 32 30 47 4D 54 0A 45 76 65 6E 74 2D
44 61 74 65 2D 74 69 6D 65 73 74 61 6D 70 3A 20 31 32 31 32 30 37 34 32 32
37 34 31 30 32 31 31 0A 45 76 65 6E 74 2D 43 61 6C 6C 69 6E 67 2D 46 69 6C
65 3A 20 73 77 69 74 63 68 5F 73 63 68 65 64 75 6C 65 72 2E 63 0A 45 76 65
6E 74 2D 43 61 6C 6C 69 6E 67 2D 46 75 6E 63 74 69 6F 6E 3A 20 73 77 69 74
63 68 5F 73 63 68 65 64 75 6C 65 72 5F 65 78 65 63 75 74 65 0A 45 76 65 6E
74 2D 43 61 6C 6C 69 6E 67 2D 4C 69 6E 65 2D 4E 75 6D 62 65 72 3A 20 37 30
0A 0A)
at
org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:165)
at
org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
at
org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
at
org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
at
org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220)
at
org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at
org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalStateException: doDecode() can't return true
when buffer is not consumed.
at
org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:136)
at
org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:158)
... 9 more
14:55:26,282 [AnonymousIoService-7] WARN FSProtocolHandler - [/
192.168.3.11:8021] EXCEPTION, please implement
com.swn.app.fs.FSProtocolHandler.exceptionCaught() for proper handling:
org.apache.mina.filter.codec.ProtocolDecoderException:
java.lang.IllegalStateException: doDecode() can't return true when buffer is
not consumed. (Hexdump: 2D 61 39 64 35 2D 32 31 65 34 31 33 65 34 30 31 66
63 0A 46 72 65 65 53 57 49 54 43 48 2D 48 6F 73 74 6E 61 6D 65 3A 20 43 4F
41 44 41 49 4E 30 31 0A 46 72 65 65 53 57 49 54 43 48 2D 49 50 76 34 3A 20
31 39 32 2E 31 36 38 2E 33 2E 31 31 0A 46 72 65 65 53 57 49 54 43 48 2D 49
50 76 36 3A 20 31 32 37 2E 30 2E 30 2E 31 0A 45 76 65 6E 74 2D 44 61 74 65
2D 4C 6F 63 61 6C 3A 20 32 30 30 38 2D 30 35 2D 32 39 25 32 30 31 31 25 33
41 31 37 25 33 41 30 37 0A 45 76 65 6E 74 2D 44 61 74 65 2D 47 4D 54 3A 20
54 68 75 2C 25 32 30 32 39 25 32 30 4D 61 79 25 32 30 32 30 30 38 25 32 30
31 35 25 33 41 31 37 25 33 41 30 37 25 32 30 47 4D 54 0A 45 76 65 6E 74 2D
44 61 74 65 2D 74 69 6D 65 73 74 61 6D 70 3A 20 31 32 31 32 30 37 34 32 32
37 34 31 30 32 31 31 0A 45 76 65 6E 74 2D 43 61 6C 6C 69 6E 67 2D 46 69 6C
65 3A 20 73 77 69 74 63 68 5F 73 63 68 65 64 75 6C 65 72 2E 63 0A 45 76 65
6E 74 2D 43 61 6C 6C 69 6E 67 2D 46 75 6E 63 74 69 6F 6E 3A 20 73 77 69 74
63 68 5F 73 63 68 65 64 75 6C 65 72 5F 65 78 65 63 75 74 65 0A 45 76 65 6E
74 2D 43 61 6C 6C 69 6E 67 2D 4C 69 6E 65 2D 4E 75 6D 62 65 72 3A 20 37 30
0A 0A)
at
org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:165)
at
org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
at
org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
at
org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
at
org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220)
at
org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at
org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalStateException: doDecode() can't return true
when buffer is not consumed.
at
org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:136)
at
org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:158)
... 9 more
Re: ByteBuffer Anomaly??
Posted by Emmanuel Lecharny <el...@apache.org>.
Can you try that ?
> ================================
>
> private String getBufferString(ByteBuffer in) {
> int size = in.remaining();
>
> if (size == 0) {
> return "empty";
> }
>
> StringBuilder out = new StringBuilder(size);
> while (in.hasRemaining()) {
> out.append((char) in.get());
> }
>
> in.flip();
>
> return out.toString();
> }
>
(may contains syntax error, I didn't typed in in eclipse)
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
Re: ByteBuffer Anomaly??
Posted by Johny Kadarisman <jk...@gmail.com>.
Thanks for your response,
Sorry, I didn't include the code for debug string. I set back the position
after getting the debug trace. Following is the code for that.
I check, the '3284', is actually coming from previous buffer. I include the
complete trace from previous trace as below:
The code is quite messy right now, I'm putting a lot of debugging log just
to troubleshoot this problem :)
btw, I'm using mina 1.1.6.
Rgds,
Johny K.
================================
private String getBufferString(ByteBuffer in) {
int size = in.remaining();
if (size == 0) {
return "empty";
}
StringBuffer out = new StringBuffer((in.remaining() * 3) - 1);
int mark = in.position();
// and the others, too
for (; size > 0; size--) {
out.append((char) in.get());
}
in.position(mark);
return out.toString();
}
==============================
0:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - Found
content-length index at 0
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [ ]
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [3]
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [2]
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [8]
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [4]
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 2 *****
Content-Length: 3284
Content-Type: text/event-plain
Channel-State: CS_EXECUTE
Channel-State-Number: 4
Channel-Name: sofia/external/nobody%40192.168.3.12
Unique-ID: fd04ead6-2d6c-11dd-9acd-0b28d09a52aa
Call-Direction: inbound
Answer-State: answered
Channel-Read-Codec-Name: PCMU
Channel-Read-Codec-Rate: 8000
Channel-Write-Codec-Name: PCMU
Channel-Write-Codec-Rate: 8000
Caller-Dialplan: XML
Caller-Network-Addr: 192.168.3.12
Caller-Destination-Number: 6601
Caller-Unique-ID: fd04ead6-2d6c-11dd-9acd-0b28d09a52aa
Caller-Source: mod_sofia
Caller-Context: default
Caller-RDNIS: 6601
Caller-Channel-Name: sofia/external/nobody%40192.168.3.12
Caller-Profile-Index: 2
Caller-Channel-Created-Time: 1212058201566175
Caller-Channel-Answered-Time: 1212058201640001
Caller-Channel-Hangup-Time: 0
Caller-Channel-Transfer-Time: 0
Caller-Screen-Bit: yes
Caller-Privacy-Hide-Name: no
Caller-Privacy-Hide-Number: no
variable_sip_from_user: nobody
variable_sip_from_uri: nobody%40192.168.3.12
variable_sip_from_host: 192.168.3.12
variable_sip_from_tag: ZSrg0c8tH35Xa
variable_sofia_profile_name: external
variable_sofia_profile_domain_name: external
variable_sip_req_user: 6601
variable_sip_req_port: 5080
variable_sip_req_uri: 6601%40192.168.3.11%3A5080
variable_sip_req_host: 192.168.3.11
variable_sip_to_user: 6601
variable_sip_to_port: 5080
variable_sip_to_uri: 6601%40192.168.3.11%3A5080
variable_sip_to_host: 192.168.3.11
variable_sip_contact_user: mod_sofia
variable_sip_contact_port: 5060
variable_sip_contact_uri: mod_sofia%40192.168.3.12%3A5060
variable_sip_contact_host: 192.168.3.12
variable_channel_name: sofia/external/nobody%40192.168.3.12
variable_sip_call_id: 8232379f-a82e-122b-8485-000f1f644b48
variable_sip_user_agent: FreeSWITCH-mod_sofia/1.0.pre4-8539
variable_sip_via_host: 192.168.3.12
variable_sip_via_rport: 5060
variable_switch_r_sdp:
v%3D0%0D%0Ao%3DFreeSWITCH%208268952646319231016%205951282259024528182%20IN%20IP4%20192.168.3.12%0D%0As%3DFreeSWITCH%0D%0Ac%3DIN%20IP4%20192.168.3.12%0D%0At%3D0%200%0D%0Aa%3Dsendrecv%0D%0Am%3Daudio%2028556%20RTP/AVP%209%200%208%203%20101%2013%0D%0Aa%3Drtpmap%3A9%20G722/8000%0D%0Aa%3Drtpmap%3A0%20PCMU/8000%0D%0Aa%3Drtpmap%3A8%20PCMA/8000%0D%0Aa%3Drtpmap%3A3%20GSM/8000%0D%0Aa%3Drtpmap%3A101%20telephone-event/8000%0D%0Aa%3Dfmtp%3A101%200-16%0D%0Aa%3Drtpmap%3A13%20CN/8000%0D%0Aa%3Dptime%3A20%0D%0A
variable_remote_media_ip: 192.168.3.12
variable_remote_media_port: 28556
variable_read_codec: PCMU
variable_read_rate: 8000
variable_write_codec: PCMU
variable_write_rate: 8000
variable_max_forwards: 69
variable_use_profile: nat
variable_numbering_plan: US
variable_default_gateway: asterlink.com
variable_default_area_code: 918
variable_user_name: default
variable_domain_name: 192.168.3.11
variable_local_media_ip: 192.168.3.11
variable_local_media_port: 28556
variable_endpoint_disposition: ANSWER
Application: playback
Application-Data: swn/connecting-1.wav
Event-Name: CHANNEL_EXECUTE
Core-UUID: ed9888ba-2c94-11dd-9acd-0b28d09a52aa
FreeSWITCH-Hostname: COADAIN01
FreeSWITCH-IPv4: 192.168.3.11
FreeSWITCH-IPv6: 127.0.0.1
Event-Date-Local: 2008-05-29%2006%3A50%3A01
Event-Date-GMT: Thu,%2029%20May%202008%2010%3A50%3A01%20GMT
Event-Date-timestamp: 1212058201641033
Event-Calling-File: switch_core_session.c
Event-Calling-Function: switch_core_session_exec
Event-Calling-Line-Number: 1033
Content-Length: 1619
Content-Type: text/event-plain
Channel-State: CS_NEW
Channel-State-Number: 0
Channel-Name: sofia/external/nobody%40192.168.3.12
Unique-ID: fd2229c0-2d6c-11dd-9acd-0b28d09a52aa
Call-Direction: inbound
Answer-State: ringing
variable_sip_from_user: nobody
variable_sip_from_uri: nobody%40192.168.3.12
variable_sip_from_host: 192.168.3.12
variable_sip_from_tag: 02H917ryecvgp
variable_sofia_profile_name: external
variable_sofia_profile_domain_name: external
variable_sip_req_user: 6001
variable_sip_req_port: 5080
variable_sip_req_uri: 6001%40192.168.3.11%3A5080
variable_sip_req_host: 192.168.3.11
variable_sip_to_user: 6001
variable_sip_to_port: 5080
variable_sip_to_uri: 6001%40192.168.3.11%3A5080
variable_sip_to_host: 192.168.3.11
variable_sip_contact_user: mod_sofia
variable_sip_contact_port: 5060
variable_sip_contact_uri: mod_sofia%40192.168.3.12%3A5060
variable_sip_contact_host: 192.168.3.12
variable_channel_name: sofia/external/nobody%40192.168.3.12
variable_endpoint_disposition: INBOUND%20CALL
variable_sip_call_id: 824f7531-a82e-122b-8485-000f1f644b48
variable_sip_user_agent: FreeSWITCH-mod_sofia/1.0.pre4-8539
variable_sip_via_host: 192.168.3.12
variable_sip_via_rport: 5060
variable_max_forwards: 70
Event-Name: CHANNEL_CREATE
Core-UUID: ed9888ba-2c94-11dd-
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - ContentLength
= 3284
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - total buffer
length = 4632
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - Parsing
request with sizeToRead = 3337
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - Reading
parameters:
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder -
Content-Length: 3284
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - Content-Type:
text/event-plain
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - ]]]]] Finish
decode function on session (SOCKET, R: /192.168.3.11:8021, L: /
192.168.150.52:4621, S: /192.168.3.11:8021)
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - ***** New
Buffer to analyze *****
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - Buffer Dump
Content-Length: 1619
Content-Type: text/event-plain
Channel-State: CS_NEW
Channel-State-Number: 0
Channel-Name: sofia/external/nobody%40192.168.3.12
Unique-ID: fd2229c0-2d6c-11dd-9acd-0b28d09a52aa
Call-Direction: inbound
Answer-State: ringing
variable_sip_from_user: nobody
variable_sip_from_uri: nobody%40192.168.3.12
variable_sip_from_host: 192.168.3.12
variable_sip_from_tag: 02H917ryecvgp
variable_sofia_profile_name: external
variable_sofia_profile_domain_name: external
variable_sip_req_user: 6001
variable_sip_req_port: 5080
variable_sip_req_uri: 6001%40192.168.3.11%3A5080
variable_sip_req_host: 192.168.3.11
variable_sip_to_user: 6001
variable_sip_to_port: 5080
variable_sip_to_uri: 6001%40192.168.3.11%3A5080
variable_sip_to_host: 192.168.3.11
variable_sip_contact_user: mod_sofia
variable_sip_contact_port: 5060
variable_sip_contact_uri: mod_sofia%40192.168.3.12%3A5060
variable_sip_contact_host: 192.168.3.12
variable_channel_name: sofia/external/nobody%40192.168.3.12
variable_endpoint_disposition: INBOUND%20CALL
variable_sip_call_id: 824f7531-a82e-122b-8485-000f1f644b48
variable_sip_user_agent: FreeSWITCH-mod_sofia/1.0.pre4-8539
variable_sip_via_host: 192.168.3.12
variable_sip_via_rport: 5060
variable_max_forwards: 70
Event-Name: CHANNEL_CREATE
Core-UUID: ed9888ba-2c94-11dd-
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - last = 1294
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 1 *****
Content-Length: 1619
Content-Type: text/event-plain
Channel-State: CS_NEW
Channel-State-Number: 0
Channel-Name: sofia/external/nobody%40192.168.3.12
Unique-ID: fd2229c0-2d6c-11dd-9acd-0b28d09a52aa
Call-Direction: inbound
Answer-State: ringing
variable_sip_from_user: nobody
variable_sip_from_uri: nobody%40192.168.3.12
variable_sip_from_host: 192.168.3.12
variable_sip_from_tag: 02H917ryecvgp
variable_sofia_profile_name: external
variable_sofia_profile_domain_name: external
variable_sip_req_user: 6001
variable_sip_req_port: 5080
variable_sip_req_uri: 6001%40192.168.3.11%3A5080
variable_sip_req_host: 192.168.3.11
variable_sip_to_user: 6001
variable_sip_to_port: 5080
variable_sip_to_uri: 6001%40192.168.3.11%3A5080
variable_sip_to_host: 192.168.3.11
variable_sip_contact_user: mod_sofia
variable_sip_contact_port: 5060
variable_sip_contact_uri: mod_sofia%40192.168.3.12%3A5060
variable_sip_contact_host: 192.168.3.12
variable_channel_name: sofia/external/nobody%40192.168.3.12
variable_endpoint_disposition: INBOUND%20CALL
variable_sip_call_id: 824f7531-a82e-122b-8485-000f1f644b48
variable_sip_user_agent: FreeSWITCH-mod_sofia/1.0.pre4-8539
variable_sip_via_host: 192.168.3.12
variable_sip_via_rport: 5060
variable_max_forwards: 70
Event-Name: CHANNEL_CREATE
Core-UUID: ed9888ba-2c94-11dd-
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - Found
content-length index at 0
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [ ]
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [3]
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [2]
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [8]
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [4]
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - ***** Buffer
in getContentLength 2 *****
Content-Length: 1619
Content-Type: text/event-plain
Channel-State: CS_NEW
Channel-State-Number: 0
Channel-Name: sofia/external/nobody%40192.168.3.12
Unique-ID: fd2229c0-2d6c-11dd-9acd-0b28d09a52aa
Call-Direction: inbound
Answer-State: ringing
variable_sip_from_user: nobody
variable_sip_from_uri: nobody%40192.168.3.12
variable_sip_from_host: 192.168.3.12
variable_sip_from_tag: 02H917ryecvgp
variable_sofia_profile_name: external
variable_sofia_profile_domain_name: external
variable_sip_req_user: 6001
variable_sip_req_port: 5080
variable_sip_req_uri: 6001%40192.168.3.11%3A5080
variable_sip_req_host: 192.168.3.11
variable_sip_to_user: 6001
variable_sip_to_port: 5080
variable_sip_to_uri: 6001%40192.168.3.11%3A5080
variable_sip_to_host: 192.168.3.11
variable_sip_contact_user: mod_sofia
variable_sip_contact_port: 5060
variable_sip_contact_uri: mod_sofia%40192.168.3.12%3A5060
variable_sip_contact_host: 192.168.3.12
variable_channel_name: sofia/external/nobody%40192.168.3.12
variable_endpoint_disposition: INBOUND%20CALL
variable_sip_call_id: 824f7531-a82e-122b-8485-000f1f644b48
variable_sip_user_agent: FreeSWITCH-mod_sofia/1.0.pre4-8539
variable_sip_via_host: 192.168.3.12
variable_sip_via_rport: 5060
variable_max_forwards: 70
Event-Name: CHANNEL_CREATE
Core-UUID: ed9888ba-2c94-11dd-
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - ContentLength
= 3284
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - total buffer
length = 1295
10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder -
content_length[3284] + eoh[52] == in.remaining[1295] ==> false
10:27:55,867 [AnonymousIoService-1] INFO FSProtocolHandler - [/
192.168.3.11:8021] RECEIVED:
On Thu, May 29, 2008 at 11:36 AM, Emmanuel Lecharny <el...@apache.org>
wrote:
> Hi,
>
> are you sure you flip the ByteBuffer after having dumped it in the debug
> trace ? It's a ByteBuffer, so each time you read a byte, the position is
> incremented, and won't come back to the original position.
>
> I guess that the length (3284) is just the next 4 bytes after the last line
> printed in debug mode :
>
> Core-UUID: ed9888ba-2c94-11dd- [3284...]
>
> Can you check that ?
>
>
>
>
> Johny Kadarisman wrote:
>
>> Hi, I found anomaly, that yet to find what went wrong on these ByteBuffer?
>>
>> I'm trying to decode a specific switch protocol, that based on
>> content-length information. So following is from my decoder class that
>> trying to search the length from 'in' buffer.
>>
>> Attached is the log output from last run, here you can before doing
>> anything, The buffer dump show content-length of "1619". Then I continue
>> with logic to parse this into integer, with in.get(i) methods. But, from
>> this methods, it return '3284'. Which, I believe from previous buffer.
>> Now,
>> At the end of these routines, I dump again this 'in' bytebuffer. This
>> time,
>> it still showing the content-length of '1619'. After this, the subsequent
>> protocol parsing is getting screw, since the length is not chop properly.
>>
>> This symptom occurs on high load messages from the server, during low
>> load,
>> everything seems fine.
>>
>> Anybody encounter similar problem? your hints is appreciated.
>>
>> Thanks,
>> Johny K.
>>
>>
>> ================================================================
>>
>>
>> private int getContentLength(ByteBuffer in, int last) {
>>
>> String str = getBufferString(in); // in.getHexDump();
>> logger.debug("last = "+last);
>> logger.debug("***** Buffer in getContentLength 1 *****\n"+str);
>>
>> for (int i = 0; i < last; i++) {
>> boolean found = false;
>> for (int j = 0; j < CONTENT_LENGTH.length; j++) {
>> if (in.get(i + j) != CONTENT_LENGTH[j]) {
>> found = false;
>> break;
>> }
>> found = true;
>> }
>> if (found) {
>> // retrieve value from this position till next 0x0D 0x0A
>> logger.debug("Found content-length index at "+i);
>>
>> StringBuilder contentLength = new StringBuilder();
>> for (int j = i + CONTENT_LENGTH.length; j < last; j++) {
>> if (in.get(j) == 0x0A)
>> break;
>> contentLength.append(new String( new byte[] { in.get(j)
>> }));
>> logger.debug("["+new String( new byte[]
>> {in.get(j)})+"]");
>> }
>> // if content-length worth of data has been received then
>> the message is complete
>>
>> str = getBufferString(in); //
>> in.getHexDump();
>> logger.debug("***** Buffer in getContentLength 2
>> *****\n"+str);
>>
>> logger.debug("ContentLength = "+contentLength);
>> logger.debug("total buffer length = "+in.remaining());
>> return Integer.parseInt(contentLength.toString().trim());
>> }
>> }
>> return -1;
>> }
>>
>>
>>
>>
>>
>>
>>
>> 10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 1 *****
>> Content-Length: 1619
>> Content-Type: text/event-plain
>>
>> Channel-State: CS_NEW
>> Channel-State-Number: 0
>> Channel-Name: sofia/external/nobody%40192.168.3.12
>> Unique-ID: fd2229c0-2d6c-11dd-9acd-0b28d09a52aa
>> Call-Direction: inbound
>> Answer-State: ringing
>> variable_sip_from_user: nobody
>> variable_sip_from_uri: nobody%40192.168.3.12
>> variable_sip_from_host: 192.168.3.12
>> variable_sip_from_tag: 02H917ryecvgp
>> variable_sofia_profile_name: external
>> variable_sofia_profile_domain_name: external
>> variable_sip_req_user: 6001
>> variable_sip_req_port: 5080
>> variable_sip_req_uri: 6001%40192.168.3.11%3A5080
>> variable_sip_req_host: 192.168.3.11
>> variable_sip_to_user: 6001
>> variable_sip_to_port: 5080
>> variable_sip_to_uri: 6001%40192.168.3.11%3A5080
>> variable_sip_to_host: 192.168.3.11
>> variable_sip_contact_user: mod_sofia
>> variable_sip_contact_port: 5060
>> variable_sip_contact_uri: mod_sofia%40192.168.3.12%3A5060
>> variable_sip_contact_host: 192.168.3.12
>> variable_channel_name: sofia/external/nobody%40192.168.3.12
>> variable_endpoint_disposition: INBOUND%20CALL
>> variable_sip_call_id: 824f7531-a82e-122b-8485-000f1f644b48
>> variable_sip_user_agent: FreeSWITCH-mod_sofia/1.0.pre4-8539
>> variable_sip_via_host: 192.168.3.12
>> variable_sip_via_rport: 5060
>> variable_max_forwards: 70
>> Event-Name: CHANNEL_CREATE
>> Core-UUID: ed9888ba-2c94-11dd-
>> 10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - Found
>> content-length index at 0
>> 10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [ ]
>> 10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [3]
>> 10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [2]
>> 10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [8]
>> 10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [4]
>> 10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - *****
>> Buffer
>> in getContentLength 2 *****
>> Content-Length: 1619
>> Content-Type: text/event-plain
>>
>> Channel-State: CS_NEW
>> Channel-State-Number: 0
>> Channel-Name: sofia/external/nobody%40192.168.3.12
>> Unique-ID: fd2229c0-2d6c-11dd-9acd-0b28d09a52aa
>> Call-Direction: inbound
>> Answer-State: ringing
>> variable_sip_from_user: nobody
>> variable_sip_from_uri: nobody%40192.168.3.12
>> variable_sip_from_host: 192.168.3.12
>> variable_sip_from_tag: 02H917ryecvgp
>> variable_sofia_profile_name: external
>> variable_sofia_profile_domain_name: external
>> variable_sip_req_user: 6001
>> variable_sip_req_port: 5080
>> variable_sip_req_uri: 6001%40192.168.3.11%3A5080
>> variable_sip_req_host: 192.168.3.11
>> variable_sip_to_user: 6001
>> variable_sip_to_port: 5080
>> variable_sip_to_uri: 6001%40192.168.3.11%3A5080
>> variable_sip_to_host: 192.168.3.11
>> variable_sip_contact_user: mod_sofia
>> variable_sip_contact_port: 5060
>> variable_sip_contact_uri: mod_sofia%40192.168.3.12%3A5060
>> variable_sip_contact_host: 192.168.3.12
>> variable_channel_name: sofia/external/nobody%40192.168.3.12
>> variable_endpoint_disposition: INBOUND%20CALL
>> variable_sip_call_id: 824f7531-a82e-122b-8485-000f1f644b48
>> variable_sip_user_agent: FreeSWITCH-mod_sofia/1.0.pre4-8539
>> variable_sip_via_host: 192.168.3.12
>> variable_sip_via_rport: 5060
>> variable_max_forwards: 70
>> Event-Name: CHANNEL_CREATE
>> Core-UUID: ed9888ba-2c94-11dd-
>> 10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder -
>> ContentLength
>> = 3284
>> 10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - total
>> buffer
>> length = 1295
>>
>>
>>
>
>
> --
> --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
>
>
>
Re: ByteBuffer Anomaly??
Posted by Emmanuel Lecharny <el...@apache.org>.
Hi,
are you sure you flip the ByteBuffer after having dumped it in the debug
trace ? It's a ByteBuffer, so each time you read a byte, the position is
incremented, and won't come back to the original position.
I guess that the length (3284) is just the next 4 bytes after the last
line printed in debug mode :
Core-UUID: ed9888ba-2c94-11dd- [3284...]
Can you check that ?
Johny Kadarisman wrote:
> Hi, I found anomaly, that yet to find what went wrong on these ByteBuffer?
>
> I'm trying to decode a specific switch protocol, that based on
> content-length information. So following is from my decoder class that
> trying to search the length from 'in' buffer.
>
> Attached is the log output from last run, here you can before doing
> anything, The buffer dump show content-length of "1619". Then I continue
> with logic to parse this into integer, with in.get(i) methods. But, from
> this methods, it return '3284'. Which, I believe from previous buffer. Now,
> At the end of these routines, I dump again this 'in' bytebuffer. This time,
> it still showing the content-length of '1619'. After this, the subsequent
> protocol parsing is getting screw, since the length is not chop properly.
>
> This symptom occurs on high load messages from the server, during low load,
> everything seems fine.
>
> Anybody encounter similar problem? your hints is appreciated.
>
> Thanks,
> Johny K.
>
>
> ================================================================
>
>
> private int getContentLength(ByteBuffer in, int last) {
>
> String str = getBufferString(in); // in.getHexDump();
> logger.debug("last = "+last);
> logger.debug("***** Buffer in getContentLength 1 *****\n"+str);
>
> for (int i = 0; i < last; i++) {
> boolean found = false;
> for (int j = 0; j < CONTENT_LENGTH.length; j++) {
> if (in.get(i + j) != CONTENT_LENGTH[j]) {
> found = false;
> break;
> }
> found = true;
> }
> if (found) {
> // retrieve value from this position till next 0x0D 0x0A
> logger.debug("Found content-length index at "+i);
>
> StringBuilder contentLength = new StringBuilder();
> for (int j = i + CONTENT_LENGTH.length; j < last; j++) {
> if (in.get(j) == 0x0A)
> break;
> contentLength.append(new String( new byte[] { in.get(j)
> }));
> logger.debug("["+new String( new byte[]
> {in.get(j)})+"]");
> }
> // if content-length worth of data has been received then
> the message is complete
>
> str = getBufferString(in); // in.getHexDump();
> logger.debug("***** Buffer in getContentLength 2
> *****\n"+str);
>
> logger.debug("ContentLength = "+contentLength);
> logger.debug("total buffer length = "+in.remaining());
> return Integer.parseInt(contentLength.toString().trim());
> }
> }
> return -1;
> }
>
>
>
>
>
>
>
> 10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 1 *****
> Content-Length: 1619
> Content-Type: text/event-plain
>
> Channel-State: CS_NEW
> Channel-State-Number: 0
> Channel-Name: sofia/external/nobody%40192.168.3.12
> Unique-ID: fd2229c0-2d6c-11dd-9acd-0b28d09a52aa
> Call-Direction: inbound
> Answer-State: ringing
> variable_sip_from_user: nobody
> variable_sip_from_uri: nobody%40192.168.3.12
> variable_sip_from_host: 192.168.3.12
> variable_sip_from_tag: 02H917ryecvgp
> variable_sofia_profile_name: external
> variable_sofia_profile_domain_name: external
> variable_sip_req_user: 6001
> variable_sip_req_port: 5080
> variable_sip_req_uri: 6001%40192.168.3.11%3A5080
> variable_sip_req_host: 192.168.3.11
> variable_sip_to_user: 6001
> variable_sip_to_port: 5080
> variable_sip_to_uri: 6001%40192.168.3.11%3A5080
> variable_sip_to_host: 192.168.3.11
> variable_sip_contact_user: mod_sofia
> variable_sip_contact_port: 5060
> variable_sip_contact_uri: mod_sofia%40192.168.3.12%3A5060
> variable_sip_contact_host: 192.168.3.12
> variable_channel_name: sofia/external/nobody%40192.168.3.12
> variable_endpoint_disposition: INBOUND%20CALL
> variable_sip_call_id: 824f7531-a82e-122b-8485-000f1f644b48
> variable_sip_user_agent: FreeSWITCH-mod_sofia/1.0.pre4-8539
> variable_sip_via_host: 192.168.3.12
> variable_sip_via_rport: 5060
> variable_max_forwards: 70
> Event-Name: CHANNEL_CREATE
> Core-UUID: ed9888ba-2c94-11dd-
> 10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - Found
> content-length index at 0
> 10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [ ]
> 10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [3]
> 10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [2]
> 10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [8]
> 10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - [4]
> 10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - ***** Buffer
> in getContentLength 2 *****
> Content-Length: 1619
> Content-Type: text/event-plain
>
> Channel-State: CS_NEW
> Channel-State-Number: 0
> Channel-Name: sofia/external/nobody%40192.168.3.12
> Unique-ID: fd2229c0-2d6c-11dd-9acd-0b28d09a52aa
> Call-Direction: inbound
> Answer-State: ringing
> variable_sip_from_user: nobody
> variable_sip_from_uri: nobody%40192.168.3.12
> variable_sip_from_host: 192.168.3.12
> variable_sip_from_tag: 02H917ryecvgp
> variable_sofia_profile_name: external
> variable_sofia_profile_domain_name: external
> variable_sip_req_user: 6001
> variable_sip_req_port: 5080
> variable_sip_req_uri: 6001%40192.168.3.11%3A5080
> variable_sip_req_host: 192.168.3.11
> variable_sip_to_user: 6001
> variable_sip_to_port: 5080
> variable_sip_to_uri: 6001%40192.168.3.11%3A5080
> variable_sip_to_host: 192.168.3.11
> variable_sip_contact_user: mod_sofia
> variable_sip_contact_port: 5060
> variable_sip_contact_uri: mod_sofia%40192.168.3.12%3A5060
> variable_sip_contact_host: 192.168.3.12
> variable_channel_name: sofia/external/nobody%40192.168.3.12
> variable_endpoint_disposition: INBOUND%20CALL
> variable_sip_call_id: 824f7531-a82e-122b-8485-000f1f644b48
> variable_sip_user_agent: FreeSWITCH-mod_sofia/1.0.pre4-8539
> variable_sip_via_host: 192.168.3.12
> variable_sip_via_rport: 5060
> variable_max_forwards: 70
> Event-Name: CHANNEL_CREATE
> Core-UUID: ed9888ba-2c94-11dd-
> 10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - ContentLength
> = 3284
> 10:27:55,867 [AnonymousIoService-1] DEBUG FSResponseDecoder - total buffer
> length = 1295
>
>
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org