Invia SMS: Optimization theory and applications