This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MistroSMSSentReceiver mistroSMSSentReceiver = new MistroSMSSentReceiver(message, noOfParts); | |
context.registerReceiver(mistroSMSSentReceiver, new IntentFilter(ACTION_SMS_SENT)); | |
MistroSMSDeliveredReceiver mistroSMSDeliveredReceiver = new MistroSMSDeliveredReceiver(message, noOfParts); | |
context.registerReceiver(mistroSMSDeliveredReceiver, new IntentFilter(ACTION_SMS_DELIVERED)); | |
if(waitForResponse){//method will be waiting for a response sms from the server | |
MistroSMSReceiver mistroSMSReceiver = new MistroSMSReceiver(); | |
IntentFilter smsReceivedIntentFilter = new IntentFilter(ACTION_SMS_RECEIVED); | |
smsReceivedIntentFilter.addAction("android.provider.Telephony.SMS_RECEIVED"); | |
context.registerReceiver(mistroSMSReceiver, smsReceivedIntentFilter); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SmsManager smsManager = SmsManager.getDefault(); | |
String message = appendedURL+SMS_DELIMITER+jsonString; | |
ArrayList<String> multipartMessage = smsManager.divideMessage(message); | |
int noOfParts = multipartMessage.size(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String sendDataToServer(Context context, String jsonString, String appendedURL, boolean waitForResponse) { | |
String response; | |
if(checkNetworkConnection(context)){ | |
response = sendDataUsingHttpConnection(jsonString, appendedURL); | |
} | |
else{ | |
response = sendDataUsingSMS(context, jsonString, appendedURL, waitForResponse); | |
} | |
return response; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lynx http://127.0.0.1:13013/cgi-bin/sendsms?username=kannel&password=kannel&text=I%20fucking%20love%20bacon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lynx http://127.0.0.1:13000/restart?password=bacon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lynx http://127.0.0.1:13000/status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#group that configures how kannel sends messages to web apps | |
group = sms-service | |
keyword-regex = .* | |
catch-all = yes | |
max-messages = 0 | |
#sms-resend-retry = 0 | |
get-url = "http://localhost/~jason/ngombe_planner/WebServer/php/kannel/sms_router.php?phone=%p&text=%a" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#group that allows web apps to send SMSs using kannel (security) | |
#use http://127.0.0.1:13013/cgi-bin/sendsms?username=kannel&password=kannel&text=inserttexthere | |
group = sendsms-user | |
username = kannel | |
password = kannel | |
concatenation = true | |
max-messages = 1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#group configures kannel module that sends SMSs | |
group = smsbox | |
bearerbox-host = 127.0.0.1 | |
sendsms-port = 13013 | |
global-sender = +254723572302 | |
log-level = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#group configures interfacing | |
group = smsc | |
smsc = at | |
modemtype = auto | |
device = /dev/ttyUSB_utps_pcui | |
my-number = +254723572302 | |
sms-center = +254722500029 | |
connect-allow-ip = 127.0.0.1 | |
log-level = 0 | |
include = /etc/kannel/modems.conf |