How can we help?

Is it possible to check the signal strength before actually sending an SMS message ?


Yes it can be done, by using the ‘SendCommand’ function. The SendCommand function is member function of the Gsm object.
The following sample (VBScript) shows how to achieve this:

Dim objGsm, objSmsMessage, strCmdResponse, strBuffer
Set objGsm = CreateObject("AxSms.Gsm")
Set objSmsMessage = CreateObject("AxSms.Message")
objGsm.LogFile = "log.txt"
' Open the first TAPI device
sDevName = objGsm.FindFirstDevice
Wscript.Echo "Opening: " & sDevName
objGsm.Open sDevName
If objGsm.LastError <> 0 Then
  Wscript.Echo "Error: " & objGsm.GetErrorDescription(objGsm.LastError)
  Wscript.Quit
End If
objSmsMessage.ToAddress = "+31122334455"
objSmsMessage.Body = "Hello, world"
' Query the GSM modem for its signal strength; the output (strCmdResponse) is
' something like "+CSQ: 30,0"
' where 30 indicates the signal strength (0 is lowest strength, 31 is highest), and 0 is
' an error code (0 means: no error)
objGsm.SendCommand "AT+CSQ"
If objGsm.LastError <> 0 Then
  Wscript.Echo "Error: " & objGsm.GetErrorDescription(objGsm.LastError)
  Wscript.Quit
End If
While strBuffer <> "OK"
  strBuffer = objGsm.ReadResponse
  If strBuffer <> "" And strBuffer <> "OK" Then
    strCmdResponse = strCmdResponse & strBuffer
  End If
Wend
' Split up the response and store it in arrCmdResponse;
' arrCmdResponse(0): "+CSQ:";
' arrCmdResponse(1): "30,0"
arrCmdResponse = Split(strCmdResponse)
' Split up the string and store it in arrSignal; arrSignal(0): "30"; arrSignal(1): "1"
arrSignal = Split(arrCmdResponse(1), ",")
' Store Signal strneght [0..31] in numSignal as an Integer value
numSignal = Cint(arrSignal(0))
Wscript.Echo "Signal strength: " & numSignal
' If the signal strength is poor (less than 20) then quit
If numSignal < 20 Then
   Wscript.Echo "Singal strength too low."
   Wscript.Quit
End If
Wscript.Echo "Singal strength ok, send message."
objGsm.SendSms objSmsMessage    ' Send the message
If objGsm.LastError <> 0 Then
  Wscript.Echo "Error: " & objGsm.GetErrorDescription(objGsm.LastError)
  Wscript.Quit
End If
objGsm.Close