• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 
April 25, 2024, 11:43:47 pm

News:

SMF - Just Installed!


GSM onGSMError - Error ID

Started by heo899, November 26, 2012, 10:17:13 am

Previous topic - Next topic

heo899

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

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 '' ...??