[Home]

Summary:ASTERISK-13661: [patch] Option C in Queue() app crashes Asterisk
Reporter:Olivier Krief (okrief)Labels:
Date Opened:2009-12-20 10:59:31.000-0600Date Closed:2010-02-18 15:00:56.000-0600
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Applications/app_queue
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) M16475.diff
( 1) M16475.txt
( 2) queue_crash.diff
Description:In extension.ael, this line works OK :
   Queue(techsupport);
Adding option C crashes Asterisk as soon queue member is answering the call :
   Queue(techsupport,C);
SIP debug traces are included in additional information section.
In this section SIP/462 in the queue member answering the call and SIP/461 is the caller.
I'm not sure the SIP hardphones I used for this test support SIP "Answered Elsewhere" option (I think they do support it but I didn't configure it) but this shouldn't crash Asterisk.



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

<--- SIP read from UDP:172.16.2.105:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.16.2.1:5060;branch=z9hG4bK6e88f0a5;rport
From: "Nahalie Doe"<sip:461@172.16.2.1>;tag=as77e1e0ec
To: <sip:462@172.16.2.105:5060;user=phone>;tag=c0a80101-3f1c24
Call-ID: 4987b533394a00ab175169f442e6ce6d@172.16.2.1
CSeq: 102 INVITE
Require: timer
Session-Expires: 1800;refresher=uac
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,PRACK,SUBSCRIBE,NOTIFY,UPDATE,REFER,REGISTER,INFO
Contact: <sip:462@172.16.2.105:5060;user=phone>
Allow-Events: refer,dialog,message-summary,check-sync,talk,hold
Content-Type: application/sdp
Content-Length: 142

v=0
o=462 4138641 4138641 IN IP4 172.16.2.105
s=-
c=IN IP4 172.16.2.105
t=0 0
m=audio 41000 RTP/AVP 8
a=rtpmap:8 PCMA/8000
a=sendrecv

<------------->
--- (13 headers 8 lines) ---
Found RTP audio format 8
Found audio description format PCMA for ID 8
Capabilities: us - 0x8 (alaw), peer - audio=0x8 (alaw)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x8 (alaw)
Non-codec capabilities (dtmf): us - 0x0 (nothing), peer - 0x0 (nothing), combined - 0x0 (nothing)
Peer audio RTP is at port 172.16.2.105:41000
list_route: hop: <sip:462@172.16.2.105:5060;user=phone>
set_destination: Parsing <sip:462@172.16.2.105:5060;user=phone> for address/port to send to
set_destination: set destination to 172.16.2.105, port 5060
Transmitting (no NAT) to 172.16.2.105:5060:
ACK sip:462@172.16.2.105:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 172.16.2.1:5060;branch=z9hG4bK6eb11b1c;rport
Max-Forwards: 70
From: "Nahalie Doe" <sip:461@172.16.2.1>;tag=as77e1e0ec
To: <sip:462@172.16.2.105:5060;user=phone>;tag=c0a80101-3f1c24
Contact: <sip:461@172.16.2.1>
Call-ID: 4987b533394a00ab175169f442e6ce6d@172.16.2.1
CSeq: 102 ACK
User-Agent: Asterisk PBX 1.6.2.0
Content-Length: 0


---
Scheduling destruction of SIP dialog '4987b533394a00ab175169f442e6ce6d@172.16.2.1' in 6400 ms (Method: INVITE)
set_destination: Parsing <sip:462@172.16.2.105:5060;user=phone> for address/port to send to
set_destination: set destination to 172.16.2.105, port 5060
Reliably Transmitting (no NAT) to 172.16.2.105:5060:
BYE sip:462@172.16.2.105:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 172.16.2.1:5060;branch=z9hG4bK767de5b2;rport
Max-Forwards: 70
From: "Nahalie Doe" <sip:461@172.16.2.1>;tag=as77e1e0ec
To: <sip:462@172.16.2.105:5060;user=phone>;tag=c0a80101-3f1c24
Call-ID: 4987b533394a00ab175169f442e6ce6d@172.16.2.1
CSeq: 103 BYE
User-Agent: Asterisk PBX 1.6.2.0
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0


