Handle SIGHUP

Hi,

I got advice to handle or ignore SIGUP, because I want to get CANCEL dialstatus when caller hangup, but I dont know how to do this, can anyone give me advice?

Thank you,
Anya