sip parser

hi, how to pass a complete sip message and receive it completely in TCP Client and print after full SIP Message has been received. Client should display the status like half SIP Message received / Waiting for Full Message/ Full Message received etc. can anyone please help
[298 byte] By [raji83a] at [2007-10-2 5:25:58]
# 1

this is the sip message i need to pass.

SUBSCRIBE sip:user2_public1@home2.net SIP/2.0

Via: SIP/2.0/UDP [5555::aaa:bbb:ccc:ddd]:1357;comp=sigcomp;branch=z9hG4bKnashds7

Max-Forwards: 70

P-Access-Network-Info: 3GPP-UTRAN-TDD; utran-cell-id-3gpp=234151D0FCE11

Route: <sip:pcscf1.visited1.net:7531;lr;comp=sigcomp>, <sip:orig@scscf1.home1.net;lr>

P-Preferred-Identity: <sip:user1_public1@home1.net>

Privacy: none

From: <sip:user1_public1@home1.net>;tag=31415

To: <sip:user2_public1@home2.net>

Call-ID: b89rjhnedlrfjflslj40a222

CSeq: 61 SUBSCRIBE

Require: sec-agree

Proxy-Require: sec-agree

Security-Verify: ipsec-3gpp; q=0.1; alg=hmac-sha-1-96; spi-c=98765432; spi-s=87654321; port-c=8642; port-s=7531

Event: presence

Expires: 7200

Accept: application/pidf+xml;q=0.3, application/pidf-diff+xml;q=1

Contact: <sip:[5555::aaa:bbb:ccc:ddd]:1357;comp=sigcomp>

Content-Length: 0

but i have no idea of how to do it.please help me out.....

raji83a at 2007-7-16 1:27:45 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2
can anyone please tell me the site where i will get any sample code of sip parsers using j2me.
raji83a at 2007-7-16 1:27:45 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3
- read lines- split on ":"- put key value pait in hashtableShould work just fine
deepspacea at 2007-7-16 1:27:46 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 4
thank you very much. but can you please tell me any informative sites on sip parsers as i need to develop a sip parser from scratch.or is there any sip parsers developed already using j2me so that i can refer to those codes.
raji83a at 2007-7-16 1:27:46 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 5
I can't you help you there I'm afraid.I don't know nothing about sip. I just saw your example, and posted what I would do to make a parser for it. Shouldn't be to hard to implement.
deepspacea at 2007-7-16 1:27:46 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 6

just happened to find your posting in Google today. perhaps a bit late on reply

have u found your answer yet?

u may check out project jain-sip, perhaps u have already known by now.

https://jain-sip.dev.java.net/

there is a parser in the source code tree for SIP message

btw, I am looking for a parser for PIDF and presence. do u have experience on it?

mcleunga at 2007-7-16 1:27:46 > top of Java-index,Java Mobility Forums,Java ME Technologies...