Make trunking and timestamps palce nicely
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2748 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
3534419f14
commit
ba078042ba
|
@ -4565,6 +4565,14 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
|
|||
f.src = "IAX2";
|
||||
f.mallocd = 0;
|
||||
f.offset = 0;
|
||||
f.delivery.tv_sec = peer->rxtrunktime.tv_sec;
|
||||
f.delivery.tv_usec = peer->rxtrunktime.tv_usec;
|
||||
f.delivery.tv_sec += ts / 1000;
|
||||
f.delivery.tv_usec += ts % 1000;
|
||||
if (f.delivery.tv_usec >= 1000000) {
|
||||
f.delivery.tv_usec -= 1000000;
|
||||
f.delivery.tv_sec += 1;
|
||||
}
|
||||
if (f.datalen && (f.frametype == AST_FRAME_VOICE))
|
||||
f.samples = get_samples(&f);
|
||||
else
|
||||
|
|
|
@ -570,6 +570,7 @@ void iax_frame_wrap(struct iax_frame *fr, struct ast_frame *f)
|
|||
fr->af.samples = f->samples;
|
||||
fr->af.offset = AST_FRIENDLY_OFFSET;
|
||||
fr->af.src = f->src;
|
||||
fr->af.delivery = f->delivery;
|
||||
fr->af.data = fr->afdata;
|
||||
if (fr->af.datalen)
|
||||
memcpy(fr->af.data, f->data, fr->af.datalen);
|
||||
|
|
Loading…
Reference in New Issue