Fix build error when chan_h323 is not being built.
[asterisk/asterisk.git] / channels / h323 / caps_h323.cxx
index 573d24b..3f7230f 100644 (file)
@@ -1,5 +1,7 @@
 #include <ptlib.h>
 #include <h323.h>
 #include <ptlib.h>
 #include <h323.h>
+#include <h245.h>
+#include "ast_h323.h"
 #include "caps_h323.h"
 
 #define DEFINE_G711_CAPABILITY(cls, code, capName) \
 #include "caps_h323.h"
 
 #define DEFINE_G711_CAPABILITY(cls, code, capName) \
@@ -16,6 +18,7 @@ H323_REGISTER_CAPABILITY(AST_G729Capability,  OPAL_G729);
 H323_REGISTER_CAPABILITY(AST_G729ACapability, OPAL_G729A);
 H323_REGISTER_CAPABILITY(AST_GSM0610Capability, OPAL_GSM0610);
 H323_REGISTER_CAPABILITY(AST_CiscoG726Capability, CISCO_G726r32);
 H323_REGISTER_CAPABILITY(AST_G729ACapability, OPAL_G729A);
 H323_REGISTER_CAPABILITY(AST_GSM0610Capability, OPAL_GSM0610);
 H323_REGISTER_CAPABILITY(AST_CiscoG726Capability, CISCO_G726r32);
+H323_REGISTER_CAPABILITY(AST_CiscoDtmfCapability, CISCO_DTMF_RELAY);
 
 OPAL_MEDIA_FORMAT_DECLARE(OpalG711ALaw64kFormat,
        OPAL_G711_ALAW_64K,
 
 OPAL_MEDIA_FORMAT_DECLARE(OpalG711ALaw64kFormat,
        OPAL_G711_ALAW_64K,
@@ -97,6 +100,18 @@ OPAL_MEDIA_FORMAT_DECLARE(OpalCiscoG726Format,
        8,              // 1 millisecond
        OpalMediaFormat::AudioTimeUnits,
        0);
        8,              // 1 millisecond
        OpalMediaFormat::AudioTimeUnits,
        0);
+#if 0
+OPAL_MEDIA_FORMAT_DECLARE(OpalCiscoDTMFRelayFormat,
+       CISCO_DTMF_RELAY,
+       OpalMediaFormat::DefaultAudioSessionID,
+       (RTP_DataFrame::PayloadTypes)121, // Choose this for Cisco IOS compatibility
+       TRUE,   // Needs jitter
+       100,    // bits/sec
+       4,              // bytes/frame
+       8*150,  // 150 millisecond
+       OpalMediaFormat::AudioTimeUnits,
+       0);
+#endif
 
 /*
  * Capability: G.711
 
 /*
  * Capability: G.711
@@ -144,7 +159,7 @@ H323Codec * AST_G711Capability::CreateCodec(H323Codec::Direction direction) cons
 /*
  * Capability: G.723.1
  */
 /*
  * Capability: G.723.1
  */
-AST_G7231Capability::AST_G7231Capability(int rx_frames, BOOL annexA_)
+AST_G7231Capability::AST_G7231Capability(int rx_frames, PBoolean annexA_)
        : H323AudioCapability(rx_frames, 4)
 {
        annexA = annexA_;
        : H323AudioCapability(rx_frames, 4)
 {
        annexA = annexA_;
@@ -181,7 +196,7 @@ unsigned AST_G7231Capability::GetSubType() const
        return H245_AudioCapability::e_g7231;
 }
 
        return H245_AudioCapability::e_g7231;
 }
 
-BOOL AST_G7231Capability::OnSendingPDU(H245_AudioCapability & cap,
+PBoolean AST_G7231Capability::OnSendingPDU(H245_AudioCapability & cap,
                                                                                unsigned packetSize) const
 {
        cap.SetTag(H245_AudioCapability::e_g7231);
                                                                                unsigned packetSize) const
 {
        cap.SetTag(H245_AudioCapability::e_g7231);
@@ -191,7 +206,7 @@ BOOL AST_G7231Capability::OnSendingPDU(H245_AudioCapability & cap,
        return TRUE;
 }
 
        return TRUE;
 }
 
-BOOL AST_G7231Capability::OnReceivedPDU(const H245_AudioCapability & cap,
+PBoolean AST_G7231Capability::OnReceivedPDU(const H245_AudioCapability & cap,
                                                                                unsigned & packetSize)
 {
        if (cap.GetTag() != H245_AudioCapability::e_g7231) {
                                                                                unsigned & packetSize)
 {
        if (cap.GetTag() != H245_AudioCapability::e_g7231) {
@@ -284,7 +299,7 @@ unsigned AST_GSM0610Capability::GetSubType() const
        return H245_AudioCapability::e_gsmFullRate;
 }
 
        return H245_AudioCapability::e_gsmFullRate;
 }
 
-BOOL AST_GSM0610Capability::OnSendingPDU(H245_AudioCapability & cap,
+PBoolean AST_GSM0610Capability::OnSendingPDU(H245_AudioCapability & cap,
                                                                                unsigned packetSize) const
 {
        cap.SetTag(H245_AudioCapability::e_gsmFullRate);
                                                                                unsigned packetSize) const
 {
        cap.SetTag(H245_AudioCapability::e_gsmFullRate);
@@ -295,7 +310,7 @@ BOOL AST_GSM0610Capability::OnSendingPDU(H245_AudioCapability & cap,
        return TRUE;
 }
 
        return TRUE;
 }
 
-BOOL AST_GSM0610Capability::OnReceivedPDU(const H245_AudioCapability & cap,
+PBoolean AST_GSM0610Capability::OnReceivedPDU(const H245_AudioCapability & cap,
                                                                                unsigned & packetSize)
 {
        if (cap.GetTag() != H245_AudioCapability::e_gsmFullRate)
                                                                                unsigned & packetSize)
 {
        if (cap.GetTag() != H245_AudioCapability::e_gsmFullRate)
@@ -324,7 +339,7 @@ H323Codec * AST_GSM0610Capability::CreateCodec(H323Codec::Direction direction) c
 AST_CiscoG726Capability::AST_CiscoG726Capability(int rx_frames)
        : H323NonStandardAudioCapability(rx_frames, 240,
                181, 0, 18,
 AST_CiscoG726Capability::AST_CiscoG726Capability(int rx_frames)
        : H323NonStandardAudioCapability(rx_frames, 240,
                181, 0, 18,
-               (const BYTE *)CISCO_G726r32, sizeof(CISCO_G726r32)-1, 0)
+               (const BYTE *)"G726r32", 0)
 {
 }
 
 {
 }
 
@@ -342,3 +357,27 @@ PString AST_CiscoG726Capability::GetFormatName() const
 {
        return PString(CISCO_G726r32);
 }
 {
        return PString(CISCO_G726r32);
 }
+
+/*
+ * Capability: Cisco RTP DTMF Relay
+ */
+AST_CiscoDtmfCapability::AST_CiscoDtmfCapability()
+       : H323NonStandardDataCapability(0, 181, 0, 18, (const BYTE *)"RtpDtmfRelay", 0)
+{
+       rtpPayloadType = (RTP_DataFrame::PayloadTypes)121;
+}
+
+PObject *AST_CiscoDtmfCapability::Clone() const
+{
+       return new AST_CiscoDtmfCapability(*this);
+}
+
+H323Codec *AST_CiscoDtmfCapability::CreateCodec(H323Codec::Direction direction) const
+{
+       return NULL;
+}
+
+PString AST_CiscoDtmfCapability::GetFormatName() const
+{
+       return PString(CISCO_DTMF_RELAY);
+}