[icq-devel] ICQ SMS



icq2000cc icq2000cc at hobi.ru
Mon Jun 24 19:51:00 CEST 2002


Hello Yong,
Monday, June 24, 2002, 2:52:59 PM, you wrote:
YM> Anyone know what is the code to send ICQ SMS?

(****************************************************************)
procedure SendSMS(PhoneTo,SMSBody,NickFrom:string;
          UINFrom:longint;Cookie:word);
var p,a,b : PPack;
begin
     a := PacketNew;
     PacketGoto(a,2);
     PacketAppend32(a,UIN);
     PacketAppend16(a,swap($D007));
     PacketAppend16(a,swap(Cookie));
     PacketAppend16(a,swap($8214));
     PacketAppend32(a,dswap($00010016));
     PacketAppend32(a,0);
     PacketAppend32(a,0);
     PacketAppend32(a,0);
     PacketAppend32(a,0);
     PacketAppend16(a,0); // 18 zeros

     b := PacketNew;
     PacketGoto(b,2);
     PacketAppendStringBody(b,'<icq_sms_message>');
     PacketAppendStringBody(b,'<destination>'+PhoneTo+'</destination>');
     PacketAppendStringBody(b,'<text>'+SMSBody+'</text>');
     PacketAppendStringBody(b,'<codepage>1251</codepage>');
     PacketAppendStringBody(b,'<encoding>utf8</encoding>');
     PacketAppendStringBody(b,'<senders_UIN>'+inttostr(UINFrom)+'</senders_UIN>');
     PacketAppendStringBody(b,'<senders_name>'+NickFrom+'</senders_name>');
     PacketAppendStringBody(b,'<delivery_receipt>Yes</delivery_receipt>');
     PacketAppendStringBody(b,'<time>Fri, 14 Jun 2002 04:27:58 GMT</time>');
     PacketAppendStringBody(b,'</icq_sms_message>'+#0);
     PacketBegin(b);
     PacketAppend16(b,swap(b.length-2));

     PacketAppend(a, at b.data,b.length);
     PacketDelete(b);

     PacketBegin(a);
     PacketAppend16(a,a.length-2);

     P:=CreatePacket(2,SEQ);
     SNACAppend(p,$15,$2);
     TLVAppend(p,1,a.length, at a.data);
     PacketDelete(a);
     PacketSend(p);
     Debug('>Send SMS from:'+s(UINFrom)+'   To:'+phoneTo+'  '+
           'Cookie:$'+inttohex(Cookie,4));
end;


-- 
Best regards,
 icq2000cc                            mailto:icq2000cc at hobi.ru





More information about the icq-devel mailing list