Summary:ASTERISK-07750: Chanspy hangup causes crash
Reporter:jojo (jojo)Labels:
Date Opened:2006-09-15 06:57:32Date Closed:2006-10-03 12:06:30
Versions:Frequency of
Environment:Attachments:( 0) backtrace_spychan_crash.txt
( 1) bt_&_bt_full_output.txt
Description:Version 1.12.1, fresh install. Never experienced on old install, 1.2.3

When chanspy is hung up whilst spying on a PROVIDER channel (IAX2) it causes immediate crash. When chanspy is hung up whilst spying on an EXTENSION (also IAX2) problem doesn't occur.


Sep 15 12:29:04 VERBOSE[11707] logger.c: -- Accepting AUTHENTICATED call from
> requested format = gsm,
> requested prefs = (),
> actual format = ulaw,
> host prefs = (ulaw|alaw|gsm|speex|ilbc),
> priority = mine
Sep 15 12:29:04 VERBOSE[12779] logger.c: -- Executing ChanSpy("IAX2/911-2", "|q") in new stack
Sep 15 12:29:04 DEBUG[11698] channel.c: Avoiding initial deadlock for 'IAX2/911-2'
Sep 15 12:29:05 VERBOSE[12779] logger.c: == Spying on channel IAX2/voipgate-8
Sep 15 12:29:05 NOTICE[12779] app_chanspy.c: Attaching IAX2/911-2 to IAX2/voipgate-8
Sep 15 12:29:05 DEBUG[12779] channel.c: Spy ChanSpy added to channel IAX2/voipgate-8
Sep 15 12:29:05 DEBUG[11707] chan_iax2.c: Ooh, voice format changed to 4
Sep 15 12:29:05 DEBUG[12293] channel.c: Building translator from alaw to SLINEAR for spies on channel IAX2/voipgate-8
Sep 15 12:29:05 DEBUG[12293] channel.c: Building translator from alaw to SLINEAR for spies on channel IAX2/voipgate-8
Sep 15 12:29:05 DEBUG[11707] chan_iax2.c: Peer lastms 117, historicms 117, maxms 2000
Sep 15 12:29:09 DEBUG[11707] chan_iax2.c: Immediately destroying 2, having received hangup
Sep 15 12:29:09 DEBUG[12779] channel.c: Spy ChanSpy removed from channel IAX2/voipgate-8
Sep 15 12:29:09 VERBOSE[12779] logger.c: == Done Spying on channel IAX2/voipgate-8
Comments:By: Joshua C. Colp (jcolp) 2006-09-15 16:54:29

If this is a crash issue then a backtrace must be filed with it, otherwise we can't see where it actually crashed.

By: jojo (jojo) 2006-09-15 20:38:44

hi all - thanks for your response. please, how do i do the backtrace for you? i'm fairly confident this is not on my end (not withstanding hardware issues), but am fluent only in php, mysql and asterisk config files (plus asterisk installation issues with solutions gleaned off google) to date.



By: Joshua C. Colp (jcolp) 2006-09-16 11:54:06

You have to give us time to respond, some of us have been gone (like myself) and just got back home and back into a conscious state. Here's a URL for a document on getting a backtrace:?http://svn.digium.com/view/asterisk/trunk/doc/backtrace.txt?rev=42735

By: jojo (jojo) 2006-09-16 12:02:56


got asterisk running in -g , don't seem to be getting a core dump:

 == Spying on channel IAX2/voipjet1-2
 == Done Spying on channel IAX2/voipjet1-2
Disconnected from Asterisk server
Executing last minute cleanups
h1033634:/# ls -l /tmp/core.*
ls: /tmp/core.*: Datei oder Verzeichnis nicht gefunden

By: jojo (jojo) 2006-09-16 12:09:20

Actually, on looking at this now, maybe "crash" i the wrong word? It look more like it is stopping gracefully...

By: Serge Vecher (serge-v) 2006-09-18 09:51:19

the core file be found in /tmp dir only if you start Asterisk with the safe_asterisk script from ./contrib/scripts dir. If you run asterisk without the script with the -g option, the core file will be found in the current directory.

By: jojo (jojo) 2006-09-18 10:44:59

thanks. please find bt enclosed.

By: Joshua C. Colp (jcolp) 2006-09-18 11:01:27

Would it be possible to gain access to the box where this core dump and Asterisk is so I can take a closer look?

By: jojo (jojo) 2006-09-18 11:28:32

hmm... maybe this evening - it is a production server, currently in use. is this not replicating on anyone else's installation, btw?

By: jojo (jojo) 2006-09-19 13:03:20

file - can get you access in about an hour from now. please email your contact phone number to my email address as stored in this bug tracking system and i'll get you in.



By: jojo (jojo) 2006-09-20 06:45:35

Available again today after 18:30 GMT

By: jojo (jojo) 2006-09-20 15:09:03

next opportunity at 17:00 GMT tomorrow - please let me know either way, this is being authorized every time, you know.

By: Charlie (csum77) 2006-09-20 23:47:10

Hi all. I seem to be experiencing a very similar issue. I'll provide as much detail as I can. I'm not our resident Linux guru...but he's out of the country for a month so this falls on my shoulders. My client has just about had it w/Asterisk (much of that probably from our relative inexperience with Asterisk, not the platform itself), but I think it can do what they need and we really want to see it succeed.

This is occurring on Asterisk We installed * from a Trixbox distro, but our Linux guru did some updates and whatever magic was needed to make it work with our Sangoma 4 port T1 card. We have about 30 SIP extensions, and we connect to the outside world via a PRI T1.

