An example of 2 way sms V2 Search Search

Now SMS/MMS Gateway » Now SMS/MMS Gateway - SMS Issues (Product Support Only) » Archive through October 19, 2005 » An example of 2 way sms V2 « Previous Next »

Author Message
Lars Nielsen, MobileNation ApS - Denmark
Member
Username: Larsmservice

Post Number: 247
Registered: 10-2003
Posted on Tuesday, October 04, 2005 - 06:49 pm:   

Found an old page here with an example of how to fetch incoming sms with Wscript.

The code would remove all white spaces which is not the best thing to do.

Try Named Arguments instead:

Put this into your 2-way:
c:\windows\system32\wscript.exe C:\NowSMS\script\test\namedarg.vbs "/sender:@@SENDER@@" "/prefix:@@SMSPREFIX@@" "/message:@@FULLSMS@@" "/recipient:@@RECIP@@"

And in the file: "C:\NowSMS\script\test\namedarg.vbs" put this:
Set argsNamed = WScript.Arguments.Named
LogTxt = "BEGIN:" & vbcrlf
LogTxt = LogTxt & "Sender=" & argsNamed.Item("sender") & vbcrlf
LogTxt = LogTxt & "prefix=" & argsNamed.Item("prefix") & vbcrlf
LogTxt = LogTxt & "message=" & argsNamed.Item("message") & vbcrlf
LogTxt = LogTxt & "recipient=" & argsNamed.Item("recipient") & vbcrlf
LogTxt = LogTxt & "END" & vbcrlf
writelog(LogTxt)
Set argsNamed = nothing



function writelog(logstr)
Dim fsl,flog
Set fsl=CreateObject("Scripting.FileSystemObject")
if Not (fsl.FileExists("C:\NowSMS\script\test\NAMEDTEST.log"))=true Then
Set flog=fsl.CreateTextFile("C:\NowSMS\script\test\NAMEDTEST.log",true)
flog.WriteLine(now() & " " & logstr)
flog.Close
Else
Dim fll
Set fll=fsl.OpenTextFile("C:\NowSMS\script\test\NAMEDTEST.log",8,true)
fll.WriteLine(now() & " " & logstr)
fll.Close
Set fll=Nothing
End if
Set flog=nothing
Set fsl=nothing
End function


Should return something like:
"
5-10-2005 01:15:22 BEGIN:
Sender=+4561304050
prefix=Hello
message=Hello World. How are you ;-)
recipient=28600879
END

"

Search Search Tree View Tree View   Home Home
Login Login / Register Topics Topics Search Last 1|3|7 Days   Previous Page Previous Next Next Page

© Copyright 2002-2008 by NowMobile.com Limited
Airport House, Purley Way, Croydon, London, CR0 0XZ, UK
UK Tel: +44-20-8286-8080 US Tel: +1.410.833.8711
email : nowsms@nowsms.com