Make trunking and timestamps palce nicely
authorMark Spencer <markster@digium.com>
Thu, 22 Apr 2004 18:51:42 +0000 (18:51 +0000)
committerMark Spencer <markster@digium.com>
Thu, 22 Apr 2004 18:51:42 +0000 (18:51 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2748 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c
channels/iax2-parser.c

index bdf83c6..fee41ac 100755 (executable)
@@ -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
index 9d31a8b..d8d58d6 100755 (executable)
@@ -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);