--- app_amd.c 2018-10-31 12:52:41.229343351 +0000 +++ app_amd.c 2018-10-31 12:52:07.297094203 +0000 @@ -282,6 +282,8 @@ /* Figure out how long we waited */ if (res > 0) { ms = 2 * maxWaitTimeForFrame - res; + } else { + ms = 2 * maxWaitTimeForFrame; } /* If we fail to read in a frame, that means they hung up */ @@ -293,7 +295,7 @@ break; } - if (f->frametype == AST_FRAME_VOICE || f->frametype == AST_FRAME_CNG) { + if (f->frametype == AST_FRAME_VOICE || f->frametype == AST_FRAME_CNG || f->frametype == AST_FRAME_NULL) { /* Figure out how long the frame is in milliseconds */ if (f->frametype == AST_FRAME_VOICE) { framelength = (ast_codec_samples_count(f) / DEFAULT_SAMPLES_PER_MS);