Summary:ASTERISK-10496: mISDN don't make hangup and crash
Reporter:Igor Goncharovsky (igorg)Labels:
Date Opened:2007-10-10 22:41:52Date Closed:2008-02-19 14:38:51.000-0600
Versions:Frequency of
Environment:Attachments:( 0) core-1.txt
( 1) core-2.txt
( 2) misdn-begin.txt
( 3) misdn-crash.txt
( 4) misdn-end.txt
( 5) misdn-hangup.txt
Description:Yesterday I have notice some bad situation. When calling from SIP to cell phone, over chan_misdn and hangup on cell phone without take a call. On sip phone I still hear ringing and call hangup only after time-limit specified in Dial.

Here is step by step:
We call to cell phone:

We make hangup on cell phone. But still hear ringing on SIP:

Finaly we hear hangup on SIP and saw fallowing in console:

Also after 5-6 tries of such calls asterisk crashed:
Comments:By: crich (crich) 2007-11-16 04:35:01.000-0600

regarding the chan_misdn behaviour:

chan_misdn reconizes the pi:8 == there is inband information available. and therefore does not queue a HANGUP frame, because this would stop the call.

only when the cause is 17 == BUSY chan_misdn queues a BUSY frame, which stops the dial and jumps into the 101+n extension.

Probably we should queue a BUSY frame everytime when we get a disconnect, but the cause is very important, and cause:16 means Normal Call Clearing and not Busy..

But anyways you should not hear a RINGING, but the true message which is inband available, like a fast busy tone or even a voice message telling you that the called party is not available.

Also this happens only when we're in a pre-connected state, which mean there has no payed call established yet.

So i assume, either you do not hear the real inband message, or the provider sends still an inband ringing, even if you reject the call from your mobile which would be sort of strange.

regarding the segfault:

The segfault seems to happen in the device_state_changed_literal function, i wonder why it was called with a NULL pointer from ast_setstate?

#0  0x080a6ac8 in ast_device_state_changed_literal (dev=0x0) at devicestate.c:487
487             buf = ast_strdupa(dev);
(gdb) bt

By: Igor Goncharovsky (igorg) 2007-11-16 04:55:26.000-0600

I make some tries to locate segfault, but have no much soccess. I've discovered that sometime (not regular) dev name in channel structure became NULL. I seems to be some kind of memory corruption.

At first part: i think that it is real inband message. I think, that really provider sends inband ringing, even if I reject the call. Is it really strange? Can I read some document about right behavior? In fact I am working in that provider and therefore can get more information.

May be we can add some configuration option for this situation or dialplan variable to control chan_misdn?

By: Igor Goncharovsky (igorg) 2007-12-05 22:28:17.000-0600

Looks like I really hear some fake ringing, maybe from my phone (SPA 941). I try to test more and report. Still have question about crash. I have one more now. It is very similar:

(gdb) bt
0  0xb7c38f73 in strlen () from /lib/libc.so.6
1  0x080ac284 in ast_device_state_changed_literal (dev=0x2020206c <Address 0x2020206c out of bounds>) at devicestate.c:480
2  0x0809899a in ast_setstate (chan=0x839fa20, state=AST_STATE_DOWN) at channel.c:3812
3  0xb59a0bfa in release_chan (bc=0x8370b14) at chan_misdn.c:3705
4  0xb59a3e60 in cb_events (event=EVENT_CLEANUP, bc=0x8370b14, user_data=0x0) at chan_misdn.c:4679
5  0xb59aeed2 in handle_cr (stack=0x836fec0, frm=0x834c8fc) at misdn/isdn_lib.c:1645
6  0xb59b158d in handle_frm (msg=0x834c8c8) at misdn/isdn_lib.c:2602
7  0xb59b4180 in manager_isdn_handler (frm=0x834c8fc, msg=0x834c8c8) at misdn/isdn_lib.c:3619
8  0xb59b2782 in misdn_lib_isdn_event_catcher (arg=0x834bad0) at misdn/isdn_lib.c:3025
9  0xb7d72192 in start_thread () from /lib/libpthread.so.0
10 0xb7c8f02e in clone () from /lib/libc.so.6

Asterisk crash when I have troubles with ISDN and can't make or receive calls. I call several times and have a crash. All this crashes caused on unsuccessful calls by wrong dev pointer. Where it can be corrupted?