The SMS solution I'm testing requires a record to be inserted in a new table (called messageout) that I have already created. The SMS gateway monitors this table and sends the SMS as soon as it finds it (I've manually added records into the table and it works just fine). Before getting into building the actual plugin, I want to test my (simple) code. I have commented (see below) and replaced the callfire related code in SendText, here is how it goes:
Code: Select all
/* MF remove start
string key=ProgramProperties.GetPropVal(ProgramName.CallFire,"Key From CallFire");
string msg=wirelessPhone+","+message.Replace(",","");//ph#,msg Commas in msg cause error.
try {
CallFireService.SMSService callFire=new CallFireService.SMSService();
callFire.sendSMSCampaign(
key,
new string[] { msg },
"Open Dental");
}
catch(Exception ex) {
MsgBox.Show(this,"Error sending text message.\r\n\r\n"+ex.Message);
return false;
}
MF remove end */
// MF add start
string dialPhone = "+1" + wirelessPhone; // +1XXXXXXXXXX format
MsgBox.Show(this, "Wireless rev:" + dialPhone);
string msg = message + " Clinique dentaire B. Fabre XXX-XXX-XXXX";
MsgBox.Show(this, "Wireless rev:" + dialPhone + "\n" + msg);
string command = "INSERT INTO messageout (MessageTo,MessageText"
+ ") VALUES("
+ dialPhone
+ ","
+ msg
+ ")";
Db.NonQ(command, false);
msg = dialPhone + " - " + message;
// MF add end
Thanks.
Mifa