Welcome, Guest. Please login or register.

Author Topic: SMS sending  (Read 2734 times)

pc_sg

  • Full Member
  • ***
  • Posts: 245
    • View Profile
SMS sending
« on: April 13, 2012, 12:20:10 PM »
Hi Remo,
how can I handle SMS sending if we have a dedicated SMTP server that do this job (with a particular mail syntax) ?
I mean that we have two separate "mail SMTP server" and "SMS SMTP server".

Even not very clear for me, I've seen that you use Gammu, but our "SMS system" is another, rather different thing (a serial port SMS sender connected to a dedicated server, not managed by me at all)

Thanks in advance!

Paolo

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2510
    • View Profile
    • NeDi
Re: SMS sending
« Reply #1 on: April 16, 2012, 06:38:36 PM »
The relevant code is in libmon.pm function AlertFlush(). Starting at line 222, you'll see different options for sending SMS, since it's a very broad topic as you noticed...

NeDiO7 supports hooking up pretty much any Gammu compatible phone, but they do recommend using a GSM modem. I need to do some more testing, but Sony-Ericsson is well supported and Samsung looks promising too. Not sure how stable this setup is in the long term though...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

pc_sg

  • Full Member
  • ***
  • Posts: 245
    • View Profile
Re: SMS sending
« Reply #2 on: April 18, 2012, 09:07:22 AM »
Thanks Remo, but I'm not skilled enough to add a SMTP send routine to handle SMS sends in our way. I can't use our SMS sender attaching it to NeDi (that is a VM, so serial handling is curretly impossible).
So I need another distinguished SMTP send to another SMTP server, with an easy syntax (phonenumber@SMSmaildomain as destination, and SMS text  as message text contents)

Thanks anyway!

Paolo

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2510
    • View Profile
    • NeDi
Re: SMS sending
« Reply #3 on: April 20, 2012, 09:43:39 PM »
Why don't you give it a try? Simply copy the SMTP part into the SMS part and adjust it like this:

Code: [Select]
if($main::usr{$u}{sms}){
$smtp->mail($misc::mailfrom) || &ErrSMTP($smtp,"From");
$smtp->to("sms.gw.net") || &ErrSMTP($smtp,"To");
$smtp->data();
$smtp->datasend("To:Mobile#\n");
$smtp->datasend("From: $misc::mailfrom\n");
$smtp->datasend("Subject: $sub\n");
#$smtp->datasend("MIME-Version: 1.0\n"); # Some need it, Exchange doesn't?
$smtp->datasend("\n");
$smtp->datasend("$main::usr{$u}{sms}\n");
$smtp->dataend() || &ErrSMTP($smtp,"End");
$main::usr{$u}{sms} = "";
}

Again, if this is of general interest, I can make it "more official"  ;)
« Last Edit: April 20, 2012, 09:45:22 PM by rickli »
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

pc_sg

  • Full Member
  • ***
  • Posts: 245
    • View Profile
Re: SMS sending
« Reply #4 on: April 23, 2012, 11:34:27 AM »
Hi Remo!
Thanks, but I beg your pardon, I'm not so confident to do it in this moment (a lot of troubles caused by a big company reorganization and other issues...)
If this become of "general interest" for others I'll wait a possible update from you, else I'll try to do it by myself in the future.

Really sorry!

Paolo

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2510
    • View Profile
    • NeDi
Re: SMS sending
« Reply #5 on: April 23, 2012, 07:37:26 PM »
Np, I put the commented code in libmon.pm for easy customization...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo