Orientations of dipoles restricted by two oppositely charged walls