[asterisk-commits] pcadach: trunk r43354 - /trunk/channels/h323/
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Wed Sep 20 12:21:15 MST 2006
Author: pcadach
Date: Wed Sep 20 14:21:15 2006
New Revision: 43354
URL: http://svn.digium.com/view/asterisk?rev=43354&view=rev
Log:
Split capability definitions into own source file
Added:
trunk/channels/h323/caps_h323.cxx (with props)
trunk/channels/h323/caps_h323.h (with props)
Modified:
trunk/channels/h323/Makefile.in
trunk/channels/h323/ast_h323.cxx
trunk/channels/h323/ast_h323.h
Modified: trunk/channels/h323/Makefile.in
URL: http://svn.digium.com/view/asterisk/trunk/channels/h323/Makefile.in?rev=43354&r1=43353&r2=43354&view=diff
==============================================================================
--- trunk/channels/h323/Makefile.in (original)
+++ trunk/channels/h323/Makefile.in Wed Sep 20 14:21:15 2006
@@ -16,7 +16,7 @@
CFLAGS = -pipe
TARGET = libchanh323.a
TARGET += Makefile.ast
-SOURCES = ast_h323.cxx compat_h323.cxx cisco-h225.cxx
+SOURCES = ast_h323.cxx compat_h323.cxx cisco-h225.cxx caps_h323.cxx
OBJDIR = .
OBJS =
Modified: trunk/channels/h323/ast_h323.cxx
URL: http://svn.digium.com/view/asterisk/trunk/channels/h323/ast_h323.cxx?rev=43354&r1=43353&r2=43354&view=diff
==============================================================================
--- trunk/channels/h323/ast_h323.cxx (original)
+++ trunk/channels/h323/ast_h323.cxx Wed Sep 20 14:21:15 2006
@@ -53,6 +53,7 @@
#include "chan_h323.h"
#include "ast_h323.h"
#include "cisco-h225.h"
+#include "caps_h323.h"
/* PWlib Required Components */
#define MAJOR_VERSION 1
@@ -208,240 +209,6 @@
{
ast_log(LOG_ERROR, "%s\n", msg);
/* XXX: Probably we need to crash here */
-}
-
-#define DEFINE_G711_CAPABILITY(cls, code, capName) \
-class cls : public AST_G711Capability { \
- public: \
- cls() : AST_G711Capability(240, code) { } \
-}; \
-H323_REGISTER_CAPABILITY(cls, capName) \
-
-DEFINE_G711_CAPABILITY(AST_G711ALaw64Capability, H323_G711Capability::ALaw, OPAL_G711_ALAW_64K);
-DEFINE_G711_CAPABILITY(AST_G711uLaw64Capability, H323_G711Capability::muLaw, OPAL_G711_ULAW_64K);
-H323_REGISTER_CAPABILITY(AST_G7231Capability, OPAL_G7231);
-H323_REGISTER_CAPABILITY(AST_G729Capability, OPAL_G729);
-H323_REGISTER_CAPABILITY(AST_G729ACapability, OPAL_G729A);
-H323_REGISTER_CAPABILITY(AST_GSM0610Capability, OPAL_GSM0610);
-
-/*
- * Capability: G.711
- */
-AST_G711Capability::AST_G711Capability(int rx_frames, H323_G711Capability::Mode m, H323_G711Capability::Speed s)
- : H323AudioCapability(rx_frames, 30) // 240ms max, 30ms desired
-{
- mode = m;
- speed = s;
-}
-
-
-PObject * AST_G711Capability::Clone() const
-{
- return new AST_G711Capability(*this);
-}
-
-
-unsigned AST_G711Capability::GetSubType() const
-{
- static const unsigned G711SubType[2][2] = {
- { H245_AudioCapability::e_g711Alaw64k, H245_AudioCapability::e_g711Alaw56k },
- { H245_AudioCapability::e_g711Ulaw64k, H245_AudioCapability::e_g711Ulaw56k }
- };
- return G711SubType[mode][speed];
-}
-
-
-PString AST_G711Capability::GetFormatName() const
-{
- static const char * const G711Name[2][2] = {
- { OPAL_G711_ALAW_64K, OPAL_G711_ALAW_56K },
- { OPAL_G711_ULAW_64K, OPAL_G711_ULAW_56K },
- };
- return G711Name[mode][speed];
-}
-
-
-H323Codec * AST_G711Capability::CreateCodec(H323Codec::Direction direction) const
-{
- return NULL;
-}
-
-
-/*
- * Capability: G.723.1
- */
-AST_G7231Capability::AST_G7231Capability(int rx_frames, BOOL annexA_)
- : H323AudioCapability(rx_frames, 4)
-{
- annexA = annexA_;
-}
-
-PObject::Comparison AST_G7231Capability::Compare(const PObject & obj) const
-{
- Comparison result = H323AudioCapability::Compare(obj);
- if (result != EqualTo) {
- return result;
- }
- PINDEX otherAnnexA = ((const AST_G7231Capability &)obj).annexA;
- if (annexA < otherAnnexA) {
- return LessThan;
- }
- if (annexA > otherAnnexA) {
- return GreaterThan;
- }
- return EqualTo;
-}
-
-PObject * AST_G7231Capability::Clone() const
-{
- return new AST_G7231Capability(*this);
-}
-
-PString AST_G7231Capability::GetFormatName() const
-{
- return (annexA ? OPAL_G7231 "A" : OPAL_G7231);
-}
-
-unsigned AST_G7231Capability::GetSubType() const
-{
- return H245_AudioCapability::e_g7231;
-}
-
-BOOL AST_G7231Capability::OnSendingPDU(H245_AudioCapability & cap,
- unsigned packetSize) const
-{
- cap.SetTag(H245_AudioCapability::e_g7231);
- H245_AudioCapability_g7231 & g7231 = cap;
- g7231.m_maxAl_sduAudioFrames = packetSize;
- g7231.m_silenceSuppression = annexA;
- return TRUE;
-}
-
-BOOL AST_G7231Capability::OnReceivedPDU(const H245_AudioCapability & cap,
- unsigned & packetSize)
-{
- if (cap.GetTag() != H245_AudioCapability::e_g7231) {
- return FALSE;
- }
- const H245_AudioCapability_g7231 & g7231 = cap;
- packetSize = g7231.m_maxAl_sduAudioFrames;
- annexA = g7231.m_silenceSuppression;
- return TRUE;
-}
-
-H323Codec * AST_G7231Capability::CreateCodec(H323Codec::Direction direction) const
-{
- return NULL;
-}
-
-/*
- * Capability: G.729
- */
-AST_G729Capability::AST_G729Capability(int rx_frames)
- : H323AudioCapability(rx_frames, 2)
-{
-}
-
-PObject * AST_G729Capability::Clone() const
-{
- return new AST_G729Capability(*this);
-}
-
-unsigned AST_G729Capability::GetSubType() const
-{
- return H245_AudioCapability::e_g729;
-}
-
-PString AST_G729Capability::GetFormatName() const
-{
- return OPAL_G729;
-}
-
-H323Codec * AST_G729Capability::CreateCodec(H323Codec::Direction direction) const
-{
- return NULL;
-}
-
-/*
- * Capability: G.729A
- */
-AST_G729ACapability::AST_G729ACapability(int rx_frames)
- : H323AudioCapability(rx_frames, 6)
-{
-}
-
-PObject * AST_G729ACapability::Clone() const
-{
- return new AST_G729ACapability(*this);
-}
-
-unsigned AST_G729ACapability::GetSubType() const
-{
- return H245_AudioCapability::e_g729AnnexA;
-}
-
-PString AST_G729ACapability::GetFormatName() const
-{
- return OPAL_G729A;
-}
-
-H323Codec * AST_G729ACapability::CreateCodec(H323Codec::Direction direction) const
-{
- return NULL;
-}
-
-/*
- * Capability: GSM full rate
- */
-AST_GSM0610Capability::AST_GSM0610Capability(int rx_frames, int comfortNoise_, int scrambled_)
- : H323AudioCapability(rx_frames, 2)
-{
- comfortNoise = comfortNoise_;
- scrambled = scrambled_;
-}
-
-PObject * AST_GSM0610Capability::Clone() const
-{
- return new AST_GSM0610Capability(*this);
-}
-
-unsigned AST_GSM0610Capability::GetSubType() const
-{
- return H245_AudioCapability::e_gsmFullRate;
-}
-
-BOOL AST_GSM0610Capability::OnSendingPDU(H245_AudioCapability & cap,
- unsigned packetSize) const
-{
- cap.SetTag(H245_AudioCapability::e_gsmFullRate);
- H245_GSMAudioCapability & gsm = cap;
- gsm.m_audioUnitSize = packetSize * 33;
- gsm.m_comfortNoise = comfortNoise;
- gsm.m_scrambled = scrambled;
- return TRUE;
-}
-
-BOOL AST_GSM0610Capability::OnReceivedPDU(const H245_AudioCapability & cap,
- unsigned & packetSize)
-{
- if (cap.GetTag() != H245_AudioCapability::e_gsmFullRate)
- return FALSE;
- const H245_GSMAudioCapability & gsm = cap;
- packetSize = (gsm.m_audioUnitSize + 32) / 33;
- comfortNoise = gsm.m_comfortNoise;
- scrambled = gsm.m_scrambled;
-
- return TRUE;
-}
-
-PString AST_GSM0610Capability::GetFormatName() const
-{
- return OPAL_GSM0610;
-}
-
-H323Codec * AST_GSM0610Capability::CreateCodec(H323Codec::Direction direction) const
-{
- return NULL;
}
Modified: trunk/channels/h323/ast_h323.h
URL: http://svn.digium.com/view/asterisk/trunk/channels/h323/ast_h323.h?rev=43354&r1=43353&r2=43354&view=diff
==============================================================================
--- trunk/channels/h323/ast_h323.h (original)
+++ trunk/channels/h323/ast_h323.h Wed Sep 20 14:21:15 2006
@@ -30,127 +30,6 @@
#define AST_H323_H
#define VERSION(a,b,c) ((a)*10000+(b)*100+(c))
-
-/**This class describes the G.711 codec capability.
- */
-class AST_G711Capability : public H323AudioCapability
-{
- PCLASSINFO(AST_G711Capability, H323AudioCapability);
-
-public:
- AST_G711Capability(int rx_frames = 125, H323_G711Capability::Mode _mode = H323_G711Capability::muLaw, H323_G711Capability::Speed _speed = H323_G711Capability::At64k);
- virtual PObject *Clone() const;
- virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
- virtual unsigned GetSubType() const;
- virtual PString GetFormatName() const;
-
-protected:
- H323_G711Capability::Mode mode;
- H323_G711Capability::Speed speed;
-};
-
-/**This class describes the G.723.1 codec capability.
- */
-class AST_G7231Capability : public H323AudioCapability
-{
- PCLASSINFO(AST_G7231Capability, H323AudioCapability);
-
-public:
- AST_G7231Capability(int rx_frames = 7, BOOL annexA = TRUE);
- Comparison Compare(const PObject & obj) const;
- virtual PObject * Clone() const;
- virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
- virtual unsigned GetSubType() const;
- virtual PString GetFormatName() const;
- virtual BOOL OnSendingPDU(H245_AudioCapability & pdu, unsigned packetSize) const;
- virtual BOOL OnReceivedPDU(const H245_AudioCapability & pdu, unsigned & packetSize);
-
-protected:
- BOOL annexA;
-};
-
-/**This class describes the (fake) G729 codec capability.
- */
-class AST_G729Capability : public H323AudioCapability
-{
- PCLASSINFO(AST_G729Capability, H323AudioCapability);
-
-public:
- AST_G729Capability(int rx_frames = 24);
- /* Create a copy of the object. */
- virtual PObject * Clone() const;
-
- /* Create the codec instance, allocating resources as required. */
- virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
-
- /* Get the sub-type of the capability. This is a code dependent on the
- main type of the capability.
-
- This returns one of the four possible combinations of mode and speed
- using the enum values of the protocol ASN H245_AudioCapability class. */
- virtual unsigned GetSubType() const;
-
- /* Get the name of the media data format this class represents. */
- virtual PString GetFormatName() const;
-};
-
-/* This class describes the VoiceAge G729A codec capability. */
-class AST_G729ACapability : public H323AudioCapability
-{
- PCLASSINFO(AST_G729ACapability, H323AudioCapability);
-
-public:
- /* Create a new G.729A capability. */
- AST_G729ACapability(int rx_frames = 24);
-
- /* Create a copy of the object. */
- virtual PObject * Clone() const;
- /* Create the codec instance, allocating resources as required. */
- virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
-
- /* Get the sub-type of the capability. This is a code dependent on the
- main type of the capability.
-
- This returns one of the four possible combinations of mode and speed
- using the enum values of the protocol ASN H245_AudioCapability class. */
- virtual unsigned GetSubType() const;
-
- /* Get the name of the media data format this class represents. */
- virtual PString GetFormatName() const;
-};
-
-/* This class describes the GSM-06.10 codec capability. */
-class AST_GSM0610Capability : public H323AudioCapability
-{
- PCLASSINFO(AST_GSM0610Capability, H323AudioCapability);
-
-public:
- /* Create a new GSM capability. */
- AST_GSM0610Capability(int rx_frames = 24, int comfortNoise = 0, int scrambled = 0);
-
- /* Create a copy of the object. */
- virtual PObject * Clone() const;
-
- /* Create the codec instance, allocating resources as required. */
- virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
-
- /* Get the sub-type of the capability. This is a code dependent on the
- main type of the capability.
-
- This returns one of the four possible combinations of mode and speed
- using the enum values of the protocol ASN H245_AudioCapability class. */
- virtual unsigned GetSubType() const;
-
- /* Get the name of the media data format this class represents. */
- virtual PString GetFormatName() const;
-
- BOOL OnSendingPDU(H245_AudioCapability & pdu, unsigned packetSize) const;
- BOOL OnReceivedPDU(const H245_AudioCapability & pdu, unsigned & packetSize);
-
-protected:
- int comfortNoise;
- int scrambled;
-};
class MyH323EndPoint : public H323EndPoint
{
Added: trunk/channels/h323/caps_h323.cxx
URL: http://svn.digium.com/view/asterisk/trunk/channels/h323/caps_h323.cxx?rev=43354&view=auto
==============================================================================
--- trunk/channels/h323/caps_h323.cxx (added)
+++ trunk/channels/h323/caps_h323.cxx Wed Sep 20 14:21:15 2006
@@ -1,0 +1,237 @@
+#include <ptlib.h>
+#include <h323.h>
+#include "caps_h323.h"
+
+#define DEFINE_G711_CAPABILITY(cls, code, capName) \
+class cls : public AST_G711Capability { \
+ public: \
+ cls() : AST_G711Capability(240, code) { } \
+}; \
+H323_REGISTER_CAPABILITY(cls, capName) \
+
+DEFINE_G711_CAPABILITY(AST_G711ALaw64Capability, H323_G711Capability::ALaw, OPAL_G711_ALAW_64K);
+DEFINE_G711_CAPABILITY(AST_G711uLaw64Capability, H323_G711Capability::muLaw, OPAL_G711_ULAW_64K);
+H323_REGISTER_CAPABILITY(AST_G7231Capability, OPAL_G7231);
+H323_REGISTER_CAPABILITY(AST_G729Capability, OPAL_G729);
+H323_REGISTER_CAPABILITY(AST_G729ACapability, OPAL_G729A);
+H323_REGISTER_CAPABILITY(AST_GSM0610Capability, OPAL_GSM0610);
+
+/*
+ * Capability: G.711
+ */
+AST_G711Capability::AST_G711Capability(int rx_frames, H323_G711Capability::Mode m, H323_G711Capability::Speed s)
+ : H323AudioCapability(rx_frames, 30) // 240ms max, 30ms desired
+{
+ mode = m;
+ speed = s;
+}
+
+
+PObject * AST_G711Capability::Clone() const
+{
+ return new AST_G711Capability(*this);
+}
+
+
+unsigned AST_G711Capability::GetSubType() const
+{
+ static const unsigned G711SubType[2][2] = {
+ { H245_AudioCapability::e_g711Alaw64k, H245_AudioCapability::e_g711Alaw56k },
+ { H245_AudioCapability::e_g711Ulaw64k, H245_AudioCapability::e_g711Ulaw56k }
+ };
+ return G711SubType[mode][speed];
+}
+
+
+PString AST_G711Capability::GetFormatName() const
+{
+ static const char * const G711Name[2][2] = {
+ { OPAL_G711_ALAW_64K, OPAL_G711_ALAW_56K },
+ { OPAL_G711_ULAW_64K, OPAL_G711_ULAW_56K },
+ };
+ return G711Name[mode][speed];
+}
+
+
+H323Codec * AST_G711Capability::CreateCodec(H323Codec::Direction direction) const
+{
+ return NULL;
+}
+
+
+/*
+ * Capability: G.723.1
+ */
+AST_G7231Capability::AST_G7231Capability(int rx_frames, BOOL annexA_)
+ : H323AudioCapability(rx_frames, 4)
+{
+ annexA = annexA_;
+}
+
+PObject::Comparison AST_G7231Capability::Compare(const PObject & obj) const
+{
+ Comparison result = H323AudioCapability::Compare(obj);
+ if (result != EqualTo) {
+ return result;
+ }
+ PINDEX otherAnnexA = ((const AST_G7231Capability &)obj).annexA;
+ if (annexA < otherAnnexA) {
+ return LessThan;
+ }
+ if (annexA > otherAnnexA) {
+ return GreaterThan;
+ }
+ return EqualTo;
+}
+
+PObject * AST_G7231Capability::Clone() const
+{
+ return new AST_G7231Capability(*this);
+}
+
+PString AST_G7231Capability::GetFormatName() const
+{
+ return (annexA ? OPAL_G7231 "A" : OPAL_G7231);
+}
+
+unsigned AST_G7231Capability::GetSubType() const
+{
+ return H245_AudioCapability::e_g7231;
+}
+
+BOOL AST_G7231Capability::OnSendingPDU(H245_AudioCapability & cap,
+ unsigned packetSize) const
+{
+ cap.SetTag(H245_AudioCapability::e_g7231);
+ H245_AudioCapability_g7231 & g7231 = cap;
+ g7231.m_maxAl_sduAudioFrames = packetSize;
+ g7231.m_silenceSuppression = annexA;
+ return TRUE;
+}
+
+BOOL AST_G7231Capability::OnReceivedPDU(const H245_AudioCapability & cap,
+ unsigned & packetSize)
+{
+ if (cap.GetTag() != H245_AudioCapability::e_g7231) {
+ return FALSE;
+ }
+ const H245_AudioCapability_g7231 & g7231 = cap;
+ packetSize = g7231.m_maxAl_sduAudioFrames;
+ annexA = g7231.m_silenceSuppression;
+ return TRUE;
+}
+
+H323Codec * AST_G7231Capability::CreateCodec(H323Codec::Direction direction) const
+{
+ return NULL;
+}
+
+/*
+ * Capability: G.729
+ */
+AST_G729Capability::AST_G729Capability(int rx_frames)
+ : H323AudioCapability(rx_frames, 2)
+{
+}
+
+PObject * AST_G729Capability::Clone() const
+{
+ return new AST_G729Capability(*this);
+}
+
+unsigned AST_G729Capability::GetSubType() const
+{
+ return H245_AudioCapability::e_g729;
+}
+
+PString AST_G729Capability::GetFormatName() const
+{
+ return OPAL_G729;
+}
+
+H323Codec * AST_G729Capability::CreateCodec(H323Codec::Direction direction) const
+{
+ return NULL;
+}
+
+/*
+ * Capability: G.729A
+ */
+AST_G729ACapability::AST_G729ACapability(int rx_frames)
+ : H323AudioCapability(rx_frames, 6)
+{
+}
+
+PObject * AST_G729ACapability::Clone() const
+{
+ return new AST_G729ACapability(*this);
+}
+
+unsigned AST_G729ACapability::GetSubType() const
+{
+ return H245_AudioCapability::e_g729AnnexA;
+}
+
+PString AST_G729ACapability::GetFormatName() const
+{
+ return OPAL_G729A;
+}
+
+H323Codec * AST_G729ACapability::CreateCodec(H323Codec::Direction direction) const
+{
+ return NULL;
+}
+
+/*
+ * Capability: GSM full rate
+ */
+AST_GSM0610Capability::AST_GSM0610Capability(int rx_frames, int comfortNoise_, int scrambled_)
+ : H323AudioCapability(rx_frames, 2)
+{
+ comfortNoise = comfortNoise_;
+ scrambled = scrambled_;
+}
+
+PObject * AST_GSM0610Capability::Clone() const
+{
+ return new AST_GSM0610Capability(*this);
+}
+
+unsigned AST_GSM0610Capability::GetSubType() const
+{
+ return H245_AudioCapability::e_gsmFullRate;
+}
+
+BOOL AST_GSM0610Capability::OnSendingPDU(H245_AudioCapability & cap,
+ unsigned packetSize) const
+{
+ cap.SetTag(H245_AudioCapability::e_gsmFullRate);
+ H245_GSMAudioCapability & gsm = cap;
+ gsm.m_audioUnitSize = packetSize * 33;
+ gsm.m_comfortNoise = comfortNoise;
+ gsm.m_scrambled = scrambled;
+ return TRUE;
+}
+
+BOOL AST_GSM0610Capability::OnReceivedPDU(const H245_AudioCapability & cap,
+ unsigned & packetSize)
+{
+ if (cap.GetTag() != H245_AudioCapability::e_gsmFullRate)
+ return FALSE;
+ const H245_GSMAudioCapability & gsm = cap;
+ packetSize = (gsm.m_audioUnitSize + 32) / 33;
+ comfortNoise = gsm.m_comfortNoise;
+ scrambled = gsm.m_scrambled;
+
+ return TRUE;
+}
+
+PString AST_GSM0610Capability::GetFormatName() const
+{
+ return OPAL_GSM0610;
+}
+
+H323Codec * AST_GSM0610Capability::CreateCodec(H323Codec::Direction direction) const
+{
+ return NULL;
+}
Propchange: trunk/channels/h323/caps_h323.cxx
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/channels/h323/caps_h323.cxx
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: trunk/channels/h323/caps_h323.cxx
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: trunk/channels/h323/caps_h323.h
URL: http://svn.digium.com/view/asterisk/trunk/channels/h323/caps_h323.h?rev=43354&view=auto
==============================================================================
--- trunk/channels/h323/caps_h323.h (added)
+++ trunk/channels/h323/caps_h323.h Wed Sep 20 14:21:15 2006
@@ -1,0 +1,124 @@
+#ifndef __AST_H323CAPS_H
+#define __AST_H323CAPS_H
+
+/**This class describes the G.711 codec capability.
+ */
+class AST_G711Capability : public H323AudioCapability
+{
+ PCLASSINFO(AST_G711Capability, H323AudioCapability);
+
+public:
+ AST_G711Capability(int rx_frames = 125, H323_G711Capability::Mode _mode = H323_G711Capability::muLaw, H323_G711Capability::Speed _speed = H323_G711Capability::At64k);
+ virtual PObject *Clone() const;
+ virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
+ virtual unsigned GetSubType() const;
+ virtual PString GetFormatName() const;
+
+protected:
+ H323_G711Capability::Mode mode;
+ H323_G711Capability::Speed speed;
+};
+
+/**This class describes the G.723.1 codec capability.
+ */
+class AST_G7231Capability : public H323AudioCapability
+{
+ PCLASSINFO(AST_G7231Capability, H323AudioCapability);
+
+public:
+ AST_G7231Capability(int rx_frames = 7, BOOL annexA = TRUE);
+ Comparison Compare(const PObject & obj) const;
+ virtual PObject * Clone() const;
+ virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
+ virtual unsigned GetSubType() const;
+ virtual PString GetFormatName() const;
+ virtual BOOL OnSendingPDU(H245_AudioCapability & pdu, unsigned packetSize) const;
+ virtual BOOL OnReceivedPDU(const H245_AudioCapability & pdu, unsigned & packetSize);
+
+protected:
+ BOOL annexA;
+};
+
+/**This class describes the (fake) G729 codec capability.
+ */
+class AST_G729Capability : public H323AudioCapability
+{
+ PCLASSINFO(AST_G729Capability, H323AudioCapability);
+
+public:
+ AST_G729Capability(int rx_frames = 24);
+ /* Create a copy of the object. */
+ virtual PObject * Clone() const;
+
+ /* Create the codec instance, allocating resources as required. */
+ virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
+
+ /* Get the sub-type of the capability. This is a code dependent on the
+ main type of the capability.
+
+ This returns one of the four possible combinations of mode and speed
+ using the enum values of the protocol ASN H245_AudioCapability class. */
+ virtual unsigned GetSubType() const;
+
+ /* Get the name of the media data format this class represents. */
+ virtual PString GetFormatName() const;
+};
+
+/* This class describes the VoiceAge G729A codec capability. */
+class AST_G729ACapability : public H323AudioCapability
+{
+ PCLASSINFO(AST_G729ACapability, H323AudioCapability);
+
+public:
+ /* Create a new G.729A capability. */
+ AST_G729ACapability(int rx_frames = 24);
+
+ /* Create a copy of the object. */
+ virtual PObject * Clone() const;
+ /* Create the codec instance, allocating resources as required. */
+ virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
+
+ /* Get the sub-type of the capability. This is a code dependent on the
+ main type of the capability.
+
+ This returns one of the four possible combinations of mode and speed
+ using the enum values of the protocol ASN H245_AudioCapability class. */
+ virtual unsigned GetSubType() const;
+
+ /* Get the name of the media data format this class represents. */
+ virtual PString GetFormatName() const;
+};
+
+/* This class describes the GSM-06.10 codec capability. */
+class AST_GSM0610Capability : public H323AudioCapability
+{
+ PCLASSINFO(AST_GSM0610Capability, H323AudioCapability);
+
+public:
+ /* Create a new GSM capability. */
+ AST_GSM0610Capability(int rx_frames = 24, int comfortNoise = 0, int scrambled = 0);
+
+ /* Create a copy of the object. */
+ virtual PObject * Clone() const;
+
+ /* Create the codec instance, allocating resources as required. */
+ virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
+
+ /* Get the sub-type of the capability. This is a code dependent on the
+ main type of the capability.
+
+ This returns one of the four possible combinations of mode and speed
+ using the enum values of the protocol ASN H245_AudioCapability class. */
+ virtual unsigned GetSubType() const;
+
+ /* Get the name of the media data format this class represents. */
+ virtual PString GetFormatName() const;
+
+ BOOL OnSendingPDU(H245_AudioCapability & pdu, unsigned packetSize) const;
+ BOOL OnReceivedPDU(const H245_AudioCapability & pdu, unsigned & packetSize);
+
+protected:
+ int comfortNoise;
+ int scrambled;
+};
+#endif /* __AST_H323CAPS_H */
Propchange: trunk/channels/h323/caps_h323.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/channels/h323/caps_h323.h
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Propchange: trunk/channels/h323/caps_h323.h
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the asterisk-commits
mailing list