]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
emit a warning message when we drop a G.729B CNG frame destined for the transcoder
authorKevin P. Fleming <kpfleming@digium.com>
Wed, 12 Dec 2007 22:00:39 +0000 (22:00 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Wed, 12 Dec 2007 22:00:39 +0000 (22:00 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92656 65c4cc65-6c06-0410-ace0-fbb531ad65f3

codecs/codec_zap.c

index aa08667e294dcd4afa099b3ad0247a7eeaa9eeb8..34de33fceba6795902552947b060d4283800d894 100644 (file)
@@ -108,6 +108,7 @@ static AST_LIST_HEAD_STATIC(translators, translator);
 struct pvt {
        int fd;
        int fake;
+       unsigned int g729b_warning:1;
 #ifdef DEBUG_TRANSCODE
        int totalms;
        int lasttotalms;
@@ -151,6 +152,10 @@ static int zap_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
           we need to avoid sending that to the transcoder
        */
        if ((f->subclass == AST_FORMAT_G729A) && ((f->datalen % 10) != 0)) {
+               if (!ztp->g729b_warning) {
+                       ast_log(LOG_WARNING, "G.729B CNG frame received but is not supported; dropping.\n");
+                       ztp->g729b_warning = 1;
+               }
                f->datalen -= f->datalen % 10;
                f->samples = f->datalen * 8;
        }