[sip-comm-dev] Problems with large sip messages


#1

hi.I'm developing some specific security services(integrity, confidentiality, non repudiation) for SIP communicator.
Inside the SDP message body of SIP message i put encrypted content ,signatures and other things. I have to face some problem relating to the size of SIP messages.
For example when i send an invite+its body:
i put the specific content (client side) inside the method call invite
with
invite.setcontent(sdpcontent,content-typeheader)

when i have to read the sdcontent to server side:
inside the method processInvite
i extract the content with
invite.getRawContent()

the problem is that when i send in sdcontent large message
the function getrawcontent cut some lines of the content.

To find a solution i sniffed the udp packet to see if a udp packet loss occurred but on the server side the packets arrive correctly.
So i think the problem can be:
in the manner with wich udp packets are handled by sip stack
a possible maximum size set (i don't know where) for sip messages
a problem with the getrawcontent and string/bytes conversion

Thanx in advance for some suggestions.

···

---------------------------------
Yahoo! Companion - Scarica gratis la toolbar di Ricerca di Yahoo!


#2

Unfortunately I'm not very well acquainted with the parsing module of the nist-sip stack

Ranga, perhaps you would be able to shed some light?

Emil

luigi lucci wrote:

···

hi.I'm developing some specific security services(integrity, confidentiality, non repudiation) for SIP communicator.
Inside the SDP message body of SIP message i put encrypted content ,signatures and other things. I have to face some problem relating to the size of SIP messages.
For example when i send an invite+its body:
i put the specific content (client side) inside the method call invite
with
invite.setcontent(sdpcontent,content-typeheader)
when i have to read the sdcontent to server side:
inside the method processInvite
i extract the content with
invite.getRawContent()
the problem is that when i send in sdcontent large message
the function getrawcontent cut some lines of the content.
To find a solution i sniffed the udp packet to see if a udp packet loss occurred but on the server side the packets arrive correctly.
So i think the problem can be:
in the manner with wich udp packets are handled by sip stack
a possible maximum size set (i don't know where) for sip messages
a problem with the getrawcontent and string/bytes conversion
Thanx in advance for some suggestions.

------------------------------------------------------------------------
*Yahoo! Companion* <http://it.rd.yahoo.com/mail/taglines/*http://it.companion.yahoo.com> - Scarica gratis la toolbar di Ricerca di Yahoo!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Hi Emil, Liugi,

Off hand I dont see the problem but it would help if you can send me a debug log file. How big are the messages that you had tried to send? Are you absolutely sure that you have not set the content length manually somewhere. You might have set to something smaller than the actual content. I would be suspicious of that before anything else. If the content length is set too small then the bottom of your message will be cut off. One cause of such errors is to look for \r\n sequeces and treat them as a single characeter rather than 2 characters. Another one has been to count characters instead of bytes in strings. Not having seen your code, it is a wild guess.

Ranga.

Emil Ivov wrote:

···

Unfortunately I'm not very well acquainted with the parsing module of the nist-sip stack

Ranga, perhaps you would be able to shed some light?

Emil

luigi lucci wrote:

hi.I'm developing some specific security services(integrity, confidentiality, non repudiation) for SIP communicator.
Inside the SDP message body of SIP message i put encrypted content ,signatures and other things. I have to face some problem relating to the size of SIP messages.
For example when i send an invite+its body:
i put the specific content (client side) inside the method call invite
with
invite.setcontent(sdpcontent,content-typeheader)
when i have to read the sdcontent to server side:
inside the method processInvite
i extract the content with
invite.getRawContent()
the problem is that when i send in sdcontent large message
the function getrawcontent cut some lines of the content.
To find a solution i sniffed the udp packet to see if a udp packet loss occurred but on the server side the packets arrive correctly.
So i think the problem can be:
in the manner with wich udp packets are handled by sip stack
a possible maximum size set (i don't know where) for sip messages
a problem with the getrawcontent and string/bytes conversion
Thanx in advance for some suggestions.

------------------------------------------------------------------------
*Yahoo! Companion* <http://it.rd.yahoo.com/mail/taglines/*http://it.companion.yahoo.com> - Scarica gratis la toolbar di Ricerca di Yahoo!

--
M. Ranganathan

Advanced Networking Technologies Divsion,
National Institute of Standards and Technology (NIST),
100 Bureau Drive, Stop 8920, Gaithersburg, MD 20899. tel:301 975 3664 , fax:301 590 0932 http://w3.antd.nist.gov/
Advanced Networking Technologies For the People!


#4

I don't set the contentlength i only get the content length to see if the size of message sent and received are the same.

when i send :

invite.setcontent(sdpcontent,content-typeheader);

ContentLengthHeader cl = invite.getContentLength();

System.out.println(cl.getContentLength());

The last two operations added by me
the contentelength printed is 8156
In sdpcontent i put a string that is a s/mime multipart message.
the last part of the s/mime message is cut on the server side.
A part is something like this:

------=_Part_0_13480046.1082476454363

Content-Type: application/pkcs7-signature; name=smime.p7s; smime-type=signed-data

Content-Transfer-Encoding: base64

Content-Disposition: attachment; filename="smime.p7s"

Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIICADCCAfww

ggGmoAMCAQACBECFPTcwDQYJKoZIhvcNAQEEBQAwgYQxGTAXBgkqhkiG9w0BCQEWCmxpb0B0aW4u

aXQxCzAJBgNVBAYTAmNhMRMwEQYDVQQIEwpjYWxpZm9ybmlhMRQwEgYDVQQHEwtsb3MgYW5nZWxl

czEQMA4GA1UEChMHY2VmcmllbDEOMAwGA1UECxMFZmllbGQxDTALBgNVBAMTBG1pa2UwHhcNMDQw

NDIwMTUwOTQzWhcNMDYxMDA3MTUwOTQzWjCBhDEZMBcGCSqGSIb3DQEJARYKbGlvQHRpbi5pdDEL

MAkGA1UEBhMCY2ExEzARBgNVBAgTCmNhbGlmb3JuaWExFDASBgNVBAcTC2xvcyBhbmdlbGVzMRAw

DgYDVQQKEwdjZWZyaWVsMQ4wDAYDVQQLEwVmaWVsZDENMAsGA1UEAxMEbWlrZTBcMA0GCSqGSIb3

DQEBAQUAA0sAMEgCQQCsn5JXmaqY7sDIbFXGV6im9uLIy8osMv5aincIxcG8VhxAbjApWhSUtS+w

5EisPsMaLXOYGhoodzi4FX386ovNAgMBAAEwDQYJKoZIhvcNAQEEBQADQQA59fxAFXzXcY3/QtV4

swNFuuQN6A9kGjREPPoGx0Vo9SBxh+mhmoI37dZQV64BrMUaHUDNGhI08WGTc2qVH+diMYICLjCC

AioCAQEwgY0wgYQxGTAXBgkqhkiG9w0BCQEWCmxpb0B0aW4uaXQxCzAJBgNVBAYTAmNhMRMwEQYD

t4yuOuRTDlvFJ7Dtfll3RFmQNzmsm/NHpG4SNxm2Oc/SGwjrEJVEK741uwAAAAAAAA==

------=_Part_0_13480046.1082476454363--

the code on server side is :

void processInvite(ServerTransaction serverTransaction, Request invite)

{

try {

console.logEntry();

Dialog dialog = serverTransaction.getDialog();

Call call = callDispatcher.createCall(dialog, invite);

sipManCallback.fireCallReceived(call);

call.setState(Call.ALERTING);

ContentLengthHeader cl = invite.getContentLength();

System.out.println(cl.getContentLength());
The result of the last instruction is 7786 and the content of the invite is not equal to that of the originator.

I sniffed the packets with Ethereal and the message arrives correctly on the server side.If the message is smaller than 8K the message is handled correctly
Where is the problem?

Hi Emil, Liugi,

Off hand I dont see the problem but it would help if you can send me a
debug log file. How big are the messages that you had tried to send? Are
you absolutely sure that you have not set the content length manually
somewhere. You might have set to something smaller than the actual
content. I would be suspicious of that before anything else. If the
content length is set too small then the bottom of your message will be
cut off. One cause of such errors is to look for \r\n sequeces and treat
them as a single characeter rather than 2 characters. Another one has
been to count characters instead of bytes in strings. Not having seen
your code, it is a wild guess.

Ranga.

Emil Ivov wrote:

···

"M. Ranganathan" <mranga@nist.gov> wrote:

Unfortunately I'm not very well acquainted with the parsing module of
the nist-sip stack

Ranga, perhaps you would be able to shed some light?

Emil

luigi lucci wrote:

hi.I'm developing some specific security services(integrity,
confidentiality, non repudiation) for SIP communicator.
Inside the SDP message body of SIP message i put encrypted content
,signatures and other things. I have to face some problem relating to
the size of SIP messages.
For example when i send an invite+its body:
i put the specific content (client side) inside the method call invite
with
invite.setcontent(sdpcontent,content-typeheader)

when i have to read the sdcontent to server side:
inside the method processInvite
i extract the content with
invite.getRawContent()

the problem is that when i send in sdcontent large message
the function getrawcontent cut some lines of the content.

To find a solution i sniffed the udp packet to see if a udp packet
loss occurred but on the server side the packets arrive correctly.
So i think the problem can be:
in the manner with wich udp packets are handled by sip stack
a possible maximum size set (i don't know where) for sip messages
a problem with the getrawcontent and string/bytes conversion

Thanx in advance for some suggestions.

------------------------------------------------------------------------
*Yahoo! Companion*

- Scarica gratis la toolbar di Ricerca di Yahoo!

--
M. Ranganathan

Advanced Networking Technologies Divsion,
National Institute of Standards and Technology (NIST),
100 Bureau Drive, Stop 8920, Gaithersburg, MD 20899.
tel:301 975 3664 , fax:301 590 0932 http://w3.antd.nist.gov/
Advanced Networking Technologies For the People!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------
Yahoo! Companion - Scarica gratis la toolbar di Ricerca di Yahoo!