Monday, October 26, 2009

utils.c broken pipe error - Asterisk or Application error? Fix

I had debated myself whether it could be asterisk or application error. I'm trying to write something to the receiver and the receiver already closed my acceptance.

Should I need to produce an error or not?

To sort this problem if you have certain delay (like sleep or usleep to .5 secs) to receive the data from Asterisk you are fine. Any scripts or remote manager sockets calling this need to wait for the same to get this error go away.

sleep(.5); // or if it can take only integers you can have sleep(1);
Make sure you consider this time when handling call.

Alternatively if you want to get the error to ignore, you can edit utils.c and comment the line producing this error. Also keep in mind when you have errors with file or socket, it will get ignored.

Hope it helps !

Wednesday, October 14, 2009

Unique BootID in Linux

# cat /proc/sys/kernel/random/boot_id
91cbd9c4-8a68-4d14-8193-8486417410d1

Gives you the random unique boot for every boot. If you application would like to see whether you system has rebooted or not, you can check with this value.

Hope it helps.

UUID LIBUUID GUID in linux

Generating UUID in linux is much easier than having an user space app to create it.
It is patched to the latest kernel of linux.

Try,

cat /proc/sys/kernel/random/uuid
d9083201-9574-4ea2-a4fc-9b8ebf9a44e4

on your linux machine. You will get randomly generated number.

Hope it helps.