Listing 1

lws_phoneservice.NotifyPhoneBasic(ls_NumberToDial, ls_TextToSay, ls_CallerID, ls_CallerIDName, ls_VoiceID, ls_LicenseKey)


//phone notify service
p_phonenotify lws_phoneservice

//Soap connection
SoapConnection sc

//buffers
String	ls_NumberToDial, ls_TextToSay, ls_CallerID
String  ls_CallerIDName, ls_VoiceID,  ls_LicenseKey

//retval
Integer	li_RetVal

//save data
dw_entry.AcceptText()

//grab data
ls_NumberToDial = dw_entry.GetItemString(1, 'NumberToDial')
ls_TextToSay = dw_entry.GetItemString(1, 'TextToSay')
ls_CallerID = dw_entry.GetItemString(1, 'CallerID')
ls_CallerIDName = dw_entry.GetItemString(1, 'CallerIDName')
ls_VoiceID = '4'
ls_LicenseKey = '[your access key]'

//check mandatory entry fields
If isNull(ls_NumberToDial) Then
	MessageBox(is_ModuleName, &
'You must supply a phone number to dial', &
Exclamation!)
	Return -1
End If

If isNull(ls_TextToSay) Then
	MessageBox(is_ModuleName, &
'You must supply a message to be spoken', &
Exclamation!)
	Return -1
End If

If isNull(ls_CallerID) Then
	MessageBox(is_ModuleName, &
'You must supply your own phone number for caller ID purposes', &
Exclamation!)
	Return -1
End If

If isNull(ls_CallerIDName) Then
	MessageBox(is_ModuleName, &
'You must supply your name for caller ID purposes', &
Exclamation!)
	Return -1
End If

//confirm
li_RetVal = MessageBox(is_ModuleName, &
'Transmit message to ' + ls_NumberToDial,  &
Question!, &
YesNoCancel!)
If li_RetVal <> 1 Then
	Return -1
End If

//create our connection
sc = CREATE SoapConnection
sc.CreateInstance(lws_phoneservice, "p_phonenotify")
SetPointer(HourGlass!)

//make the call
lws_phoneservice.NotifyPhoneBasic(ls_NumberToDial, ls_TextToSay, &
ls_CallerID, ls_CallerIDName, ls_VoiceID, ls_LicenseKey)

//here...success
Return 1


Listing 2

//authentication
p_licenseinfo licenseinfo
p_registereduser registereduser
p_unregistereduser unregistereduser

//phone notify service
p_smstextmessaging lws_textmsgservice

//Soap connection
SoapConnection sc

//buffers
String	 ls_ToNumber, ls_FromNumber, ls_FromName, ls_Text

//retval
Integer	li_RetVal

//save data
dw_entry.AcceptText()

//grab data
ls_ToNumber = dw_entry.GetItemString(1, 'NumberToDial')
ls_FromNumber = dw_entry.GetItemString(1, 'CallerID')
ls_FromName = dw_entry.GetItemString(1, 'CallerIDName')
ls_Text	= dw_entry.GetItemString(1, 'TextToSay')

//check mandatory entry fields
If isNull(ls_ToNumber) Then
	MessageBox(is_ModuleName, &
'You must supply a phone number to dial', &
Exclamation!)
	Return -1
End If

If isNull(ls_Text) Then
	MessageBox(is_ModuleName, &
'You must supply a message to be sent', &
Exclamation!)
	Return -1
End If

If isNull(ls_FromNumber) Then
	MessageBox(is_ModuleName, &
'You must supply your own number for caller ID purposes', &
Exclamation!)
	Return -1
End If

If isNull(ls_FromName) Then
	MessageBox(is_ModuleName, &
'You must supply your name for caller ID purposes', &
Exclamation!)
	Return -1
End If

	
//confirm
li_RetVal = MessageBox(is_ModuleName, &
'Transmit message to ' + ls_ToNumber,  &
Question!, &
YesNoCancel!)
If li_RetVal <> 1 Then
	Return -1
End If

//create our connection
sc = CREATE SoapConnection
sc.CreateInstance(lws_textmsgservice, "p_smstextmessaging")

//set authentication
registereduser.userid = '[your user id]'
registereduser.password = '[your password]'

unregistereduser.emailaddress = ''

licenseinfo.didunderstand = False
licenseinfo.mustunderstand = False
licenseinfo.relay = False

licenseinfo.registereduser = registereduser
licenseinfo.unregistereduser = unregistereduser

licenseinfo.actor = ''
licenseinfo.encodedmustunderstand = '0'
licenseinfo.encodedmustunderstand12 = '0'
licenseinfo.encodedrelay = '0'
licenseinfo.role = ''

lws_textmsgservice.setlicenseinfovalue(licenseinfo)

//make the call
SetPointer(HourGlass!)
lws_textmsgservice.SendMessage(ls_ToNumber, ls_FromNumber, ls_FromName, ls_Text)

//here..success
Return 1