mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-24 13:50:08 +00:00
Fix CNG issues in G.723.1
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@921 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -15,9 +15,10 @@
|
|||||||
* the GNU General Public License
|
* the GNU General Public License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define TYPE_SILENCE 0x2
|
|
||||||
#define TYPE_HIGH 0x0
|
#define TYPE_HIGH 0x0
|
||||||
#define TYPE_LOW 0x1
|
#define TYPE_LOW 0x1
|
||||||
|
#define TYPE_SILENCE 0x2
|
||||||
|
#define TYPE_DONTSEND 0x3
|
||||||
#define TYPE_MASK 0x3
|
#define TYPE_MASK 0x3
|
||||||
|
|
||||||
#include <asterisk/translate.h>
|
#include <asterisk/translate.h>
|
||||||
@@ -189,7 +190,9 @@ static struct ast_frame *g723tolin_frameout(struct ast_translator_pvt *pvt)
|
|||||||
static int g723_len(unsigned char buf)
|
static int g723_len(unsigned char buf)
|
||||||
{
|
{
|
||||||
switch(buf & TYPE_MASK) {
|
switch(buf & TYPE_MASK) {
|
||||||
case TYPE_MASK:
|
case TYPE_DONTSEND:
|
||||||
|
return 0;
|
||||||
|
break;
|
||||||
case TYPE_SILENCE:
|
case TYPE_SILENCE:
|
||||||
return 4;
|
return 4;
|
||||||
break;
|
break;
|
||||||
@@ -293,6 +296,7 @@ static struct ast_frame *lintog723_frameout(struct ast_translator_pvt *pvt)
|
|||||||
#endif
|
#endif
|
||||||
/* Assume 8000 Hz */
|
/* Assume 8000 Hz */
|
||||||
tmp->f.samples += 30;
|
tmp->f.samples += 30;
|
||||||
|
/* FIXME:SLD: Shouldn't the [0] be [cnt]?? */
|
||||||
cnt += g723_len(tmp->outbuf[0]);
|
cnt += g723_len(tmp->outbuf[0]);
|
||||||
tmp->tail -= Frame;
|
tmp->tail -= Frame;
|
||||||
/* Move the data at the end of the buffer to the front */
|
/* Move the data at the end of the buffer to the front */
|
||||||
|
|||||||
7
rtp.c
7
rtp.c
@@ -33,9 +33,10 @@
|
|||||||
#include <asterisk/acl.h>
|
#include <asterisk/acl.h>
|
||||||
#include <asterisk/channel_pvt.h>
|
#include <asterisk/channel_pvt.h>
|
||||||
|
|
||||||
#define TYPE_SILENCE 0x2
|
|
||||||
#define TYPE_HIGH 0x0
|
#define TYPE_HIGH 0x0
|
||||||
#define TYPE_LOW 0x1
|
#define TYPE_LOW 0x1
|
||||||
|
#define TYPE_SILENCE 0x2
|
||||||
|
#define TYPE_DONTSEND 0x3
|
||||||
#define TYPE_MASK 0x3
|
#define TYPE_MASK 0x3
|
||||||
|
|
||||||
static int dtmftimeout = 300; /* 300 samples */
|
static int dtmftimeout = 300; /* 300 samples */
|
||||||
@@ -88,7 +89,9 @@ int ast_rtp_fd(struct ast_rtp *rtp)
|
|||||||
static int g723_len(unsigned char buf)
|
static int g723_len(unsigned char buf)
|
||||||
{
|
{
|
||||||
switch(buf & TYPE_MASK) {
|
switch(buf & TYPE_MASK) {
|
||||||
case TYPE_MASK:
|
case TYPE_DONTSEND:
|
||||||
|
return 0;
|
||||||
|
break;
|
||||||
case TYPE_SILENCE:
|
case TYPE_SILENCE:
|
||||||
return 4;
|
return 4;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user