The absurdly contrived dopey melodrama “The Ledge” gives us Charlie Hunnam (“Sons of Anarchy”) doing a dismal attempt at an American accent (you can hear him chewing the syllables over) who, at the start, climbs up to the top of a tall building and waits on the ledge. In an hour or so — at noon exactly — he will jump. Maybe.

But a kindly detective (Terrence Howard, a terrifically annoying actor who is nonetheless among the least annoying things about this film) sticks his head out the window and starts to talk him down. For a guy who has an hour to live, Hunnam is suprisingly chatty and cheerfully tells Howard the ridiculous story that sent him up here. Meanwhile, Howard is in kind of a bad mood — he just found out he has been sterile from birth. Yet his wife has presented him with two children. Oops. She was kind enough to cheat on him with his brother so the kids would look like him, though. So no problem there.

Hunnam is a hotel manager who showed up for work one day and found that Liv Tyler, who plays a college student (!) and wants a job as a cleaning lady (!!) despite being married to an upper-middle class manager (!!!) who met her after she turned a trick in a church and woke up with a beating (!!!!), is about to become his latest employee. Yes, lots of cleaning ladies look like Liv Tyler. Her husband (the talented Patrick Wilson, who desperately needs to bust loose of playing khaki-wearing Middle America dorks) is a Christian fundamentalist extremist freak, the kind of guy who invites gay men he doesn’t know to his home (!!!!!) so he can tell them he’s praying for them to change their wicked ways. Also, despite the massive flirtation between his wife and the atheist hotel manager, whom he has every reason to loathe, he keeps inviting the Hunnam character over to talk about religion.

The chatter between the Hunnam and Tyler characters is accompanied by woeful dialogue that sounds like it was written by someone who has never experienced or seen actual flirtation. In their very first lunch together, after she rips the top off a beer bottle with her teeth, he says, “Note to self: Decline [oral sex] if offered.” Ewww.

The movie — the kind of thing in which, 30 seconds after we notice there is a cross on Wilson’s wall, he starts talking like a nutjob — clumsily works its twin themes of gay tolerance and atheism into a plot that wouldn’t pass muster with the producers of the worst soap on TV. Hunnam could simply tell the detective why he is on the ledge instead of delivering his life story and the movie would be over in 30 seconds. I really wish he had.