We have chanspy set up to monitor calls on our sip extensions. Chanspy listens in just fine. If there's only one call in place it hangs up fine. If, however, there is more than one call in progress when the "spier" hangs up asterisk crashes and restarts itself almost immediately thereafter. All calls in progress get dropped...ext. to ext. as well as inbound & outbound.

I can repeat this any time I want by either placing an outbound call to our incoming line & monitoring then hanging up the monitor, or with two or more outbound calls (monitoring & then hanging up the monitor). In both cases only the person monitoring needs to hang up and all calls in progress drop.

We're capturing cdr data to MySQL, and in addition to chanspy we're recording all outbound calls from three extensions. Other than that, this is a pretty vanilla setup (at least, so far as I know ;).

I can make this box available via ssh any time after about 6:30p MDT (GMT 00:30) and up until about 5:00a (GMT 11:00), however, being that it's live I'd feel best if I could make a full backup of all our configs, voicemail, etc. so should things go wrong I can restore (though I'm not sure how to do this either).

Now, rookie Linux questions re: the backtrace. Being that I'm not a linux guru, I'm not sure about doing the make dont-optimize command...where do I run this? Does this simply recompile the Asterisk on my system, or does it get updates in the process? Does it wipe out my asterisk system configuration (extensions, db & cdr records, dial plans, auto attendant ivr, voicemail, etc etc)? After I get the needed info, can I just run the make install and everything will be just like it was before doing the make dont-optimize?

I hope this info was helpful, and I hope I've put it in the right spot. If not, or I did something *wrong* please let me know. Also, I don't expect folks to take time to answer my rookie Linux questions, but if you can at least point me to specific references I'd really appreciate that. I'm trying to learn...



By: Charlie (csum77) 2006-09-21 00:07:03

Just uploaded my bt & bt full file. I haven't done the make dont-optimize due to my lack of knowledge, but hopefully this will provide some helpful data (though seeing that my file is much smaller than jojo's I'm betting it's not good enough???).


By: Joshua C. Colp (jcolp) 2006-09-21 13:09:14

I'm back! Wahoo!

jojo: It doesn't matter if the box is in use or not, I just need the core file to still exist and the binary that produced the core file to still exist. This doesn't affect a running Asterisk so anytime would work. Drop me a line at jcolp@digium.com

csum77: Based on the backtrace you do appear to be having the same issue. To create an unoptimized build though you go into your Asterisk directory, type make clean and then make dont-optimize. This rebuilds everything with no optimizations. Then you do make install. This installs these newly built modules/application but does not replace your configuration files.

By: jojo (jojo) 2006-09-21 13:40:10

file - please see your email, have written to you.

csum77 - glad to see i'm not the only one with this prob. will be letting file into my server, hopefully that will give him what he needs.



By: aster1 (aster1) 2006-09-21 14:33:10

Exactly same issue here i am definitely sure chanspy is crashing asterisk..

By: Charlie (csum77) 2006-09-21 17:50:00

Thanks for the feedback file. Knowing that rebuilding won't mess up vm, configs, etc. I'll do the make dont-optimize tonight, make it crash, and post the results.

Just to be clear, when you say run these commands in the Asterisk directory, I assume (*danger*) you mean the /etc/Asterisk/ directory? Also, after I make it crash & get the backtraces I can then run make clean & make and everything will be back as it was before? Do I understand correctly? Thanks for taking the time to explain this to me...

As mentioned before, if access to the box will help I'll gladly arrange it. I just need to get this fixed for my client!

Please let me know anything else I can do to help. Thanks for your assistance...we're eager to get this fixed, and I'm glad I can help in the process and contribute back to the community.


By: Joshua C. Colp (jcolp) 2006-09-21 17:51:27

Access would be great, drop me a line - jcolp@digium.com

By: Serge Vecher (serge-v) 2006-09-22 10:39:39

csum77: how are you doing with live production testing here of file's patches?

By: aster1 (aster1) 2006-09-22 13:30:25

I have same problem with .. how do i apply respective patch ? plz help me in this . thx

By: Joshua C. Colp (jcolp) 2006-09-22 17:02:12

Should be fixed as of revision 43509 in the 1.2 branch. You can either wait until the next 1.2 release, or check out the 1.2 branch. If this does turn up to still be an issue - please reopen! Thanks.

By: jojo (jojo) 2006-10-03 10:34:12

any idea when the next release date will be, or perhaps a pointer as where to find and how to apply the patch? we are still operating on work-arounds re chanspy (operators have to notify me before they hang up so i can check they are spying an extension and not a provider)



By: aster1 (aster1) 2006-10-03 11:14:53

UPgrade to latest svn version .. everything is fixed in it and upgrade is very easy .

# svn checkout http://svn.digium.com/svn/asterisk/branches/1.2 asterisk-1.2
# svn checkout http://svn.digium.com/svn/zaptel/branches/1.2 zaptel-1.2
# svn checkout http://svn.digium.com/svn/libpri/branches/1.2 libpri-1.2

# cd zaptel-1.2
# make clean; make install
# cd ../libpri-1.2
# make clean; make install
# cd ../asterisk-1.2
# make clean; make install

By: Serge Vecher (serge-v) 2006-10-03 12:06:18

aster1: thanks for the instructions!
jojo: please don't reopen bugs to ask questions like that -- this is an RTFM or #asterisk/asterisk-users question.