First pass at populating delivery times through translation. Not sure how this will...
authorMark Spencer <markster@digium.com>
Fri, 19 Mar 2004 15:03:43 +0000 (15:03 +0000)
committerMark Spencer <markster@digium.com>
Fri, 19 Mar 2004 15:03:43 +0000 (15:03 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2474 65c4cc65-6c06-0410-ace0-fbb531ad65f3

translate.c

index 0f2bc9e..4ed3fec 100755 (executable)
@@ -130,9 +130,12 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f,
 {
        struct ast_trans_pvt *p;
        struct ast_frame *out;
 {
        struct ast_trans_pvt *p;
        struct ast_frame *out;
+       struct timeval delivery;
        p = path;
        /* Feed the first frame into the first translator */
        p->step->framein(p->state, f);
        p = path;
        /* Feed the first frame into the first translator */
        p->step->framein(p->state, f);
+       delivery.tv_sec = f->delivery.tv_sec;
+       delivery.tv_usec = f->delivery.tv_usec;
        if (consume)
                ast_frfree(f);
        while(p) {
        if (consume)
                ast_frfree(f);
        while(p) {
@@ -144,8 +147,11 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f,
                   return this frame  */
                if (p->next) 
                        p->next->step->framein(p->next->state, out);
                   return this frame  */
                if (p->next) 
                        p->next->step->framein(p->next->state, out);
-               else
+               else {
+                       out->delivery.tv_sec = f->delivery.tv_sec;
+                       out->delivery.tv_usec = f->delivery.tv_usec;
                        return out;
                        return out;
+               }
                p = p->next;
        }
        ast_log(LOG_WARNING, "I should never get here...\n");
                p = p->next;
        }
        ast_log(LOG_WARNING, "I should never get here...\n");