Sample Code
Here is some Visual Basic sample code to demonstrate how
the GSM SDK can be used to send a WAP Push message
to deliver a polyphonic ringtone using a GSM modem:
Dim objServiceIndication As New
ServiceIndicationMessage
Dim objPDU As WAPPDU
Dim sSessionID As String
' Define the destination address
objServiceIndication.DestinationAddress = ""
' Specify a medium level signal for
SI
objServiceIndication.Action = si_SignalMedium
' The text that will appear on the
handset
objServiceIndication.MessageText = txtMessage.Text
' The location for the phone to retrieve
the image
objServiceIndication.URI = txtURL.Text
' A unique identifier for this Service
Indication message
objServiceIndication.Identifier = Format(Now, "yyyymmddhhmmss")
' Create the PDUs
objServiceIndication.GeneratePDU
'Iterate through PDUs collection to
send
For Each objPDU In objServiceIndication.PDUs
lResult = MessageMaster1.MessageSend(0,
_
Service.Text,
Number.Text, "", Now(), "128", _
objPDU.UserData)
Next