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 !

No comments: