Author Topic: How to received then Send SMS  (Read 1146 times)

Matt

  • Newbie
  • *
  • Posts: 6
    • View Profile
How to received then Send SMS
« on: November 28, 2013, 10:12:57 am »
procedure TForm1.nrGsm1SmsReceived(Sender: TObject; aMem: String;
  idSms: Integer; aSms: TnrPduSms);
begin

  if aMem <> ''
    then ListBox1.Items.Add('Sms is received "' + aMem+'",'+ IntToStr(idSms))
    else ListBox1.Items.Add('Sms is received ');

  if aSms <> nil then begin
    if aSms.Report
      then ListBox1.Items.Add(aSms.ReportText)
      else ListBox1.Items.Add('SMS: From: ' + aSms.Phone + ' text: '+ aSms.Text);
  end;

  ListBox1.TopIndex := ListBox1.Count - 1;
  ListBox1.ItemIndex := ListBox1.Count - 1;

  nrGSM1.SmsSend(aSms.Phone,aSms.Text,True);// not sending anything
end;

I have tried the above code, its not sending anything, after receiving some text. Its supposed to received some text and send back the text to sender.

I have not problem receiving only or sending only .
Help much appreciated.

Matt

 

Matt

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: How to received then Send SMS
« Reply #1 on: November 30, 2013, 05:13:39 pm »
Can anyone try to received and send back SMS, if this is working? I really need to find a solution for this. Or maybe its my GSM modem?. But I have no problem, Sending only,

Can someone suggest other Delphi library I can used, if its not possible with nrcommlib.



« Last Edit: November 30, 2013, 05:28:01 pm by Matt »

chinachengxinyong

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: How to received then Send SMS
« Reply #2 on: December 02, 2013, 01:32:26 pm »
hello
you can save the received message(fields:phonenumber,messagecontent,...) to memerytable and use another thread to read the memorytable and send message back!
 --from china.

Matt

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: How to received then Send SMS
« Reply #3 on: January 02, 2014, 01:19:31 pm »
hello
you can save the received message(fields:phonenumber,messagecontent,...) to memerytable and use another thread to read the memorytable and send message back!
 --from china.

Yes, I have success sending it on another thread like this, don't have to do any memory table just send the text straight

TThread.Queue(nil,
            procedure
              begin
                SendSMS(SendTo,SMSMSG  );
              end
            );

chinachengxinyong

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: How to received then Send SMS
« Reply #4 on: January 03, 2014, 05:23:30 pm »
 :)you are right´╝ü