• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 
April 19, 2024, 03:44:33 am

News:

SMF - Just Installed!


How to received then Send SMS

Started by Matt, November 28, 2013, 08:12:57 am

Previous topic - Next topic

Matt

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

November 30, 2013, 03:13:39 pm #1 Last Edit: November 30, 2013, 03:28:01 pm by Matt
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.




chinachengxinyong

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

Quote from: chinachengxinyong on December 02, 2013, 11:32:26 am
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