/* DESC: This script will send an SMS to the specified phone number. * Copyright (C) 2012 NetModule AG, Switzerland */ void usage() { printf("usage: send-sms.are <phone> <msg>\n"); exit(1); } if (argc < 3) { usage(); } phone = argv[1]; msg = ""; for (i = 2; i <= argc; i++) { msg = strcat(msg, " ", argv[i]); } id = nb_sms_send(phone, msg); if (id) { printf("SMS to %s (ID %s) has been spooled\n", phone, id); } else { printf("Unable to send SMS to %s\n", phone); } exit(0);