Author Topic: GSM onGSMError - Error ID  (Read 794 times)

heo899

  • Newbie
  • *
  • Posts: 9
    • View Profile
GSM onGSMError - Error ID
« on: November 26, 2012, 12:17:13 pm »
I want to send a large number of sms using Modem pool 8 port.
I have the phone no. list in my database,  and  after sending i want to record which sms is sent and which sms is failed
at every sending sms, ref id is recorded to my db on event of onGSMError & onSmsSent.
sometimes an error from somewhere else not from sending sms occured.
is there any difference of the error id of sending sms  from another errors...??

thanks

heo899

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: GSM onGSMError - Error ID
« Reply #1 on: November 27, 2012, 03:50:47 am »
procedure TForm1.btnMassSendClick(Sender: TObject);
var i : integer;
     s : String;
begin
  LoopBreak := False;
  Application.ProcessMessages;
  for i := 1 to 1000 do begin
    if LoopBreak then Break;
    s :='0';
    s := nrGSm1.SmsSendWaitRefID(qry.FieldByName('NoTelp').AsString, Memo1.Text, false);
    with qry do begin
      if s='' then begin
         ListBox1.Items.Add('Error: ' + FieldByName('NoTelp').AsString); // + sData);
         ListBox1.TopIndex := ListBox1.Count - 1;
         ListBox1.ItemIndex := ListBox1.Count - 1;
         Edit;
         FieldByName('sent').AsString:='Err';
         Post;
         Next;
      end
      else begin
         ListBox1.Items.Add('OK: ' + qry.FieldByName('NoTelp').AsString);
         ListBox1.TopIndex := ListBox1.Count - 1;
         ListBox1.ItemIndex := ListBox1.Count - 1;
         Edit;
         FieldByName('sent').AsString:=S;
         Post;
      end;
      Next;
    end;


above is the delphi code for one modem,
in order to avoid error recording from the event onGsmError,  without using events onGsmError & onSmsSent,
s(ref id) is sometimes 1...256,  sometimes all the '0'  or all the '1' or all the '10' or '28' or '34'

Why the ref id of SmsSendWaitRefID is sometimes all the same no., sometimes from 1 to 256...?
if sending failure,  ref id always is '' ...??