openbsd-ports/net/openh323/patches/patch-src_h323caps_cxx
ajacoutot 22a8a5a4b3 - major upgrade to openh323-1.19.0.1
- install version.h
- H323Capabilities patch from FreeBSD
- make it compile with new pwlib
2008-03-15 17:38:43 +00:00

61 lines
2.2 KiB
Plaintext

$OpenBSD: patch-src_h323caps_cxx,v 1.1 2008/03/15 17:38:43 ajacoutot Exp $
--- src/h323caps.cxx.orig Tue May 16 13:36:01 2006
+++ src/h323caps.cxx Tue Mar 4 16:35:37 2008
@@ -2076,7 +2076,7 @@ PINDEX H323Capabilities::AddAllCapabilities(PINDEX des
PINDEX simultaneous,
const PString & name)
{
- PINDEX reply = descriptorNum == P_MAX_INDEX ? P_MAX_INDEX : simultaneous;
+/* PINDEX reply = descriptorNum == P_MAX_INDEX ? P_MAX_INDEX : simultaneous;
PStringArray wildcard = name.Tokenise('*', FALSE);
@@ -2109,6 +2109,47 @@ PINDEX H323Capabilities::AddAllCapabilities(PINDEX des
}
return reply;
+*/
+
+
+
+
+/* From FreeBSD ports */
+ PINDEX reply = descriptorNum == P_MAX_INDEX ? P_MAX_INDEX : simultaneous;
+
+ PStringArray wildcard = name.Tokenise('*', FALSE);
+
+ H323CapabilityFactory::KeyList_T stdCaps = H323CapabilityFactory::GetKeyList();
+
+ for (unsigned session = OpalMediaFormat::FirstSessionID; session <= OpalMediaFormat::LastSessionID; session++) {
+ for (H323CapabilityFactory::KeyList_T::const_iterator r = stdCaps.begin(); r != stdCaps.end(); ++r) {
+ PString capName(*r);
+ if (MatchWildcard(capName, wildcard) && (FindCapability(capName) == NULL)) {
+ OpalMediaFormat mediaFormat(capName);
+ if (!mediaFormat.IsValid() && (capName.Right(4) == "{sw}") && capName.GetLength() > 4)
+ mediaFormat = OpalMediaFormat(capName.Left(capName.GetLength()-4));
+ if (mediaFormat.IsValid() && mediaFormat.GetDefaultSessionID() == session) {
+ // add the capability
+ H323Capability * capability = H323Capability::Create(capName);
+ PINDEX num = SetCapability(descriptorNum, simultaneous, capability);
+ if (descriptorNum == P_MAX_INDEX) {
+ reply = num;
+ descriptorNum = num;
+ simultaneous = P_MAX_INDEX;
+ }
+ else if (simultaneous == P_MAX_INDEX) {
+ if (reply == P_MAX_INDEX)
+ reply = num;
+ simultaneous = num;
+ }
+ }
+ }
+ }
+ simultaneous = P_MAX_INDEX;
+ }
+
+ return reply;
+
}