A drunken passenger who tried to rob a taxi driver was jailed after he was trapped by an in-cab audio recording of the bungled attack.
The driver had warned Craig Short, 28, that he was being recorded when he demanded his takings while stating that he had a knife.
Short , who had served a six-year sentence for previous robberies, was also caught on area CCTV cameras when he fled empty-handed in Hartlepool.
Prosecutor Rachel Masters told Teesside Crown Court that he confessed "I might as well admit it" when he was played the audio recording.
The taxi picked him up at 1am in Wynyard Road, Hartlepool, on July 24 and he sat behind the driver.
A short time into the journey, Short was recorded saying "stop the car" and he grabbed the driver's neck and left shoulder.
Short said: "I've got a knife, I want all your money."
The driver tried to drag Short's hands off him and Short responded:"I'm strong, you know".
The cabbie warned him that it was being audio-recorded and he put the taxi into gear and drove away just as Short escaped through a passenger door.
Miss Masters said that the driver was left shocked but he had managed to foil Short's robbery attempt.
Stephen Constantine, defending Short, who appeared over a videolink from Durham Jail, said that the 2011 robbery sentence left an inevitable outcome.
He said that Short had managed to remain drugs free on his release in 2014, formed a relationship and had an 18 months-old daughter before it ended in a break-up.
Mr Constantine said that Short was drunk when he tried to rob the taxi driver but had since resumed contact with his partner and they hoped to build a future together.
The judge told him that it was a pity that he had committed another serious offence after staying out of trouble for so long.
Judge Tony Briggs said: "There has to be an immediate custodial sentence bearing in mind that this was a taxi driver performing a public service who was attacked in his vehicle and suffered a shocking experience."
Short, of Stonethwaite Close, off Powlett Road, Hartlepool, was jailed for two years and three months after the pleaded guilty to attempted robbery.