Solved

code for sms using GSM MODEM

Posted on 2004-04-30
6
2,049 Views
Last Modified: 2013-12-09
can u provide me the code for sending sms from pc to mobile using GSM modem?
0
Comment
Question by:pritibang
  • 3
6 Comments
 
LVL 2

Accepted Solution

by:
anupvijay earned 63 total points
ID: 10957010
pritibang,
Which programming language are you using ?

Assuming that it is VB here is link from a mailing list that might help you.

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=39c0b8fd%240%242390%40reader5&rnum=2&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3DSend%2BSMS%2Bcode

Cheers.
0
 
LVL 5

Expert Comment

by:amit1978
ID: 10985272
Hi,

What technology (Vb,C....)u r using to send and receive message and type of GSM (Nokia, Sime...)

Amit
0
 
LVL 5

Assisted Solution

by:amit1978
amit1978 earned 62 total points
ID: 10985282
Assumin ur using VB and MSComm control for send and receive SMS.

Thru this code u can send the SMS thru GSM modem. here i am posting the code check this out:

Code to send SMS:
~~~~~~~~~~~~~~

Private Sub SendMsg(strMsg As String, Number$)
    Dim DialString$, FromModem$, dummy

    ' AT is the Hayes compatible ATTENTION command and is required to send commands to the modem.
    ' DT means "Dial Tone." The Dial command uses touch tones, as opposed to pulse (DP = Dial Pulse).
    ' Numbers$ is the phone number being dialed.
    ' A semicolon tells the modem to return to command mode after dialing (important).
    ' A carriage return, vbCr, is required when sending commands to the modem.
    ' box is ctrl+z command

    DialString$ = "AT+CMGS=" & Chr(34) & Number$ & Chr(34) & ",145" & vbCr & strMsg & "" & Chr(27)
   
  'explain later
    Call fnOpenPort
   
   
    ' Flush the input buffer.
    MSComm1.InBufferCount = 0
    Command3.Enabled = False
    Command4.Enabled = True
   
   
    MSComm1.Output = "AT+CMGF=1" & Chr$(13) & Chr(10) 'ok meaage is returened
   
    WaitMs 15000
   
    ' Dial the number.
    MSComm1.Output = DialString$
   
    WaitMs 15000
   
    MSComm1.PortOpen = False
   
    ' Disconnect the modem.
    'MSComm1.Output = "ATH" + vbCr
   
    ' Close the port.
    'MSComm1.PortOpen = False
End Sub

Private Function fnOpenPort()
  MSComm1.CommPort = 2
  MSComm1.Settings = "9600,N,8,1"
  MSComm1.Handshaking = 2
 
  On Error Resume Next
 
  ' Communications port settings.
  ' Assuming mouse is attached to COM1, GSM MODAM is set to 2
  ' Open the communications port.
 
  MSComm1.PortOpen = True
  If Err Then
     MsgBox "COM2: not available. Change the CommPort property to another port."
     Exit Function
  End If
 
End Function
0
 
LVL 5

Expert Comment

by:amit1978
ID: 10985287
this code will help u to send sms with the help of VB and MSComm control.

Amit
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

In this article I will describe how to setup a Cisco WLC 5508 to work with Apple's Bonjour protocol across VLANs.  I will also discuss using screen mirroring and Airplay on an AppleTV v3.  This article covers the wireless network only and requires m…
This subject  of securing wireless devices conjures up visions of your PC or mobile phone connecting to the Internet through some hotspot at Starbucks. But it is so much more than that. Let’s look at the facts: devices#sthash.eoFY7dic.
This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now