0
votes

I'm developing a SIP provider application.I use transport UDP.And I have a Questions, I sending a Invite message SIP Server.

INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.1.33:5001;branch=z9hG4bK9232c352-a28c-4467-988e-8027e0031209;rport
To: <sip:[email protected]>
From: "101"<sip:[email protected]:5060>;tag=rkktjbvq
CSeq: 1 INVITE
Call-ID: lrfnpvlvrbojabxnuldgejvncshccjpwsfxsobpcpmjrnsvkeh
Max-Forwards: 70
Contact: <sip:[email protected]:5001>
User-Agent: Iconium
Content-Type: application/sdp
Content-Length: 849

v=0
o=101 940412967 940412967 IN IP4 192.168.1.33
s=Ozeki VoIP SIP SDK
c=IN IP4 192.168.1.33
t=0 0
m=audio 5003 RTP/AVP 8 0 101 98 9 3 100 97 103 15 4 104 105 106 107 18
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=rtpmap:98 iLBC/8000
a=fmtp:98 mode=30
a=rtpmap:9 G722/8000
a=fmtp:9 bitrate=64000
a=rtpmap:3 GSM/8000
a=rtpmap:100 SPEEX/16000
a=rtpmap:97 SPEEX/8000
a=rtpmap:103 L16/8000
a=rtpmap:15 G728/8000
a=rtpmap:4 G723/8000
a=rtpmap:104 G726-16/8000
a=rtpmap:105 G726-24/8000
a=rtpmap:106 G726-32/8000
a=rtpmap:107 G726-40/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=sendrecv
m=video 5005 RTP/AVP 102 99 34
a=rtpmap:102 H263-1998/90000
a=fmtp:102 QCIF=1;CIF=1
a=rtpmap:99 H264/90000
a=fmtp:99 packetization-mode=1
a=rtpmap:34 H263/90000
a=fmtp:34 QCIF=1;CIF=1
a=sendrecv

Everything is okay.And SIP Server response with Proxy-Authenticate

SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 192.168.1.33:5001;branch=z9hG4bK9232c352-a28c-4467-988e-8027e0031209;rport=5001
Proxy-Authenticate:Digest nonce="414d535c05ab5fd821:79225947c170510b155be0828d92e7e4", algorithm=MD5, realm="3CXPhoneSystem"
To: <sip:[email protected]>;tag=d92fe85a
From: "101"<sip:[email protected]:5060>;tag=rkktjbvq
Call-ID: lrfnpvlvrbojabxnuldgejvncshccjpwsfxsobpcpmjrnsvkeh
CSeq: 1 INVITE
User-Agent: 3CXPhoneSystem 10.0.23053.0
Content-Length: 0

And I send Authanticate with ACK;

INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.1.33:5001;branch=z9hG4bKaaf896d5-bd08-48f2-8e3d-0cf043e8324e;rport
To: <sip:[email protected]>
From: "101"<sip:[email protected]:5060>;tag=rkktjbvq
CSeq: 2 INVITE
Call-ID: lrfnpvlvrbojabxnuldgejvncshccjpwsfxsobpcpmjrnsvkeh
Max-Forwards: 70
Contact: <sip:[email protected]:5001>
User-Agent: Iconium
Content-Type: application/sdp
Proxy-Authorization:Digest username="101", realm="3CXPhoneSystem", nonce="414d535c05ab5fd821:79225947c170510b155be0828d92e7e4", response="8592afb1b7f3440afd9607dc3db588cb", uri="sip:[email protected]", algorithm=MD5
Content-Length: 849

v=0
o=101 940412967 940412967 IN IP4 192.168.1.33
s=Ozeki VoIP SIP SDK
c=IN IP4 192.168.1.33
t=0 0
m=audio 5003 RTP/AVP 8 0 101 98 9 3 100 97 103 15 4 104 105 106 107 18
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=rtpmap:98 iLBC/8000
a=fmtp:98 mode=30
a=rtpmap:9 G722/8000
a=fmtp:9 bitrate=64000
a=rtpmap:3 GSM/8000
a=rtpmap:100 SPEEX/16000
a=rtpmap:97 SPEEX/8000
a=rtpmap:103 L16/8000
a=rtpmap:15 G728/8000
a=rtpmap:4 G723/8000
a=rtpmap:104 G726-16/8000
a=rtpmap:105 G726-24/8000
a=rtpmap:106 G726-32/8000
a=rtpmap:107 G726-40/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=sendrecv
m=video 5005 RTP/AVP 102 99 34
a=rtpmap:102 H263-1998/90000
a=fmtp:102 QCIF=1;CIF=1
a=rtpmap:99 H264/90000
a=fmtp:99 packetization-mode=1
a=rtpmap:34 H263/90000
a=fmtp:34 QCIF=1;CIF=1
a=sendrecv

And Sıp server response with

SIP 2.0/400 Bad Content-Length(larger than datagram)

But in Ozeki Voip SDK , while content-length=851 everything is okay.(using UDP transport)

How can I do for this?Where is the my problem?

Edit: My UDP client:

 private void SendSIPMessage(string mesaj, bool korumalı)
        {

            IPEndPoint remotendpoint = new IPEndPoint(IPAddress.Any, port);
            UdpClient udpClient = new UdpClient();
            try
            {
                udpClient.Connect("192.168.1.33", 5060);
                Byte[] sendBytes = Encoding.ASCII.GetBytes(mesaj);
                udpClient.Send(sendBytes, sendBytes.Length);
                string receivedMessage = string.Empty;
                Byte[] receiveBytes = udpClient.Receive(ref remotendpoint);
                receivedMessage = Encoding.ASCII.GetString(receiveBytes);
                label1.Text += receivedMessage + "\n";

        }
3
If you view the messages sent over the network through something like Wireshark, what do you see? Is your UDP datagram fragmenting?Frank Shearar

3 Answers

0
votes

Simply the server might have a setting to reject too large UDP packets. I would suggest to remove some codecs from your software. Your list is too large and I don't think that it has any reason.

4
votes

It might be because your UDP SIP packet is over MTU or 1300 bytes.

RFC 3261 - 18.1.1 Sending Requests

If a request is within 200 bytes of the path MTU, or if it is larger than 1300 bytes and the path MTU is unknown, the request MUST be sent using an RFC 2914 [43] congestion controlled transport protocol, such as TCP.

0
votes

Most SIP proxies would accept that size of message over UDP no problem. You might want to try a different SIP server. In production systems, it is fairly normal for the SIP message to get larger than a single MTU but this still work when the UDP packets gets fragmented into two parts.