Hi All,

I think I have uncovered another bug, this time in sipXMediaLib.

In MprToNet.cpp

void MprToNet::setSSRC(int iSSRC)
{
   mSSRC = htonl(iSSRC);
   mSeqNum = rand_timer32() | 0xfc00;
   mTimestampDelta = rand_timer32();
}

Then the Rtp Packet is setup by calling
pRtpPacket->setRtpSSRC(mSSRC);

void setRtpSSRC(RtpSRC ssrc)   { mRtpHeader.ssrc = htonl(ssrc);}

I.e. the ssrc gets ssrc on the network = htonl(htonl(ssrc))

I think the correct fix is to

void MprToNet::setSSRC(int iSSRC)
{
   mSSRC = iSSRC;
   mSeqNum = rand_timer32() | 0xfc00;
   mTimestampDelta = rand_timer32();
}


I discovered this because the RTCP code correctly encodes the SSRC,
but the RTP code winds up with the SSRC in the wrong endian-ness.
This causes a SSRC mismatch and thus incorrect processing ...

Patch attached....

ALSO: I have made changes to get the RTCP code working,
basically changing the RTPAudioINpu


--
Regards

Paul Whitfield
Software Engineer

15 Hector St Osborne Park
Perth WA 6017
P:  +61 8 9445 2633
F:  +61 8 9445 1687
I: www.omnitronics.com.au <http://www.omnitronics.com.au>

  Please consider the environment before printing this email.
This message and any attachment are confidential. If you are not the
intended recipient, please telephone or email the sender and delete the
message and any attachment from your system. If you are not the intended
recipient you must not copy this message or attachment or disclose the
contents to any other person.

Index: sipXmediaLib/src/mp/MprToNet.cpp
===================================================================
--- sipXmediaLib/src/mp/MprToNet.cpp    (revision 11022)
+++ sipXmediaLib/src/mp/MprToNet.cpp    (working copy)
@@ -134,7 +134,7 @@
 
 void MprToNet::setSSRC(int iSSRC)
 {
-   mSSRC = htonl(iSSRC);
+   mSSRC = iSSRC;
    mSeqNum = rand_timer32() | 0xfc00;
    mTimestampDelta = rand_timer32();
 }
_______________________________________________
sipxtapi-dev mailing list
sipxtapi-dev@list.sipfoundry.org
List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/

Reply via email to