Green’s Dictionary of Slang

dummy n.3

[its silence or its use for sucking on]

[mid-19C+] the penis.

In phrases

beat one’s/the dummy (v.) (also cuff one’s/the dummy, flog one’s dummy, whip...)

[1930s+] to masturbate; thus dummy flogger n., a masturbator.