Summary:ASTERISK-18225: SIP channels are getting stuck after picking up calls
Reporter:Alisio Cordeiro (alisio)Labels:
Date Opened:2011-08-04 15:47:59Date Closed:2011-08-31 10:34:47
Status:Closed/CompleteComponents:Applications/app_directed_pickup Channels/chan_sip/General Channels/chan_sip/TCP-TLS
Versions:1.8.3 Frequency of
is related toASTERISK-18222 Pickupchan of a local channel segfaults if 2 users pickup at same time
is related toASTERISK-18273 Orphaned channels after pickup
Environment:Asterisk 1.8.3 dahdi 2.4.1 libpri CentOS 5.5Attachments:
Description:Some SIP channels are getting stuck after picking up calls and nothing happens when I try to hangup using "channel request hangup". I need to restart asterisk everytime this happens.

NOTE: I'm using TLS

result of "sip show channel SIP/7750-000007e2" (one of the stuck ones). Note that the last received SIP message was 'BYE'.

 * SIP Call
 Curr. trans. direction: Incoming
 Call-ID: 1847799520@
 Owner channel ID: SIP/7750-000007e2
 Our Codec Capability: 0xc (ulaw|alaw)
 Non-Codec Capability (DTMF): 1
 Their Codec Capability: 0x10c (ulaw|alaw|g729)
 Joint Codec Capability: 0xc (ulaw|alaw)
 Format: 0x8 (alaw)
 T.38 support No
 Video support No
 MaxCallBR: 384 kbps
 Theoretical Address:
 Received Address:
 SIP Transfer mode: open
 Force rport: Yes
 Audio IP: (local)
 Our Tag: as30a118c8
 Their Tag: 1700231540
 SIP User agent: Yealink SIP-T22P
 Username: 7750
 Peername: 7750
 Original uri: sip:7750@
 Caller-ID: 7750
 Need Destroy: No
 Last Message: Rx: BYE
 Promiscuous Redir: No
 Route: sip:7750@;transport=TLS
 DTMF Mode: rfc2833
 SIP Options: replaces replace
 Session-Timer: Inactive

result of 'core show channel SIP/7750-000007e2'

-- General --
          Name: SIP/7750-000007e2
          Type: SIP
      UniqueID: 1312486424.2370
      LinkedID: 1312486424.2370
     Caller ID: 7750
Caller ID Name: VILMA-DE7CT
   DNID Digits: *10
      Language: pt_BR
         State: Up (6)
         Rings: 0
 NativeFormats: 0x8 (alaw)
   WriteFormat: 0x8 (alaw)
    ReadFormat: 0x8 (alaw)
WriteTranscode: No
 ReadTranscode: No
1st File Descriptor: 1436
     Frames in: 1
    Frames out: 0
Time to Hangup: 0
  Elapsed Time: 0h42m12s
 Direct Bridge: <none>
Indirect Bridge: <none>
-- PBX --
       Context: LOCAL
     Extension: *10
      Priority: 1
    Call Group: 128
  Pickup Group: 128
   Application: (N/A)
          Data: (None)
   Blocking in: (Not Blocking)

 CDR Variables:
level 1: dnid=
level 1: clid="VILMA-DE7CT" <7750>
level 1: src=7750
level 1: dst=*10
level 1: dcontext=LOCAL
level 1: channel=SIP/7750-000007e2
level 1: start=2011-08-04 16:33:44
level 1: answer=2011-08-04 16:33:44
level 1: duration=2531
level 1: billsec=2531
level 1: disposition=ANSWERED
level 1: amaflags=DOCUMENTATION
level 1: uniqueid=1312486424.2370
level 1: linkedid=1312486424.2370
level 1: sequence=2862
Comments:By: Richard Mudgett (rmudgett) 2011-08-04 19:47:39.317-0500

Debugging deadlocks: Please select DEBUG_THREADS and DONT_OPTIMIZE in the Compiler Flags section of menuselect. Recompile and install Asterisk (i.e. make install).  This will then give you the console command "core show locks." When the symptoms of the deadlock present themselves again, please provide output of the deadlock via:

# asterisk -rx "core show locks" | tee /tmp/core-show-locks.txt
# gdb -se "asterisk" <pid of asterisk> | tee /tmp/backtrace.txt
gdb> bt
gdb> bt full
gdb> thread apply all bt

Then attach the core-show-locks.txt and backtrace.txt files to this issue. Thanks!

Also there were several pickup deadlocks fixed by v1.8.5.

By: Gregory Hinton Nietsky (irroot) 2011-08-05 03:09:52.665-0500

This is something ive seen this and put a possible fix in last week that drastically reduced this problem but it seems to still happen.

there are no locks held and no thread running on that channel its not bridged just sits in the channel container ...

need to spend more time with it

By: Tanguy CHAPRON (thera) 2011-08-08 10:08:02.627-0500

I have the same trouble in 1.8.5
Last logs :
[Aug  2 11:13:23] NOTICE[12820] app_directed_pickup.c: SIP/600-000008fb pickup by SIP/602-000008ff
[Aug  2 11:13:23] ERROR[12820] astobj2.c: user_data is NULL
[Aug  2 11:13:23] ERROR[12820] astobj2.c: user_data is NULL
[Aug  2 11:13:23] WARNING[12820] chan_sip.c: No SIP tech_pvt! Fixup of SIP/602-000008ff failed.
[Aug  2 11:13:23] WARNING[12820] channel.c: Fixup failed on channel SIP/602-000008ff<MASQ>, strange things may happen.
[Aug  2 11:13:23] VERBOSE[12820] pbx.c:   == Spawn extension (from-internal, **600, 1) exited non-zero on 'SIP/600-000008fb<ZOMBIE>'
[Aug  2 11:13:23] VERBOSE[12820] pbx.c:     -- Executing [h@from-internal:1] Hangup("SIP/600-000008fb<ZOMBIE>", "") in new stack
[Aug  2 11:13:23] VERBOSE[12820] pbx.c:   == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/600-000008fb<ZOMBIE>'

By: Paul Belanger (pabelanger) 2011-08-26 14:29:34.652-0500

Waiting for reporter to provide backtraces

By: Richard Mudgett (rmudgett) 2011-08-26 15:10:15.665-0500

ASTERISK-18222 and ASTERISK-18273 are related but not the same as the problem reported here.  I think the problem reported here is actually fixed in v1.8.5.  No way to be certain without the requested information.

By: Richard Mudgett (rmudgett) 2011-08-31 10:34:38.006-0500

I'm just going to close this as a duplicate.  Please try SVN 1.8 or v1.8.7.0 when it becomes available.