Help with sending SMS

Hello everybody,
i'm writing an application for sending SMS through a mobile phone connected to the laptop via a normal COM (mobile phone acts as a modem).
Apparently everything seems ok. Code sends AT commands to phone and gets correct replies but no SMS is sent.
here are some details of the code i wrote:


.......
Call comanda("AT+CMGF=0" & Chr$(13), responso, 1000)
' selects PDU mode for sending SMS. the reply from modem is as follows:
AT+CMGF=0OK

Call comanda("AT+CSMS=0" & Chr$(13), responso, 1000)
' Checks whether the phone is capable of handling SMS. the reply from modem is as follows:
AT+CSMS=0+CSMS:1,1,1OK

standard0 = "001100"
dimensione = "0A"
formato = "81"
numero = "3365343019"
standard1 = "0000AA"
numcaratteri = "0A"
testo = "E8329BFD4697D9EC37"
tutto = standard0 + dimensione + formato + numero + standard1 + numcaratteri + testo + Chr(26)

Call comanda("AT+CMGS=23" + Chr(13), responso, 1000)
'This command tells the MODEM that the SMS will be 23 characters long.
The reply is:
AT*CMGS=23>


Call comanda(tutto + Chr(13), responso, 1000)
' these are the bytes for the outgoing SMS (the variable is formatted according to etsi standards copied frmo the following example:
http://www.dreamfabric.com/sms/ Chapter: Sending a message in the PDU mode
Obviously i adapted the parameters to my needs (my mobile phone number).
The response from the modem is:

0011000A8133653430190000AA0AE8329BFD4697D9EC37OK

Apparently everything is ok but i get no SMS (the mobile number where the SMS is being sent is 3356430391).




---------------------------------------------------------------------
Sub comanda(comando, responso, dilei)
tele.telefono.Output = Chr(27)
Do
DoEvents
u = tele.telefono.Input
Loop Until u = ""
messaggio = comando
tele.telefono.Output = messaggio
Call aspetta(responso, dilei)
End Sub
------------------------------------------------------------
Sub aspetta(bu, dilei)
bu = ""
esci = False
cicli = 0
DoEvents
Sleep dilei
Do
DoEvents
tele.Caption = "Caratteri nel buffer=" + CStr(tele.telefono.InBufferCount)
bu = bu + tele.telefono.Input
If bu <> "" Then esci = True Else cicli = cicli + 1
If cicli = 9999 Then esci = True
Loop Until esci = True
tele.Caption = bu
End Sub
--------------------------------------------------------

Can anybody help ?
Thank you
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories