[asterisk-bugs] [Asterisk 0012269]: [branch] Deadlock after Originate from AMI to Agent

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Oct 31 09:54:41 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12269 
====================================================================== 
Reported By:                IgorG
Assigned To:                jpeeler
====================================================================== 
Project:                    Asterisk
Issue ID:                   12269
Category:                   Channels/chan_agent
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     ready for testing
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 110444 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-03-21 03:15 CDT
Last Modified:              2008-10-31 09:54 CDT
====================================================================== 
Summary:                    [branch] Deadlock after Originate from AMI to Agent
Description: 
I have discovered deadlock while using chan_agent and originate cal via
AMI. To reproduce need one agent and one registered phone. 

1) Login via AMI and make originate call
2) Answer a call both sides, talk and hangup phone.
3) After hangup MoH for agent doesn't starts and CLI show ERRORs:

    -- Started music on hold, class 'default', on SIP/104-08362618
[Mar 21 13:35:21] ERROR[8145]:
/usr/src/voip/asterisk-trunk/asterisk-trunk.patched-cng/include/aster:461
__ast_pthread_mutex_unlock: chan_agent.c line 843 (agent_hangup): attempted
unlock mutex '&p->app_lock' without owning it!
[Mar 21 13:35:21] ERROR[8145]:
/usr/src/voip/asterisk-trunk/asterisk-trunk.patched-cng/include/aster:463
__ast_pthread_mutex_unlock: chan_agent.c line 979 (agent_new):
'&p->app_lock' was locked here.
[Mar 21 13:35:21] ERROR[8145]:
/usr/src/voip/asterisk-trunk/asterisk-trunk.patched-cng/include/aster:486
__ast_pthread_mutex_unlock: chan_agent.c line 843 (agent_hangup): Error
releasing mutex: Operation not permitted

3) 'agent show online' still show called side in list

server-voip*CLI> agent show online
1001         (Vasya Pupkin) logged in on SIP/104-08362618 is idle
(musiconhold is 'default')
1 agents online>

3) After second try to Originage, originate fail and using CLI command
'agent show online' fail and make CLI frozen
====================================================================== 

---------------------------------------------------------------------- 
 (0094473) msetim (reporter) - 2008-10-31 09:54
 http://bugs.digium.com/view.php?id=12269#c94473 
---------------------------------------------------------------------- 
Hi jpeeler,

I'm doing tests trying to find out how to reproduce this issue. We can't
find out a way to do it always (it's yet is randomly), however I found a
interesting thing that can help with issue: 

First the configuration eventqueuestatus was changed to yes in queue.conf.
Then start listening manager ("telnet localhost 5038") to get events of an
agent answer.  After it we do a lot of calls by this way:

1. Call to queue
2. Agent answered
3. Call was hangup (by pressing *)
4. Execute "show queues"

We get the output of manager of "Wrong Member Queues Status(show queues)"
and (Correct Member Queues Status). Randomly after hangup a call by
pressing * the status is not correctly:

Event: QueueMemberStatus

Privilege: agent,all

Timestamp: 1225390283.359228

Queue: 800

Location: agent/605

MemberName: agent/605

Membership: static

Penalty: 0

CallsTaken: 27

LastCall: 1225390283

Status: 2

Paused: 0

Status 2: It's not right. We are expeting Status 1.

Looking for code that print this event (QueueMemberStatus
) in app_queue.c the "Status: X" came from devicestate... Can exist some
code don't be changing the status of devicestate correctly?

I'm attaching two output to you analyze. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-10-31 09:54 msetim         Note Added: 0094473                          
======================================================================




More information about the asterisk-bugs mailing list