A sheriff has warned a man he was ‘lucky’ to escape a prison sentence after he admitted violently threatening another during a phone call.