Communicates with AT-compatible GSM modem/phone via serial/USB port. Sends and receives PDU-encoded SMS (most phones can handle only PDU-encoded ones). Has a simple Web API to controll the state and monitor incoming/outgoing queues. Custom SMS types for recognition can be added very simply (making a subclass and overriding "understands:" message). Not very clean code, needs somebody's experienced eye to review and improve the code. But at least it can run for few hours... Communication with modem uses mutual exclusive semaphore to prevent concurrent access. So you can lock the modem, preventing the send/receive cycle from accessing it, and execute your commands (i.e. make a call, set the modem parameters etc.). Any help will be appreciated.