This doesn't directly answer your question, but there's a nice SMS interface framework available for Django called RapidSMS[0]. It's been a few years since I've played with it, and never got around to testing "in the wild" / with a real phone, but, it makes the Request/Response <-> SMS gateway mapping pretty easy to navigate