Archive for May, 2009

Manual de Asterisk

Thursday, May 21st, 2009

Solo quiero publicar un manual de Asterisk que escribi hace muchos años, los conceptos siguen siendo los mismos y las configuraciones también, tal vez uno que otro comando cambio de nombre. Habia perdido el manual pero recientemente alguien en el MSN me pregunto por el manual y luego lo encontramos en el blog de pablasso. Solo cambie el e-mail de contacto, asi que sigue siendo el mismo viejo manual, pero no del todo inútil :P

Manual de Asterisk

Why does Asterisk consume 100% CPU?

Wednesday, May 6th, 2009

I don’t know :)

But people has asked me this a couple of times lately and my answer is always “I don’t know”. However ps can give you more information about it. In fact, this works for any application you have and you want to debug why is going crazy.

First, check which thread (Asterisk is a multi threaded application) is going crazy.

# ps -LlFm -p `pidof asterisk`

That should show you the % of CPU being used by each Asterisk thread in the column named “C”, then write down the LWP colum value for the thread you are interested on. (LWP is a light weight process number, roughly speaking, the thread id). Now that you have the thread id, you need to know what that thread is doing.

# pstack `pidof asterisk` > /tmp/asterisk.stack.txt

That will cause the asterisk process to dump the stack state to the /tmp/asterisk.stack.txt file. If you don’t have the pstack command google for it, I think in CentOS is as easy as yum install pstack.

Then open the file and search for the LWP that you just wrote down. Hopefully you will find some hints that let you know how to avoid it or at least a lot more information to post in bugs.digium.com

UPDATE:
One of the guys who asked this question later told me what he found:

Thread 10 (Thread 0x41d8f940 (LWP 3406)):
#0 0x00000033ce2ca436 in poll () from /lib64/libc.so.6
#1 0x00000000004933c0 in ast_io_wait ()
#2 0x00002aaabd9510cd in network_thread ()
#3 0x00000000004f8b2c in dummy_start ()
#4 0x00000033cee06367 in start_thread () from /lib64/libpthread.so.0
#5 0x00000033ce2d2f7d in clone () from /lib64/libc.so.6

A quick grep -rI “network_thread” in the Asterisk source code reveals this function belongs to chan_iax.c, disabling chan_iax.so in modules.conf is a good workaround to his problem, however further debugging would be needed to determine why the monitor thread is looping like that.

Cluecon 2009

Tuesday, May 5th, 2009

I will be speaking at ClueCon this year. The talk will be about writing FreeSwitch modules and how the development process compares to writing modules for Asterisk in terms of APIs. If you are interested in learning how to write modules for Asterisk and/or Freeswitch, this is your chance!

The full schedule is still being prepared so be sure to check the site later when it’s done.

I could not decide which banner to use here, so I decided to put 3 I really liked :) … if you use any open source telephony application, support developers by attending or at least putting one of these banners on your site.

From the ClueCon site:
ClueCon – is an annual 3-Day Telephony User and Developer Conference bringing together the entire spectrum of Telephony from TDM circuits to VoIP and everything in between. The presentations and discussions will cover several open source telephony applications such as Asterisk/Callweaver, OpenSIPS/Kamailio (formerly OpenSER), Bayonne, YATE and FreeSWITCH. Other great projects that will be discussed include OPAL and Woomera.

More funny banners at: http://files.freeswitch.org/cluecon_2009/