[Home]

Summary:ASTERISK-23914: *-in.wav and *-out.wav are out of sync when using monitor application
Reporter:youlc (asterisk_youlc)Labels:
Date Opened:2014-06-20 02:28:44Date Closed:2014-09-04 20:19:48
Priority:MajorRegression?
Status:Closed/CompleteComponents:Resources/res_monitor
Versions:1.8.25.0 Frequency of
Occurrence
Occasional
Related
Issues:
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,hangupAttachments:
Description: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.
Comments:By: Matt Jordan (mjordan) 2014-06-20 12:17:55.308-0500

Thank you for taking the time to report this bug and helping to make Asterisk better. Unfortunately, we cannot work on this bug because your description did not include enough information. You may find it helpful to read the Asterisk Issue Guidelines http://www.asterisk.org/developers/bug-guidelines. We would be grateful if you would then provide a more complete description of the problem. At a minimum, we need:

1. the specific steps or actions you took that caused you to encounter the problem,
2. the behavior you expected, and
3. the behavior you actually encountered (in as much detail as possible).

This likely includes output from the console with debug level logging, a SIP trace (if this is SIP related), and configuration information such as dialplan (e.g. extensions.conf) and channel configuration (e.g. sip.conf). Thanks!



By: youlc (asterisk_youlc) 2014-06-22 21:33:13.418-0500

Thank you for your reply.  Sorry for leaving out important details.
1.The related configurations are posted as follows,
sip.conf      
{noformat}
[148]
type=friend
secret=148
host=dynamic
qualify=yes
port=5060
mailbox=148@device
dtmfmode=rfc2833
dial=SIP/148
context=from-cc-ext
disallow=all
allow=g729
allow=ulaw
allow=alaw
reinvite=no
canreinvite=no
{noformat}

extensions.conf
{noformat}
[from-cc-ext]
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
{noformat}

if you need some iax configuration or others, I will post later.

2. The behavior we expected
 The monitor application will generate two files, one for inbound channel named as "*-in.wav" and the other for outbound name as "*-out.wav". For the real-time conversation is okay, when we play the monitored two files at the same time, we expect they can represent the conversation as it was.

3. The behavior we encountered
 When we played the monitored two files at the same time, occasionally they were not synchronous. It seems that the outbound file has some segment lost and since that lost part it is ahead of time relative to the inbound file. For example, the one (inbound) have not asked a question, the other one answered. And in my experience if the problem occurred, at most time the call conversation was long.

If some other information is needed, I will follow up as quickly as I can.


By: Rusty Newton (rnewton) 2014-06-25 19:09:35.317-0500

Can you test to see if you get the same issue with MixMonitor (app_mixmonitor) with the *r* and *t* parameters ?

By: youlc (asterisk_youlc) 2014-07-06 21:40:51.566-0500

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?

By: Rusty Newton (rnewton) 2014-07-08 08:48:51.161-0500

Can you test to see if you get the same issue with MixMonitor (app_mixmonitor) with the r and t parameters ?

By: youlc (asterisk_youlc) 2014-07-16 06:02:36.457-0500

Can you tell me what the function of r and t parameters? I refer to the usage of MixMonitor at "https://wiki.asterisk.org/wiki/display/AST/Application_MixMonitor" but did not find r and t parameters setting. And the source code do not have relative support either.

By: Rusty Newton (rnewton) 2014-08-01 16:55:55.672-0500

Ahh, sorry, those parameters were only added sometime after 1.8, looks like version 10 maybe.  [Here is the doc for 11|https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Application_MixMonitor].

Please post:

* a packet capture (suitable for wireshark)
* an accompanying Asterisk debug log of the same call in the packet capture. [Collecting debug information|https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information].
* Monitor recordings from the affected call.

We'll need that to move forward.



By: Rusty Newton (rnewton) 2014-08-20 14:58:20.800-0500

[~asterisk_youlc] Just checking in - Do you need more time to collect the requested data, or are you unable to reproduce the issue?

By: Rusty Newton (rnewton) 2014-09-04 20:19:34.780-0500

Suspended due to lack of activity. Please request a bug marshal in #asterisk-bugs on the IRC network irc.freenode.net to reopen the issue should you have the additional information requested.  Further information can be found at http://www.asterisk.org/developers/bug-guidelines