When you get into a phone call in iOS, your iPhone will automatically dim the display for you when you put the iPhone close to your face because the proximity sensor detects when the iPhone is close to something.
While the feature is nice, it’s not exactly perfect. A new jailbreak tweak called DimInCall by iOS developer snakeninny makes it so the iPhone display dims during a call no matter what, whether the iPhone is close to your face or not. This guarantees that you don't accidentally touch any buttons in the phone interface when the proximity sensor fails to detect when the iPhone is close to your face.
In the event that you want to see the display in the middle of a call to access certain controls, you can press the sleep button or the home button to light the screen up manually.
DimInCall comes with a preferences pane in the Settings application where you can configure a few options:
Most importantly, you can enable and disable the tweak on demand. In addition, the tweak lets you dim the display whenever the iPhone's microphone is in use during a call, dim the display whenever you're in a speaker phone call, dim the display whenever you're in a headphone phone call, or have the iPhone vibrate whenever your call connects since you won't be able to see it on the display because it's dimmed.
DimInCall is a nice way to avoid unwanted mistakes. If you're interested in giving the tweak a try, it's available in Cydia's BigBoss repository for $1.99. The tweak is compatible with iOS 5 and later.