Asterisk restarting now and then - calls get lost

Asterisk 1.2.26.2 using a SIP provider and g729a codec. Once or twice a week Asterisk will die then restart itself. All active calls get dropped. The last lines in /var/log/asterisk/messages before the last restart were

Feb 18 14:07:19 NOTICE[28021] app_dial.c: Unable to create channel of type ‘SIP’ (cause 3 - No route to destinati
on)
Feb 18 14:07:21 WARNING[11859] channel.c: Avoided initial deadlock for ‘0x81c2508’, 9 retries!
Feb 18 14:07:42 NOTICE[28093] app_dial.c: Unable to create channel of type ‘SIP’ (cause 3 - No route to destinati
on)
Feb 18 14:07:42 NOTICE[28106] app_dial.c: Unable to create channel of type ‘SIP’ (cause 3 - No route to destinati
on)
Feb 18 14:09:05 WARNING[27960] interface.c: Junk at the beginning of frame 49443303
Feb 18 14:09:41 WARNING[27960] interface.c: Junk at the beginning of frame 49443303
Feb 18 14:09:50 NOTICE[28164] app_dial.c: Unable to create channel of type ‘SIP’ (cause 3 - No route to destinati
on)
Feb 18 14:09:50 NOTICE[28179] app_dial.c: Unable to create channel of type ‘SIP’ (cause 3 - No route to destinati
on)

Can anyone suggest a way to diagnose/cure this annoying behavior?

Compile asterisk with debugging support, then run with command options “-pigT -c” to get a core file. Connect to get a backtrace with gdb and paste that here – the last few lines will reveal the problem.

Thanks for the info.

This part I understand and can do:

This part however I don’t quite understand:

Can you explain a bit ore or point to some docs?

After some reading, I was able to do a bt on the most recent core dump. The last few lines are:

Core was generated by `/usr/sbin/asterisk -f -vvvg -c'. Program terminated with signal 11, Segmentation fault. #0 0xb7011c81 in ?? () from /usr/lib/asterisk/modules/format_mp3.so (gdb) bt #0 0xb7011c81 in ?? () from /usr/lib/asterisk/modules/format_mp3.so #1 0x00000054 in ?? () #2 0x00000003 in ?? () #3 0x00000055 in ?? () #4 0x00000000 in ?? ()

Am I correct to assume the crash had something to do with the playing of an mp3, perhaps from MOH ? And if yes, how might I resolve this? I did download some free mp3 files for my MOH - maybe there’s something funny about one or more of them and I should stick to the boring stock MOH music?

As a test you could always remove the ones you downloaded. If Asterisk stays happy for a while you know for sure thats the issue. If so you should add one file at a time wait a week or two and then add another one. As soon as it crashes remove the last file added, and see what happens.

Please also consider compiling Asterisk with no optimizations so you can get an exact line number (instead of ?? marks). This will help for filing a bug report at http://bugs.digium.com, along with providing one of the “bad” MP3s in question.

As another work around, you could convert the MP3 to wav using mpg123, then repack it into a new MP3 with lame.

Thanks for the replies. I’ve gone back to the boring stock MOH files and so far so good. If I see this behavior again I will proceed as you suggest.