Open yuric opened 11 years ago
I dont feel like re implementing the whole SMS module from scratch... Maybe it makes sense if yours doesn't accomplish something...
But if is not the case, i could just grab the old one.
https://gist.github.com/yuric/5777506
Sure. The main points of improvement on these are logging errors/failures/succeses. It does not log well from Tropo specially. The second is making sure the logic with SMS reply and calls. I never got around to implementing a robust reply system (when parents reply to sms should go to originators'/teacher's phone/email etc).
Right now I have a call module and an SMS module that I import into the resource(i.e. broadcast). None of the resource models actually handles SMS/Call delivery themselves. This works well. I also use Twilio and Tropo to deliver SMS and make calls. They both have their advantages and it is good to have some redundance if one fails the other picks it up. Twilio is the primary for US and Tropo for international.
These call/sms modules only handle the message delivery/errors. All the counters etc are handled in the resource models themselves.
One key difference I want to implement on this new approach is to have a "school phone numbers" resource. Initially each school will have one phone number but eventually large schools might have multiple numbers. Maybe even a number per teacher. This is also helpful for us to properly implement the reply logic for attendance and Broadcast.