damja...@gmail.com
unread,May 15, 2008, 6:07:31 AM5/15/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Asterisk G.729
Hello
When asterisk transcodes from G.729 to signed linear using your codec,
and jitterbuffering is enabled in sip.conf, I get this printed out for
each frame and the sound quality is terrible:
[May 15 18:02:32] WARNING[9045]: abstract_jb.c:321 ast_jb_put: VGSM/
1/1 recieved frame with invalid timing info: has_timing_info=0, len=0,
ts=0, src=g729tolin_frameout
Patching main/channel.c to copy len, ts and seqno from the G.729 frame
to the transcoded slin one fixes the problem for me (patch below), but
it's a hack, please do that in the codec instead?
Anyway, thank you and all the best
Damjan
--- main/channel.c 2008-01-28 19:15:41.000000000 +0200
+++ main/channel.c 2008-05-17 21:41:17.000000000 +0200
@@ -2229,6 +2229,7 @@
ast_frfree(f);
f = &ast_null_frame;
} else if ((f->frametype == AST_FRAME_VOICE)) {
+ int was_g729 = 0;
if (chan->audiohooks) {
struct ast_frame *old_frame = f;
f = ast_audiohook_write_list(chan, chan->audiohooks,
AST_AUDIOHOOK_DIRECTION_READ, f);
@@ -2261,8 +2262,24 @@
}
}
- if (chan->readtrans && (f = ast_translate(chan->readtrans, f, 1))
== NULL)
- f = &ast_null_frame;
+ if (!strcmp(ast_getformatname(f->subclass), "g729"))
+ was_g729 = 1;
+
+ {
+ long __ts = f->ts;
+ long __len = f->len; // time: could be worked out
+ int __seqno = f->seqno;
+
+ if (chan->readtrans && (f = ast_translate(chan->readtrans, f,
1)) == NULL)
+ f = &ast_null_frame;
+
+ if (was_g729 && !strcmp(ast_getformatname(f->subclass), "slin"))
{
+ f->ts = __ts;
+ f->len = __len;
+ f->seqno = __seqno;
+ ast_set_flag(f, AST_FRFLAG_HAS_TIMING_INFO);
+ }
+ }
/* Run generator sitting on the line if timing device not
available
* and synchronous generation of outgoing frames is
necessary */