How does a hook switch work in a telephone?