Telephone Exchange, State Transition Diagram.

State Transitions diagram
Red and blue: the main (normal) transitions: a, b, c, d and e.
Black: other transitions.

State Transition Event causing it Actions to do on transition
a A becomes off hook Switch on dialtone
b 3 secs elapsed since state a was entered - Stop dialtone
- Start ringing B
c B becomes off hook (answers the call) - Stop ringing B
- Make connection between A and B
d A is on hook again Break the connection between A and B
e B is on hook again --
f A is on hook again Stop dialtone
g A is on hook again Stop ringing B
h B becomes off hook (answers the call already) - Stop dialtone
- Make connection between A and B
i A is off hook again Make connection between A and B
a B becomes off hook Switch on dialtone
b 3 secs elapsed since state a was entered - Stop dialtone
- Start ringing A
c A becomes off hook (answers the call) - Stop ringing A
- Make connection between A and B
d B is on hook again Break the connection between A and B
e A is on hook again --
f B is on hook again Stop dialtone
g B is on hook again Stop ringing A
h A becomes off hook (answers the call already) - Stop dialtone
- Make connection between A and B
i B is off hook again Make connection between A and B

-------------------------------------------