[asterisk-bugs] [JIRA] (ASTERISK-26875) app_mixmonitor: Recording out of sync when 183 but no RTP

Aaron An (JIRA) noreply at issues.asterisk.org
Wed Mar 15 21:56:10 CDT 2017


     [ https://issues.asterisk.org/jira/browse/ASTERISK-26875?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aaron An updated ASTERISK-26875:
--------------------------------

    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=============================
	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);    

	}    


====================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.

  was:
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=============================
	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);    
	}    

====================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.


> app_mixmonitor: Recording out of sync when 183 but no RTP
> ---------------------------------------------------------
>
>                 Key: ASTERISK-26875
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-26875
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_mixmonitor
>    Affects Versions: 13.8.0
>         Environment: CentOS6.5X64
>            Reporter: Aaron An
>            Assignee: Aaron An
>
> 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=============================
> 	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);    
> 	}    
> ====================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.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list