Merge in latest round of chan_h323 changes. These are all isolated to chan_h323 so...
authorJoshua Colp <jcolp@digium.com>
Wed, 20 Sep 2006 16:24:00 +0000 (16:24 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 20 Sep 2006 16:24:00 +0000 (16:24 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43331 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_h323.c
channels/h323/Makefile [deleted file]
channels/h323/ast_h323.cpp
channels/h323/ast_h323.h
channels/h323/chan_h323.h

index 3b7c66d..c3368ad 100644 (file)
@@ -183,6 +183,7 @@ struct oh323_pvt {
        int pref_codec;                                         /* Preferred codec */
        int peercapability;                                     /* Capabilities learned from peer */
        int jointcapability;                            /* Common capabilities for local and remote side */
+       struct ast_codec_pref peer_prefs;       /* Preferenced list of codecs which remote side supports */
        int dtmf_pt;                                            /* Payload code used for RFC2833 messages */
        int curDTMF;                                            /* DTMF tone being generated to Asterisk side */
        int DTMFsched;                                          /* Scheduler descriptor for DTMF */
@@ -981,6 +982,9 @@ static int __oh323_rtp_create(struct oh323_pvt *pvt)
        if (pvt->dtmf_pt > 0)
                ast_rtp_set_rtpmap_type(pvt->rtp, pvt->dtmf_pt, "audio", "telephone-event", 0);
 
+       if (pvt->peercapability)
+               ast_rtp_codec_setpref(pvt->rtp, &pvt->peer_prefs);
+
        if (pvt->owner && !ast_channel_trylock(pvt->owner)) {
                ast_jb_configure(pvt->owner, &global_jbconf);
                pvt->owner->fds[0] = ast_rtp_fd(pvt->rtp);
@@ -2404,7 +2408,7 @@ static void set_dtmf_payload(unsigned call_reference, const char *token, int pay
                ast_log(LOG_DEBUG, "DTMF payload on %s set to %d\n", token, payload);
 }
 
-static void set_peer_capabilities(unsigned call_reference, const char *token, int capabilities)
+static void set_peer_capabilities(unsigned call_reference, const char *token, int capabilities, struct ast_codec_pref *prefs)
 {
        struct oh323_pvt *pvt;
 
@@ -2416,6 +2420,17 @@ static void set_peer_capabilities(unsigned call_reference, const char *token, in
                return;
        pvt->peercapability = capabilities;
        pvt->jointcapability = pvt->options.capability & capabilities;
+       if (prefs) {
+               memcpy(&pvt->peer_prefs, prefs, sizeof(pvt->peer_prefs));
+               if (h323debug) {
+                       int i;
+                       for (i = 0; i < 32; ++i) {
+                               ast_log(LOG_DEBUG, "prefs[%d]=%s:%d\n", i, (prefs->order[i] ? ast_getformatname(1 << (prefs->order[i]-1)) : "<none>"), prefs->framing[i]);
+                       }
+               }
+               if (pvt->rtp)
+                       ast_rtp_codec_setpref(pvt->rtp, &pvt->peer_prefs);
+       }
        ast_mutex_unlock(&pvt->lock);
 }
 
@@ -3078,7 +3093,13 @@ static enum ast_module_load_result load_module(void)
        ASTOBJ_CONTAINER_INIT(&aliasl);
        res = reload_config(0);
        if (res) {
-               return AST_MODULE_LOAD_DECLINE;
+               ast_cli_unregister(&cli_h323_reload);
+               io_context_destroy(io);
+               sched_context_destroy(sched);
+               ASTOBJ_CONTAINER_DESTROY(&userl);
+               ASTOBJ_CONTAINER_DESTROY(&peerl);
+               ASTOBJ_CONTAINER_DESTROY(&aliasl);
+               return /*AST_MODULE_LOAD_DECLINE*/AST_MODULE_LOAD_FAILURE;
        } else {
                /* Make sure we can register our channel type */
                if (ast_channel_register(&oh323_tech)) {
@@ -3140,7 +3161,7 @@ static enum ast_module_load_result load_module(void)
                        if (h323_set_gk(gatekeeper_discover, gatekeeper, secret)) {
                                ast_log(LOG_ERROR, "Gatekeeper registration failed.\n");
                                gatekeeper_disable = 1;
-                               return AST_MODULE_LOAD_SUCCESS;
+                               res = AST_MODULE_LOAD_SUCCESS;
                        }
                }
                /* And start the monitor for the first time */
diff --git a/channels/h323/Makefile b/channels/h323/Makefile
deleted file mode 100644 (file)
index eea355e..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# Makefile
-#
-# Make file for OpenH323 support layer
-#
-
-.PHONY: Makefile.ast clean
-
-default::      
-
-# Verify those options with main Makefile
-STDCCFLAGS     = -DNDEBUG
-STDCCFLAGS     += -I../../include -include ../../include/asterisk/autoconfig.h
-STDCCFLAGS     += -fPIC
-#OPTCCFLAGS    +=
-CFLAGS         = -pipe
-TARGET         = libchanh323.a
-TARGET         += Makefile.ast
-SOURCES                = ast_h323.cxx compat_h323.cxx cisco-h225.cxx
-OBJDIR         = .
-OBJS           =
-
-ifndef OPENH323DIR
-OPENH323DIR=
-endif
-
-include $(OPENH323DIR)/openh323u.mak
-
-notrace::
-       $(MAKE) NOTRACE=1 opt
-
-define module_cxx_template
-$(1):: $(2)
-       ln -f $(2) $(1)
-endef
-
-$(foreach mod,$(SOURCES),$(eval $(call module_cxx_template,$(mod),$(mod:.cxx=.cpp))))
-#$(SOURCES)::  $(SOURCES:.cxx=.cpp)
-#      ln -f $(patsubst %.cxx, %.cpp, $@) $@
-
-$(SOURCES)::   Makefile ../../Makefile
-       touch $@
-
-libchanh323.a: $(OBJS)
-       ar crv $@ $(OBJS)
-
-cisco-h225.cpp::       cisco-h225.asn
-       asnparser -m CISCO_H225 -c $<
-       mv -f cisco-h225.cxx cisco-h225.cpp
-
-Makefile.ast:
-       @echo H323CFLAGS  = $(STDCCFLAGS) $(OPTCCFLAGS) $(CFLAGS) >$@.tmp
-       @echo H323LDFLAGS = $(CFLAGS) $(LDFLAGS) >>$@.tmp
-       @echo H323LDLIBS  = $(LDLIBS) $(ENDLDLIBS) $(ENDLDFLAGS) >>$@.tmp
-       @if [ -r $@ ] && cmp -s $@ $@.tmp; then rm -f $@.tmp; else mv -f $@.tmp $@; fi
-
-clean::
-       rm -f $(SOURCES) $(TARGET) $(OBJS) Makefile.ast *.dep
index 7d0c01f..07352a6 100644 (file)
@@ -210,27 +210,79 @@ void PAssertFunc(const char *msg)
        /* XXX: Probably we need to crash here */
 }
 
-H323_REGISTER_CAPABILITY(H323_G7231Capability, OPAL_G7231);
+#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
  */
-H323_G7231Capability::H323_G7231Capability(BOOL annexA_)
-       : H323AudioCapability(7, 4)
+AST_G7231Capability::AST_G7231Capability(int rx_frames, BOOL annexA_)
+       : H323AudioCapability(rx_frames, 4)
 {
        annexA = annexA_;
 }
 
-PObject::Comparison H323_G7231Capability::Compare(const PObject & obj) const
+PObject::Comparison AST_G7231Capability::Compare(const PObject & obj) const
 {
        Comparison result = H323AudioCapability::Compare(obj);
        if (result != EqualTo) {
                return result;
        }
-       PINDEX otherAnnexA = ((const H323_G7231Capability &)obj).annexA;
+       PINDEX otherAnnexA = ((const AST_G7231Capability &)obj).annexA;
        if (annexA < otherAnnexA) {
                return LessThan;
        }
@@ -240,22 +292,22 @@ PObject::Comparison H323_G7231Capability::Compare(const PObject & obj) const
        return EqualTo;
 }
 
-PObject * H323_G7231Capability::Clone() const
+PObject * AST_G7231Capability::Clone() const
 {
-       return new H323_G7231Capability(*this);
+       return new AST_G7231Capability(*this);
 }
 
-PString H323_G7231Capability::GetFormatName() const
+PString AST_G7231Capability::GetFormatName() const
 {
        return (annexA ? OPAL_G7231 "A" : OPAL_G7231);
 }
 
-unsigned H323_G7231Capability::GetSubType() const
+unsigned AST_G7231Capability::GetSubType() const
 {
        return H245_AudioCapability::e_g7231;
 }
 
-BOOL H323_G7231Capability::OnSendingPDU(H245_AudioCapability & cap,
+BOOL AST_G7231Capability::OnSendingPDU(H245_AudioCapability & cap,
                                                                                unsigned packetSize) const
 {
        cap.SetTag(H245_AudioCapability::e_g7231);
@@ -265,7 +317,7 @@ BOOL H323_G7231Capability::OnSendingPDU(H245_AudioCapability & cap,
        return TRUE;
 }
 
-BOOL H323_G7231Capability::OnReceivedPDU(const H245_AudioCapability & cap,
+BOOL AST_G7231Capability::OnReceivedPDU(const H245_AudioCapability & cap,
                                                                                unsigned & packetSize)
 {
        if (cap.GetTag() != H245_AudioCapability::e_g7231) {
@@ -277,7 +329,7 @@ BOOL H323_G7231Capability::OnReceivedPDU(const H245_AudioCapability & cap,
        return TRUE;
 }
 
-H323Codec * H323_G7231Capability::CreateCodec(H323Codec::Direction direction) const
+H323Codec * AST_G7231Capability::CreateCodec(H323Codec::Direction direction) const
 {
        return NULL;
 }
@@ -285,8 +337,8 @@ H323Codec * H323_G7231Capability::CreateCodec(H323Codec::Direction direction) co
 /*
  * Capability: G.729
  */
-AST_G729Capability::AST_G729Capability()
-       : H323AudioCapability(24, 2)
+AST_G729Capability::AST_G729Capability(int rx_frames)
+       : H323AudioCapability(rx_frames, 2)
 {
 }
 
@@ -313,8 +365,8 @@ H323Codec * AST_G729Capability::CreateCodec(H323Codec::Direction direction) cons
 /*
  * Capability: G.729A
  */
-AST_G729ACapability::AST_G729ACapability()
-       : H323AudioCapability(24, 6)
+AST_G729ACapability::AST_G729ACapability(int rx_frames)
+       : H323AudioCapability(rx_frames, 6)
 {
 }
 
@@ -341,8 +393,8 @@ H323Codec * AST_G729ACapability::CreateCodec(H323Codec::Direction direction) con
 /*
  * Capability: GSM full rate
  */
-AST_GSM0610Capability::AST_GSM0610Capability(int comfortNoise_, int scrambled_)
-       : H323AudioCapability(24, 2)
+AST_GSM0610Capability::AST_GSM0610Capability(int rx_frames, int comfortNoise_, int scrambled_)
+       : H323AudioCapability(rx_frames, 2)
 {
        comfortNoise = comfortNoise_;
        scrambled = scrambled_;
@@ -363,7 +415,7 @@ BOOL AST_GSM0610Capability::OnSendingPDU(H245_AudioCapability & cap,
 {
        cap.SetTag(H245_AudioCapability::e_gsmFullRate);
        H245_GSMAudioCapability & gsm = cap;
-       gsm.m_audioUnitSize = packetSize;
+       gsm.m_audioUnitSize = packetSize * 33;
        gsm.m_comfortNoise = comfortNoise;
        gsm.m_scrambled = scrambled;
        return TRUE;
@@ -375,7 +427,7 @@ BOOL AST_GSM0610Capability::OnReceivedPDU(const H245_AudioCapability & cap,
        if (cap.GetTag() != H245_AudioCapability::e_gsmFullRate)
                return FALSE;
        const H245_GSMAudioCapability & gsm = cap;
-       packetSize = gsm.m_audioUnitSize;
+       packetSize = (gsm.m_audioUnitSize + 32) / 33;
        comfortNoise = gsm.m_comfortNoise;
        scrambled = gsm.m_scrambled;
 
@@ -1468,6 +1520,7 @@ BOOL MyH323Connection::OnReceivedCapabilitySet(const H323Capabilities & remoteCa
                { 0 }
        };
 #endif
+       struct ast_codec_pref prefs;
 
        if (!H323Connection::OnReceivedCapabilitySet(remoteCaps, muxCap, reject)) {
                return FALSE;
@@ -1483,6 +1536,7 @@ BOOL MyH323Connection::OnReceivedCapabilitySet(const H323Capabilities & remoteCa
                        cout << "\t-- Inbound RFC2833 on payload " << pt << endl;
                }
        }
+       memset(&prefs, 0, sizeof(prefs));
        int peer_capabilities = 0;
        for (int i = 0; i < remoteCapabilities.GetSize(); ++i) {
                unsigned int subType = remoteCapabilities[i].GetSubType();
@@ -1493,10 +1547,24 @@ BOOL MyH323Connection::OnReceivedCapabilitySet(const H323Capabilities & remoteCa
                case H323Capability::e_Audio:
                        for (int x = 0; codecs[x].asterisk_codec > 0; ++x) {
                                if (subType == codecs[x].h245_cap) {
+                                       int ast_codec = codecs[x].asterisk_codec;
+                                       int ms = 0;
+                                       if (!(peer_capabilities & ast_codec)) {
+                                               struct ast_format_list format;
+                                               ast_codec_pref_append(&prefs, ast_codec);
+                                               format = ast_codec_pref_getsize(&prefs, ast_codec);
+                                               if ((ast_codec == AST_FORMAT_ALAW) || (ast_codec == AST_FORMAT_ULAW)) {
+                                                       ms = remoteCapabilities[i].GetTxFramesInPacket();
+                                                       if (ms > 60)
+                                                               ms = format.cur_ms;
+                                               } else
+                                                       ms = remoteCapabilities[i].GetTxFramesInPacket() * format.inc_ms;
+                                               ast_codec_pref_setsize(&prefs, ast_codec, ms);
+                                       }
                                        if (h323debug) {
-                                               cout << "Found peer capability " << remoteCapabilities[i] << ", Asterisk code is " << codecs[x].asterisk_codec << endl;
+                                               cout << "Found peer capability " << remoteCapabilities[i] << ", Asterisk code is " << ast_codec << ", frame size (in ms) is " << ms << endl;
                                        }
-                                       peer_capabilities |= codecs[x].asterisk_codec;
+                                       peer_capabilities |= ast_codec;
                                }
                        }
                        break;
@@ -1530,14 +1598,16 @@ BOOL MyH323Connection::OnReceivedCapabilitySet(const H323Capabilities & remoteCa
                }
        }
        if (h323debug) {
-               char caps_str[1024];
-               cout << "Peer capabilities = " << ast_getformatname_multiple(caps_str, sizeof(caps_str), peer_capabilities) << endl;
+               char caps_str[1024], caps2_str[1024];
+               ast_codec_pref_string(&prefs, caps2_str, sizeof(caps2_str));
+               cout << "Peer capabilities = " << ast_getformatname_multiple(caps_str, sizeof(caps_str), peer_capabilities)
+                               << ", ordered list is " << caps2_str << endl;
        }
 #if 0
        redir_capabilities &= peer_capabilities;
 #endif
        if (on_setpeercapabilities)
-               on_setpeercapabilities(GetCallReference(), (const char *)callToken, peer_capabilities);
+               on_setpeercapabilities(GetCallReference(), (const char *)callToken, peer_capabilities, &prefs);
 
        return TRUE;
 }
@@ -1570,14 +1640,15 @@ BOOL MyH323Connection::OnStartLogicalChannel(H323Channel & channel)
 
 void MyH323Connection::SetCapabilities(int cap, int dtmf_mode, void *_prefs, int pref_codec)
 {
-       int g711Frames = 20;
-       int gsmFrames = 4;
        PINDEX lastcap = -1; /* last common capability index */
        int alreadysent = 0;
        int codec;
        int x, y;
        char caps_str[1024];
        struct ast_codec_pref *prefs = (struct ast_codec_pref *)_prefs;
+       struct ast_format_list format;
+       int frames_per_packet;
+       int max_frames_per_packet;
 
        localCapabilities.RemoveAll();
 
@@ -1603,6 +1674,9 @@ void MyH323Connection::SetCapabilities(int cap, int dtmf_mode, void *_prefs, int
                if (!(cap & codec) || (alreadysent & codec) || !(codec & AST_FORMAT_AUDIO_MASK))
                        continue;
                alreadysent |= codec;
+               format = ast_codec_pref_getsize(prefs, codec);
+               frames_per_packet = (format.inc_ms ? format.cur_ms / format.inc_ms : format.cur_ms);
+               max_frames_per_packet = (format.inc_ms ? format.max_ms / format.inc_ms : 0);
                switch(codec) {
 #if 0
                case AST_FORMAT_SPEEX:
@@ -1620,28 +1694,39 @@ void MyH323Connection::SetCapabilities(int cap, int dtmf_mode, void *_prefs, int
                case AST_FORMAT_G729A:
                        AST_G729ACapability *g729aCap;
                        AST_G729Capability *g729Cap;
-                       lastcap = localCapabilities.SetCapability(0, 0, g729aCap = new AST_G729ACapability);
-                       lastcap = localCapabilities.SetCapability(0, 0, g729Cap = new AST_G729Capability);
+                       lastcap = localCapabilities.SetCapability(0, 0, g729aCap = new AST_G729ACapability(frames_per_packet));
+                       lastcap = localCapabilities.SetCapability(0, 0, g729Cap = new AST_G729Capability(frames_per_packet));
+                       if (max_frames_per_packet) {
+                               g729aCap->SetTxFramesInPacket(max_frames_per_packet);
+                               g729Cap->SetTxFramesInPacket(max_frames_per_packet);
+                       }
                        break;
                case AST_FORMAT_G723_1:
-                       H323_G7231Capability *g7231Cap;
-                       lastcap = localCapabilities.SetCapability(0, 0, g7231Cap = new H323_G7231Capability(TRUE));
-                       lastcap = localCapabilities.SetCapability(0, 0, g7231Cap = new H323_G7231Capability(FALSE));
+                       AST_G7231Capability *g7231Cap;
+                       lastcap = localCapabilities.SetCapability(0, 0, g7231Cap = new AST_G7231Capability(frames_per_packet, TRUE));
+                       if (max_frames_per_packet)
+                               g7231Cap->SetTxFramesInPacket(max_frames_per_packet);
+                       lastcap = localCapabilities.SetCapability(0, 0, g7231Cap = new AST_G7231Capability(frames_per_packet, FALSE));
+                       if (max_frames_per_packet)
+                               g7231Cap->SetTxFramesInPacket(max_frames_per_packet);
                        break;
                case AST_FORMAT_GSM:
                        AST_GSM0610Capability *gsmCap;
-                       lastcap = localCapabilities.SetCapability(0, 0, gsmCap = new AST_GSM0610Capability);
-                       gsmCap->SetTxFramesInPacket(gsmFrames);
+                       lastcap = localCapabilities.SetCapability(0, 0, gsmCap = new AST_GSM0610Capability(frames_per_packet));
+                       if (max_frames_per_packet)
+                               gsmCap->SetTxFramesInPacket(max_frames_per_packet);
                        break;
                case AST_FORMAT_ULAW:
-                       H323_G711Capability *g711uCap;
-                       lastcap = localCapabilities.SetCapability(0, 0, g711uCap = new H323_G711Capability(H323_G711Capability::muLaw));
-                       g711uCap->SetTxFramesInPacket(g711Frames);
+                       AST_G711Capability *g711uCap;
+                       lastcap = localCapabilities.SetCapability(0, 0, g711uCap = new AST_G711Capability(format.cur_ms, H323_G711Capability::muLaw));
+                       if (format.max_ms)
+                               g711uCap->SetTxFramesInPacket(format.max_ms);
                        break;
                case AST_FORMAT_ALAW:
-                       H323_G711Capability *g711aCap;
-                       lastcap = localCapabilities.SetCapability(0, 0, g711aCap = new H323_G711Capability(H323_G711Capability::ALaw));
-                       g711aCap->SetTxFramesInPacket(g711Frames);
+                       AST_G711Capability *g711aCap;
+                       lastcap = localCapabilities.SetCapability(0, 0, g711aCap = new AST_G711Capability(format.cur_ms, H323_G711Capability::ALaw));
+                       if (format.max_ms)
+                               g711aCap->SetTxFramesInPacket(format.max_ms);
                        break;
                default:
                        alreadysent &= ~codec;
index b866e2c..946811b 100644 (file)
 #define AST_FORMAT_ILBC                (1 << 10)
 #endif
 
+/**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 H323_G7231Capability : public H323AudioCapability
+class AST_G7231Capability : public H323AudioCapability
 {
-       PCLASSINFO(H323_G7231Capability, H323AudioCapability);
+       PCLASSINFO(AST_G7231Capability, H323AudioCapability);
 
 public:
-       H323_G7231Capability(BOOL annexA = TRUE);
+       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;
@@ -85,7 +103,7 @@ class AST_G729Capability : public H323AudioCapability
        PCLASSINFO(AST_G729Capability, H323AudioCapability);
 
 public:
-       AST_G729Capability();
+       AST_G729Capability(int rx_frames = 24);
        /* Create a copy of the object. */
        virtual PObject * Clone() const;
 
@@ -110,7 +128,7 @@ class AST_G729ACapability : public H323AudioCapability
 
 public:
        /* Create a new G.729A capability. */
-       AST_G729ACapability();
+       AST_G729ACapability(int rx_frames = 24);
 
        /* Create a copy of the object. */
        virtual PObject * Clone() const;
@@ -135,7 +153,7 @@ class AST_GSM0610Capability : public H323AudioCapability
 
 public:
        /* Create a new GSM capability. */
-       AST_GSM0610Capability(int comfortNoise = 0, int scrambled = 0);
+       AST_GSM0610Capability(int rx_frames = 24, int comfortNoise = 0, int scrambled = 0);
 
        /* Create a copy of the object. */
        virtual PObject * Clone() const;
index d6be63f..41eb84f 100644 (file)
@@ -181,7 +181,7 @@ extern hangup_cb on_hangup;
 typedef void (*setcapabilities_cb)(unsigned, const char *);
 extern setcapabilities_cb on_setcapabilities;
 
-typedef void (*setpeercapabilities_cb)(unsigned, const char *, int);
+typedef void (*setpeercapabilities_cb)(unsigned, const char *, int, struct ast_codec_pref *);
 extern setpeercapabilities_cb on_setpeercapabilities;
 
 /* debug flag */