---
mypbc*CLI>
Disconnected from Asterisk server
Comments:By: Clod Patry (junky) 2009-12-20 14:25:48.000-0600

ive been able to reproduce this bug (see attachment)
I've no clue what is the option C, can someone give me more details?

But i've been able to see that we are calling ast_bridge_call() with an invalid *peer, this is because we are calling hangupcalls() and we hangup the channel.

Really not sure about this fix, but it prevent segfault.

By: Olivier Krief (okrief) 2009-12-20 17:26:20.000-0600

I'm not familiar with this option C, either : I met this bug while studying this option.
I applied this patch this way:
cd /usr/src/asterisk-1.6.2.0
wget 'http://issues.asterisk.org/file_download.php?file_id=24827&type=bug' -O - | patch -p0
./configure
make
make install

Unfortunately, this still craches Asterisk :
CLI>
Disconnected from Asterisk server

By: Clod Patry (junky) 2009-12-20 22:30:50.000-0600

Are you sure you restarted * after you applied the patch (after the make install) ?

By: Olivier Krief (okrief) 2009-12-21 02:19:43.000-0600

Now, I remember I didn't (shame on me).
After restarting, it doesn't crash anymore.

As the main reason I opened this issue is this crash, not the option C feature, it would be OK for me to either have this issue marked closed, or either have someone more experienced than me, looking at the feature itself.

Thanks for all !

By: Clod Patry (junky) 2009-12-21 08:05:17.000-0600

My goal was to prevent the crash also.
To be honest, i dont understand the option C, I will let Mark Michelson (the queue master) review it and give some feedback.

By: Digium Subversion (svnbot) 2010-02-18 14:58:42.000-0600

Repository: asterisk
Revision: 247736

U   trunk/apps/app_queue.c

------------------------------------------------------------------------
r247736 | dvossel | 2010-02-18 14:58:41 -0600 (Thu, 18 Feb 2010) | 7 lines

fixes Queue with C option crash

(closes issue ASTERISK-13661)
Reported by: okrief
Patches:
     queue_crash.diff uploaded by dvossel (license 671)

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

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

By: Digium Subversion (svnbot) 2010-02-18 14:59:38.000-0600

Repository: asterisk
Revision: 247737

_U  branches/1.6.2/
U   branches/1.6.2/apps/app_queue.c

------------------------------------------------------------------------
r247737 | dvossel | 2010-02-18 14:59:38 -0600 (Thu, 18 Feb 2010) | 14 lines

Merged revisions 247736 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r247736 | dvossel | 2010-02-18 14:58:41 -0600 (Thu, 18 Feb 2010) | 7 lines
 
 fixes Queue with C option crash
 
 (closes issue ASTERISK-13661)
 Reported by: okrief
 Patches:
       queue_crash.diff uploaded by dvossel (license 671)
........

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

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

By: Digium Subversion (svnbot) 2010-02-18 15:00:38.000-0600

Repository: asterisk
Revision: 247738

_U  branches/1.6.1/

------------------------------------------------------------------------
r247738 | dvossel | 2010-02-18 15:00:38 -0600 (Thu, 18 Feb 2010) | 13 lines

Blocked revisions 247736 via svnmerge

........
 r247736 | dvossel | 2010-02-18 14:58:41 -0600 (Thu, 18 Feb 2010) | 7 lines
 
 fixes Queue with C option crash
 
 (closes issue ASTERISK-13661)
 Reported by: okrief
 Patches:
       queue_crash.diff uploaded by dvossel (license 671)
........

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

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

By: Digium Subversion (svnbot) 2010-02-18 15:00:55.000-0600

Repository: asterisk
Revision: 247739

_U  branches/1.6.0/

------------------------------------------------------------------------
r247739 | dvossel | 2010-02-18 15:00:55 -0600 (Thu, 18 Feb 2010) | 13 lines

Blocked revisions 247736 via svnmerge

........
 r247736 | dvossel | 2010-02-18 14:58:41 -0600 (Thu, 18 Feb 2010) | 7 lines
 
 fixes Queue with C option crash
 
 (closes issue ASTERISK-13661)
 Reported by: okrief
 Patches:
       queue_crash.diff uploaded by dvossel (license 671)
........

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

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