Custom event

Hello!
Tell me how can I make my events? I want to make an event similar to “hangup”.