- sdpcontainer::Sdp - add get mediaLineAtIndex api

- sdpcontainer::SdpMediaLine - add more crypto type definitions
This commit is contained in:
Scott Godin
2026-01-08 19:15:51 -05:00
parent c76b5b4247
commit 3c5d8b2b78
4 changed files with 56 additions and 4 deletions

View File

@@ -262,6 +262,21 @@ Sdp::getMediaLines() const
return mMediaLines;
}
SdpMediaLine*
Sdp::getMediaLineAtIndex(int indexNumber)
{
MediaLineList::iterator it = mMediaLines.begin();
int mediaLineIndex = 0;
for (; it != mMediaLines.end(); it++, mediaLineIndex++)
{
if (mediaLineIndex == indexNumber)
{
return *it;
}
}
return nullptr;
}
resip::Data
Sdp::getLocalFoundationId(SdpCandidate::SdpCandidateType candidateType,
const char * baseAddress,
@@ -383,6 +398,7 @@ sdpcontainer::operator<<( EncodeStream& strm, const Sdp& sdp)
/* ====================================================================
Copyright (c) 2026, SIP Spectrum, Inc. https://www.sipspectrum.com
Copyright (c) 2007-2008, Plantronics, Inc.
All rights reserved.

View File

@@ -294,6 +294,7 @@ public:
double getMaximumPacketRate() const { return mMaximumPacketRate; }
const MediaLineList& getMediaLines() const;
SdpMediaLine* getMediaLineAtIndex(int indexNumber); // 0 based
resip::Data getLocalFoundationId(SdpCandidate::SdpCandidateType candidateType, const char * baseAddress, const char * stunAddress=0);
@@ -369,6 +370,7 @@ EncodeStream& operator<<(EncodeStream& strm, const Sdp& );
/* ====================================================================
Copyright (c) 2026, SIP Spectrum, Inc. https://www.sipspectrum.com
Copyright (c) 2007-2008, Plantronics, Inc.
All rights reserved.

View File

@@ -78,7 +78,11 @@ const char* SdpMediaLine::SdpCryptoSuiteTypeString[] =
"NONE",
"AES_CM_128_HMAC_SHA1_80",
"AES_CM_128_HMAC_SHA1_32",
"F8_128_HMAC_SHA1_80"
"F8_128_HMAC_SHA1_80",
"AES_CM_192_HMAC_SHA1_80",
"AES_CM_192_HMAC_SHA1_32",
"AES_CM_256_HMAC_SHA1_80",
"AES_CM_256_HMAC_SHA1_32"
};
const char* SdpMediaLine::SdpCryptoKeyMethodString[] =
@@ -478,6 +482,30 @@ SdpMediaLine::getCryptoSuiteTypeFromString(const char * type)
{
return CRYPTO_SUITE_TYPE_F8_128_HMAC_SHA1_80;
}
// RFC6188 places the _CM after the Master Key length for some reason - accept both
else if (resip::isEqualNoCase("AES_CM_192_HMAC_SHA1_80", dataType) ||
resip::isEqualNoCase("AES_192_CM_HMAC_SHA1_80", dataType))
{
return CRYPTO_SUITE_TYPE_AES_CM_192_HMAC_SHA1_80;
}
// RFC6188 places the _CM after the Master Key length for some reason - accept both
else if (resip::isEqualNoCase("AES_CM_192_HMAC_SHA1_32", dataType) ||
resip::isEqualNoCase("AES_192_CM_HMAC_SHA1_32", dataType))
{
return CRYPTO_SUITE_TYPE_AES_CM_192_HMAC_SHA1_32;
}
// RFC6188 places the _CM after the Master Key length for some reason - accept both
else if (resip::isEqualNoCase("AES_CM_256_HMAC_SHA1_80", dataType) ||
resip::isEqualNoCase("AES_256_CM_HMAC_SHA1_80", dataType))
{
return CRYPTO_SUITE_TYPE_AES_CM_256_HMAC_SHA1_80;
}
// RFC6188 places the _CM after the Master Key length for some reason - accept both
else if (resip::isEqualNoCase("AES_CM_256_HMAC_SHA1_32", dataType) ||
resip::isEqualNoCase("AES_256_CM_HMAC_SHA1_32", dataType))
{
return CRYPTO_SUITE_TYPE_AES_CM_256_HMAC_SHA1_32;
}
else
{
return CRYPTO_SUITE_TYPE_NONE;
@@ -830,6 +858,7 @@ sdpcontainer::operator<<( EncodeStream& strm, const SdpMediaLine& sdpMediaLine)
/* ====================================================================
Copyright (c) 2026, SIP Spectrum, Inc. https://www.sipspectrum.com
Copyright (c) 2007-2008, Plantronics, Inc.
All rights reserved.

View File

@@ -130,9 +130,13 @@ public:
typedef enum
{
CRYPTO_SUITE_TYPE_NONE,
CRYPTO_SUITE_TYPE_AES_CM_128_HMAC_SHA1_80, // "AES_CM_128_HMAC_SHA1_80" - RFC4568
CRYPTO_SUITE_TYPE_AES_CM_128_HMAC_SHA1_32, // "AES_CM_128_HMAC_SHA1_32" - RFC4568
CRYPTO_SUITE_TYPE_F8_128_HMAC_SHA1_80 // "F8_128_HMAC_SHA1_80" - RFC4568
CRYPTO_SUITE_TYPE_AES_CM_128_HMAC_SHA1_80, // RFC4568
CRYPTO_SUITE_TYPE_AES_CM_128_HMAC_SHA1_32, // RFC4568
CRYPTO_SUITE_TYPE_F8_128_HMAC_SHA1_80, // RFC4568
CRYPTO_SUITE_TYPE_AES_CM_192_HMAC_SHA1_80, // RFC6188
CRYPTO_SUITE_TYPE_AES_CM_192_HMAC_SHA1_32, // RFC6188
CRYPTO_SUITE_TYPE_AES_CM_256_HMAC_SHA1_80, // RFC6188
CRYPTO_SUITE_TYPE_AES_CM_256_HMAC_SHA1_32 // RFC6188
} SdpCryptoSuiteType;
static const char* SdpCryptoSuiteTypeString[];
@@ -682,6 +686,7 @@ EncodeStream& operator<<(EncodeStream& strm, const SdpMediaLine& );
/* ====================================================================
Copyright (c) 2026, SIP Spectrum, Inc. https://www.sipspectrum.com
Copyright (c) 2007-2008, Plantronics, Inc.
All rights reserved.