[Home]

Summary:ASTERISK-11020: One recording file empty for calls in queue with callback agents
Reporter:Atis Lezdins (atis)Labels:
Date Opened:2007-12-12 11:35:18.000-0600Date Closed:2007-12-18 11:02:13.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/Channels
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 11529.patch
Description:After upgrade from 1.4.10 to 1.4.14 there's a problem with recording of queue calls. Only agent's voice is recorded, the recording of customer voice has 0 size.

Agents are logged in trough AgentCallbackLogin, and Monitor() is issued within answer macro of Dial().

I pinpointed that the problem starts with r85158 - where sound is completely lost between agent and customer (that's fixed in ASTERISK-1101071), but after that fix (r88931), recording is still lost. Applying patch of ASTERISK-1101071 to r85158 shows that recording is also lost exactly in that commit.

****** ADDITIONAL INFORMATION ******

Part of CLI log:
   -- Executing [22674@local_dial:70] Dial("Local/22674@default-queue-52b8,2", "SIP/90006|15|gtM(queue_call_answer^22674)") in new stack
   -- Called 90006
   -- SIP/90006-08438dc8 is ringing
   -- Agent/22674 is ringing
   -- SIP/90006-08438dc8 answered Local/22674@default-queue-52b8,2
   -- Executing [s@macro-queue_call_answer:1] Set("SIP/90006-08438dc8", "agent_answered=22674") in new stack
(snip)
   -- Executing [s@macro-set_record:13] Set("SIP/90006-08438dc8", "MONITOR_FILENAME=/var/spool/asterisk/monitor/2007-12-12/call-1197479807.15-3") in new stack
   -- Executing [s@macro-set_record:14] StopMonitor("SIP/90006-08438dc8", "") in new stack
   -- Executing [s@macro-set_record:15] Monitor("SIP/90006-08438dc8", "ulaw|/var/spool/asterisk/monitor/2007-12-12/call-1197479807.15-3") in new stack
(snip)
   -- Agent/22674 answered SIP/112233-08409e28
   -- Stopped music on hold on SIP/112233-08409e28
Comments:By: Digium Subversion (svnbot) 2007-12-12 11:43:15.000-0600

Repository: asterisk
Revision: 92510

U   branches/1.4/res/res_features.c

------------------------------------------------------------------------
r92510 | mmichelson | 2007-12-12 11:43:14 -0600 (Wed, 12 Dec 2007) | 7 lines

Correctly detect where a dynamic feature was activated. Before this patch,
the channel which initiated the bridge was always assumed to have been the one
which activated the dynamic feature. This patch corrects this.

(closes issue ASTERISK-11020, reported and patched by nic_bellamy)


------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=92510

By: Digium Subversion (svnbot) 2007-12-12 11:45:37.000-0600

Repository: asterisk
Revision: 92511

_U  trunk/

------------------------------------------------------------------------
r92511 | mmichelson | 2007-12-12 11:45:35 -0600 (Wed, 12 Dec 2007) | 14 lines

Blocked revisions 92510 via svnmerge

........
r92510 | mmichelson | 2007-12-12 11:46:14 -0600 (Wed, 12 Dec 2007) | 7 lines

Correctly detect where a dynamic feature was activated. Before this patch,
the channel which initiated the bridge was always assumed to have been the one
which activated the dynamic feature. This patch corrects this.

(closes issue ASTERISK-11020, reported and patched by nic_bellamy)


........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=92511

By: Atis Lezdins (atis) 2007-12-12 11:51:07.000-0600

I don't find this commit related to issue

By: Mark Michelson (mmichelson) 2007-12-12 13:50:56.000-0600

Oops, sorry about that :)

By: Mark Michelson (mmichelson) 2007-12-12 15:31:04.000-0600

I have found the offending section of code, however I am not able to fix the problem immediately. The problem comes from within ast_write in channel.c. When using callback agents, ast_write bypasses the agent channel's write and just uses the underlying channel's write function instead. The problem is that Monitor is listening on the agent channel, not the base channel. The reason that the get_base_channel methods were added to chan_agent was as a method of deadlock avoidance, so a new deadlock avoidance scheme will need to be devised in order to change this.

By: Mark Michelson (mmichelson) 2007-12-12 16:23:10.000-0600

I have added a new deadlock avoidance mechanism to ast_write (very similar to the one used in __ast_read). I tested it locally and the audio on the call went both directions just fine and the recordings were both made correctly. Please test to be sure there aren't any problems.

Thanks!

By: Eliel Sardanons (eliel) 2007-12-12 16:41:24.000-0600

putnopvut: Could be usefull to report back a Deadlock avoidance message if we couldn't lock the channel? (when count > 10 and we return 0)

By: Mark Michelson (mmichelson) 2007-12-12 18:10:07.000-0600

eliel: That sounds like a good idea to me. If atis reports that the patch fixes the problem, I'll add in a debug message there and in __ast_read (which has a very similar deadlock avoidance scheme) to indicate if we have attempted to lock more than 10 times when I commit the change.

By: Atis Lezdins (atis) 2007-12-14 05:26:19.000-0600

thanks, it worked fine on my production for one day.

By: Atis Lezdins (atis) 2007-12-18 08:41:26.000-0600

Ping!

Are you waiting for some more testers?

Working on my production (with 1.4.14) for 5 days, no problems

By: Mark Michelson (mmichelson) 2007-12-18 10:54:26.000-0600

All right. Five days without a hitch sounds good. I'll commit this ASAP. Thanks for testing this!

By: Digium Subversion (svnbot) 2007-12-18 10:59:39.000-0600

Repository: asterisk
Revision: 93625

U   branches/1.4/main/channel.c

------------------------------------------------------------------------
r93625 | mmichelson | 2007-12-18 10:59:37 -0600 (Tue, 18 Dec 2007) | 6 lines

Rework deadlock avoidance used in ast_write, since it meant that agent channels which were being monitored
had one audio file recorded and one empty audio file saved.

(closes issue ASTERISK-11020, reported by atis patched by me)


------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=93625

By: Digium Subversion (svnbot) 2007-12-18 11:02:13.000-0600

Repository: asterisk
Revision: 93626

_U  trunk/
U   trunk/main/channel.c

------------------------------------------------------------------------
r93626 | mmichelson | 2007-12-18 11:02:11 -0600 (Tue, 18 Dec 2007) | 14 lines

Merged revisions 93625 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r93625 | mmichelson | 2007-12-18 11:02:48 -0600 (Tue, 18 Dec 2007) | 6 lines

Rework deadlock avoidance used in ast_write, since it meant that agent channels which were being monitored
had one audio file recorded and one empty audio file saved.

(closes issue ASTERISK-11020, reported by atis patched by me)


........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=93626