]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
even though Asterisk explicitly requests that endpoints using G.729 do *not* use...
authorKevin P. Fleming <kpfleming@digium.com>
Fri, 7 Dec 2007 22:30:59 +0000 (22:30 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Fri, 7 Dec 2007 22:30:59 +0000 (22:30 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91870 65c4cc65-6c06-0410-ace0-fbb531ad65f3

codecs/codec_zap.c

index 79ac8b3132704f94d31ae817eba67bce0ed45a58..aa08667e294dcd4afa099b3ad0247a7eeaa9eeb8 100644 (file)
@@ -146,6 +146,15 @@ static int zap_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
                /* Copy at front of buffer */
                hdr->srcoffset = 0;
 
+       /* if we get handed a G.729 frame that is not a multiple of
+          10 bytes (10 milliseconds), then it has a CNG frame and
+          we need to avoid sending that to the transcoder
+       */
+       if ((f->subclass == AST_FORMAT_G729A) && ((f->datalen % 10) != 0)) {
+               f->datalen -= f->datalen % 10;
+               f->samples = f->datalen * 8;
+       }
+
        if (hdr->srclen + f->datalen > sizeof(hdr->srcdata)) {
                ast_log(LOG_WARNING, "Out of space for codec translation!\n");
                return -1;