The eventhandler is a program or script, that smsd runs, whenever it receives or sent a message or when it was not able to send a message.
Smsd calls the script before it moves the file from the provider queue into the failed or sent queue.
Smsd gives two or three arguments to the eventhandler. The first one is SENT, RECEIVED, FAILED or REPORT. The second one is the SMS file filename. The third argument is the message id of the SENT message, it is only used if you sent a message successfully with status report enabled.
There is an example script in scipts/smsevent.
If you use UTF-8 character set as a locale, you might want to use eventhandler to convert received messages from ISO character set (which is internally used by the smsd) to UTF-8. See scripts/eventhandler-utf-8 for details. Also you can use the checkhandler to convert outgoing messages from UTF-8 to ISO, see scripts/checkhandler-utf-8 for code sample.
The book describes how to use eventhandler to do different things automatically, like forwarding to eMail, storing received messages and status report into SQL database, running a self-test, publishing received messages with a webserver and more.