[Home]

Summary:ASTERISK-06592: [patch] Asterisk with chan_skinny crash with Cisco 7920
Reporter:sbisker (sbisker)Labels:
Date Opened:2006-03-21 16:27:13.000-0600Date Closed:2006-05-05 15:45:05
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Channels/chan_skinny
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) chan_skinny-14319-20060322-1540.diff
( 1) skinny.out
Description:Everytime I try to register a Cisco 7920 phone with asterisk, asterisk segfaults.  I've attached the backtrace.

Below is my skinny.conf

;
; Skinny Configuration for Asterisk
;
[general]
port = 2000             ; Port to bind to, default tcp/2000
bindaddr = 192.168.1.15
dateFormat = M-D-Y      ; M,D,Y in any order (5 chars max)
keepAlive = 120

; allow = all
disallow = all
allow = g729
allow = alaw
allow = ulaw


[5285]
model=7920
device=SEP0016C7988C71
nat=0
callerid="Frank Rizzo" <5285>
linelabel="5285"                ; Displays next to the line button on 7940's and 7960s
mailbox=5285
callwaiting=1
transfer=1
context=longdistance
line => 5285

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

Reading symbols from /usr/lib/asterisk/modules/chan_skinny.so...done.
Loaded symbols for /usr/lib/asterisk/modules/chan_skinny.so
#0  handle_message (req=0x84b6738, s=0x84b6310) at chan_skinny.c:2647
2647                    memcpy(req->data.linestat.lineDirNumber, lines->name,
(gdb) bt
#0  handle_message (req=0x84b6738, s=0x84b6310) at chan_skinny.c:2647
#1  0x00937ccf in skinny_session (data=0x84b6310) at chan_skinny.c:2935
#2  0x00bbd341 in start_thread () from /lib/tls/libpthread.so.0
#3  0x00b166fe in clone () from /lib/tls/libc.so.6
Comments:By: sbisker (sbisker) 2006-03-21 16:36:23.000-0600

Below is the output from asterisk console

isdpbx*CLI> load chan_skinny.so
Loaded /usr/lib/asterisk/modules/chan_skinny.so => (Skinny Client Control Protocol (Skinny))
    -- Setting mailbox '5285' on 5285@5285
    -- Allocating Skinny subchannel '0' on 5285@5285
    -- Allocating Skinny subchannel '1' on 5285@5285
    -- Added device '5285'
  == Skinny listening on 192.168.1.15:2000
  == Registered channel type 'Skinny' (Skinny Client Control Protocol (Skinny))
   -- Starting Skinny session from 192.168.0.159
Device SEP0016C7988C71 is attempting to register
   -- Device '5285' successfuly registered
Requesting capabilities
RECEIVED UNKNOWN MESSAGE TYPE:  2b
Version Request
Received CapabilitiesRes
Buttontemplate requested
Sending 7920 template to 5285@5285 (7920)
Recieved SoftKey Template Request
Received LineStateReq
Received LineStateReq
isdpbx*CLI>
Disconnected from Asterisk server

By: sbisker (sbisker) 2006-03-21 16:40:32.000-0600

Uploaded file skinny.out captured with:

tcpdump -n -i eth0 -w skinny.out port 2000

By: Jason Parker (jparker) 2006-03-22 16:34:49.000-0600

Funny...I found this same bug on my own the other day.

Just for grins, go ahead and try adding a second device (just a fake one is fine) to your skinny.conf, and let me know how that goes.  I'll try to come up with a proper fix.

By: Jason Parker (jparker) 2006-03-22 17:42:29.000-0600

Try this patch - it appears to be working here.

Disclaimer on file.

By: Jason Parker (jparker) 2006-03-22 17:49:11.000-0600

Patch will also apply on 1.2.5 if you add the -l or --ignore-whitespace argument to the patch command.

By: sbisker (sbisker) 2006-03-23 09:31:38.000-0600

Well that fixed the crashing problem.  Looks like the phone is getting registered on the server, but the phone never picks up the registration and keeps trying to re-register.  Tried on both firmware 1.09 and 2.01.  Below is the asterisk console messages.

Connected to Asterisk 1.2.5 currently running on isddev01usae (pid = 13603)
 -- Remote UNIX connection
Verbosity is at least 6
isddev01usae*CLI>
isddev01usae*CLI>
   -- Starting Skinny session from 192.168.0.156
Device SEP0016C7988C77 is attempting to register
   -- Device '5285' successfuly registered
Requesting capabilities
RECEIVED UNKNOWN MESSAGE TYPE:  2b
Version RequestI>
Received CapabilitiesRes
Buttontemplate requested
Sending 7920 template to 5285@5285 (7920)
Recieved SoftKey Template Request
Received LineStateReq
Received LineStateReq
Received SoftKeySetReq
Mar 23 10:29:35 WARNING[13650]: chan_skinny.c:2903 get_input:  Skinny Client sent less data than expected.
Mar 23 10:29:35 NOTICE[13650]: chan_skinny.c:2965 skinny_session:  Skinny Session returned: Connection reset by pee
   -- Starting Skinny session from 192.168.0.156
Device SEP0016C7988C77 is attempting to register
   -- Device '5285' successfuly registered
Requesting capabilities
RECEIVED UNKNOWN MESSAGE TYPE:  2b
Version RequestI>
Received CapabilitiesRes
Buttontemplate requested
Sending 7920 template to 5285@5285 (7920)
Recieved SoftKey Template Request
Received LineStateReq
Received LineStateReq
Received SoftKeySetReq
Mar 23 10:29:57 WARNING[13651]: chan_skinny.c:2903 get_input:  Skinny Client sent less data than expected.
Mar 23 10:29:57 NOTICE[13651]: chan_skinny.c:2965 skinny_session:  Skinny Session returned: Connection reset by pee
   -- Starting Skinny session from 192.168.0.156
Device SEP0016C7988C77 is attempting to register
   -- Device '5285' successfuly registered
Requesting capabilities
RECEIVED UNKNOWN MESSAGE TYPE:  2b
Version RequestI>
Received CapabilitiesRes
Buttontemplate requested
Sending 7920 template to 5285@5285 (7920)
Recieved SoftKey Template Request
Received LineStateReq
Received LineStateReq
Received SoftKeySetReq
Mar 23 10:30:02 WARNING[13652]: chan_skinny.c:2903 get_input:  Skinny Client sent less data than expected.
Mar 23 10:30:02 NOTICE[13652]: chan_skinny.c:2965 skinny_session:  Skinny Session returned: Connection reset by peer

By: Jason Parker (jparker) 2006-04-01 02:45:02.000-0600

Please test the code in bug:6859

By: Jason Parker (jparker) 2006-05-05 15:45:05

I'm closing this, since 6859 will massively change the way chan_skinny works, and the patch there fixes this issue.