[Home]

Summary:ASTERISK-26875: app_mixmonitor: Recording out of sync when 183 but no RTP
Reporter:Aaron An (aaron)Labels:
Date Opened:2017-03-14 22:19:47Date Closed:2017-03-24 07:00:43
Priority:MajorRegression?
Status:Closed/CompleteComponents:Applications/app_mixmonitor
Versions:13.8.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:CentOS6.5X64 Attachments:
Description:My asterisk use MixMonitor to record, and it is randomly out of sync,I try to look for the root cause and find the solution.
Both side are PJSIP channel.
The scenario is very simple:
Asterisk call Alias,Alias answer and then go to the DIALPLAN to start MixMonitor and Dial Bob,Bob response 183 with SDP but no RTP stream feed in time. the record is out of sync.

just look at the audiohook.c line 180. if other_factory_samples is 0 we never flush the factory although  "our_factory_ms - other_factory_ms"  may very large.

====================audiohook.c=============================
{noformat}
our_factory_samples = ast_slinfactory_available(factory);    

our_factory_ms = ast_tvdiff_ms(*rwtime, previous_time) + (our_factory_samples / (audiohook->hook_internal_samp_rate / 1000));    

other_factory_samples = ast_slinfactory_available(other_factory);    

other_factory_ms = other_factory_samples / (audiohook->hook_internal_samp_rate / 1000);    
   
if (ast_test_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC) && other_factory_samples && (our_factory_ms - other_factory_ms > AST_AUDIOHOOK_SYNC_TOLERANCE)) {        

ast_debug(1, "Flushing audiohook %p so it remains in sync\n", audiohook);    

ast_slinfactory_flush(factory);    

ast_slinfactory_flush(other_factory);    

}    
{noformat}
====================audiohook.c=============================

I think it should remove the condition "&& other_factory_samples". I have tested the scenario that out of sync recording, this fix it.
Comments:By: Asterisk Team (asteriskteam) 2017-03-14 22:19:48.616-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Aaron An (aaron) 2017-03-14 23:55:36.079-0500

submit a patch:
https://gerrit.asterisk.org/#/c/5209/

By: Friendly Automation (friendly-automation) 2017-03-24 07:00:44.372-0500

Change 5243 merged by zuul:
audiohook.c: Lost RTP packets lead to out-of-sync MixMonitor.

[https://gerrit.asterisk.org/5243|https://gerrit.asterisk.org/5243]

By: Friendly Automation (friendly-automation) 2017-03-24 07:19:01.312-0500

Change 5242 merged by zuul:
audiohook.c: Lost RTP packets lead to out-of-sync MixMonitor.

[https://gerrit.asterisk.org/5242|https://gerrit.asterisk.org/5242]

By: Friendly Automation (friendly-automation) 2017-03-24 07:26:18.470-0500

Change 5209 merged by Joshua Colp:
audiohook.c: Lost RTP packets lead to out-of-sync MixMonitor.

[https://gerrit.asterisk.org/5209|https://gerrit.asterisk.org/5209]