Проблема в следующем: смс не всегда посылается. ниже приведенный код отсылает смс, но не всегда и я никак нимогу понять в чем ошибка. Может можно как то прочитать что отвечает GSM модем??? | Код | <% Sub Delay(DelaySeconds) SecCount = 0 Sec2 = 0 While SecCount < DelaySeconds + 1 Sec1 = Second(Time()) If Sec1 <> Sec2 Then Sec2 = Second(Time()) SecCount = SecCount + 1 End If Wend End Sub %> <%
Dim MSComm1,strReceived, buffer
Set MSComm1=Server.CreateObject("MSCOMMLib.MSComm") MSComm1.InBufferCount = 0 If MSComm1.PortOpen = True Then MSComm1.PortOpen = False MSComm1.Settings = "9600,n,8,1" MSComm1.CommPort = 3 MSComm1.RThreshold = 1 MSComm1.SThreshold = 1 MSComm1.InputLen = 0
MSComm1.PortOpen = Not MSComm1.PortOpen
If MSComm1.PortOpen Then
' response.write "Comm. Port " & MSComm1.CommPort & " Settings: " & MSComm1.Settings ' response.write MSComm1.Input Else response.write "Comport Problem " End If
MSComm1.Output = "AT" & Chr(13) & Chr(10) Delay(0.1) MSComm1.Output = "AT+CMGF=1" & Chr(13) & Chr(10) Delay(0.1) MSComm1.Output = "AT+CMGS=" & Chr(34) & numeris & Chr(34) & Chr(13) & Chr(10) 'phone number' Delay(0.1) MSComm1.Output = textas & Chr(26) Delay(1) MSComm1.PortOpen = False response.Write ("SMS vyslan") %>
|
|