[asterisk-bugs] [JIRA] (ASTERISK-23914) *-in.wav and *-out.wav are out of sync when using monitor application

youlc (JIRA) noreply at issues.asterisk.org
Sun Jul 6 21:53:56 CDT 2014


    [ https://issues.asterisk.org/jira/browse/ASTERISK-23914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=220291#comment-220291 ] 

youlc edited comment on ASTERISK-23914 at 7/6/14 9:53 PM:
----------------------------------------------------------

I tried to read asterisk source code in the past weeks. I found where the problem may locate. When using monitor application, asterisk use data members "insmpl" and "outsmpl" in struct ast_chan  to ensure monitor synchronization. If it runs correctly, the monitored outbound samples  should be roughly equal to inbound samples. But the monitored "*-in.wav" has more samples, sometimes samples of several seconds,  than "-out.wav".

I check the log and find why it runs out of sync, 
#grep "Failed to perform seek" -rin /var/log/asterisk
./messages-20140608:27073:[Jun  3 11:40:59] WARNING[3122] channel.c: Failed to perform seek in monitoring read stream, synchronization between the files may be broken
./messages-20140608:27075:[Jun  3 11:40:59] WARNING[4192] channel.c: Failed to perform seek in monitoring read stream, synchronization between the files may be broken
./messages-20140608:27083:[Jun  3 11:40:59] WARNING[4205] channel.c: Failed to perform seek in monitoring read stream, synchronization between the files may be broken
./messages-20140608:27090:[Jun  3 11:41:00] WARNING[4205] channel.c: Failed to perform seek in monitoring write stream, synchronization between the files may be broken
./messages-20140608:27099:[Jun  3 11:41:00] WARNING[4205] channel.c: Failed to perform seek in monitoring write stream, synchronization between the files may be broken

Can you help me fix it?


was (Author: asterisk_youlc):
I tried to read asterisk source code in the past weeks. I found where the problem may locate. When using monitor application, asterisk use data members "insmpl" and "outsmpl" in struct ast_chan  to ensure monitor synchronization. If it runs correctly, the monitored outbound samples  should be roughly equal to inbound samples. But the monitored "*-in.wav" has more samples, sometimes samples of several seconds,  than "-out.wav".

Can there exist file holes which can be generated by lseek operation, but not filled with zero when write to disk? 

> *-in.wav and *-out.wav are out of sync when using monitor application
> ---------------------------------------------------------------------
>
>                 Key: ASTERISK-23914
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-23914
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_monitor
>    Affects Versions: 1.8.25.0
>         Environment: system: Linux 2.6.32-431.5.1.el6.x86_64
> CPU usage: less than 40%
> codec: g729
> monitor file format: wav
> monitor file storage : type=tmpfs, max size = 3G, average usage: less than 10%
> concurrence: about 60
> dialplan:
> exten => _XXX.,1,answer
> exten => _XXX.,n,set(old_cid=${CALLERID(num)})
> exten => _XXX.,n,set(wav_file_name=${STRFTIME(${EPOCH},,%Y_%m_%d-%H_%M_%S)}-${EXTEN})
> exten => _XXX.,n,Monitor(wav,${wav_file_name},b)
> exten => _XXX.,n,set(CALLERID(num)=9135)
> exten => _XXX.,n,set(CALLERID(name)=manual_dial#${old_cid}#${wav_file_name}#${EXTEN})
> exten => _XXX.,n,dial(iax2/hkiaxtk/9${EXTEN})
> exten => _XXX.,n,hangup
>            Reporter: youlc
>            Assignee: youlc
>
> When using monitor application to monitor conversations, the monitored two files, "*-in.wav" and "*-out.wav", are out of sync occasionally. The file '*-in.wav' is okay, but the monitored file '*-out.wav' has some segment lost.



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



More information about the asterisk-bugs mailing list