< Previous by Date Date Index Next by Date >
  Thread Index  

[reSIProcate-users] SDP parsing session attribute "a="


 
Hi All,
 
Since in resiprocate we don't handle the case when "a=" lines are befote "t=" . We will never parse the media in this case. 
 
I added this fixe to be able to handle the case "a=" is before and/or after "t=". We found a case where an SBC sends these kind od packets.
 
Here is the easy fixe :
 
 

SdpContents::Session::parse(ParseBuffer& pb)

{

     pb.skipChar('v');

     pb.skipChar(Symbols::EQUALS[0]);

     mVersion = pb.integer();

    skipEol(pb);

   mOrigin.parse(pb);

   pb.skipChar('s');

   const char* anchor = pb.skipChar(Symbols::EQUALS[0]);

   pb.skipToOneOf(Symbols::CRLF);

  pb.data(mName, anchor);

   skipEol(pb);

   if (!pb.eof() && *pb.position() == 'i')

   {

       pb.skipChar('i');

      const char* anchor = pb.skipChar(Symbols::EQUALS[0]);

      pb.skipToOneOf(Symbols::CRLF);

      pb.data(mInformation, anchor);

     skipEol(pb);

   }

   if (!pb.eof() && *pb.position() == 'u')

   {

       pb.skipChar('u');

      pb.skipChar(Symbols::EQUALS[0]);

     mUri.parse(pb);

     skipEol(pb);

   }

   while (!pb.eof() && *pb.position() == 'e')

  {

      addEmail(Email());

     mEmails.back().parse(pb);

   }

   while (!pb.eof() && *pb.position() == 'p')

  {

     addPhone(Phone());

     mPhones.back().parse(pb);

   }

   if (!pb.eof() && *pb.position() == 'c')

   {

       mConnection.parse(pb);

    }

    while (!pb.eof() && *pb.position() == 'b')

    {

        addBandwidth(Bandwidth());

        mBandwidths.back().parse(pb);

    }

//aziz

    mAttributeHelper.parse(pb);

//

    while (!pb.eof() && *pb.position() == 't')

    {

       addTime(Time());

      mTimes.back().parse(pb);

   }

   if (!pb.eof() && *pb.position() == 'z')

   {

       mTimezones.parse(pb);

    }

    if (!pb.eof() && *pb.position() == 'k')

    {

           mEncryption.parse(pb);

    }

     mAttributeHelper.parse(pb);

    while (!pb.eof() && *pb.position() == 'm')

     {

          addMedium(Medium());

          mMedia.back().parse(pb);

     }

}

thank you

Aziz