2 way SMS

2 way SMS SearchSearch
Author Message
KH
Posted on Friday, September 19, 2003 - 08:17 am:   

Anyone has a sample for coding interactive SMS?
By VB or Java script. I tried a sample in one of the earlier thread but doesn't work.

c:\windows\system32\wscript.exe c:\temp\NowSMS\incall.vbs %@@SENDER@@%@@SMSPREFIX@@%@@SMS@@

I am able to activate incall.vbs by clicking on the program but not by sending a SMS.

Thanks.
Bryce Norwood - NowSMS Support
Posted on Thursday, September 25, 2003 - 03:17 am:   

Hi KH,

I assume you're referring to Lars' example in this thread:

http://support.nowsms.com/discus/messages/1/333.html

(I cross-reference this mostly for others who read this thread.)

I tried the example, and it works for me. The received message is logged to the c:\temp\nowsms\test.log file, as referenced in the script.

Normally, when I run these types of scripts, I execute c:\winnt\system32\cscript.exe (instead of wscript.exe).

Verify that the wscript.exe (or cscript.exe) exists in the directory that you have specified (I would expect NowSMS to complain and not allow it to be added as a "2-way" command).

-bn
KH
Posted on Saturday, September 27, 2003 - 04:12 am:   

Thank you for your prompt reply.

Your assumption is right.

I have both cscript.exe and wscript.exe in c:\windows\system32\ directory. I am using Windows XP, through infra coms does it matter?

Command to Execute:
c:\windows\system32\cscript.exe c:\temp\incall.vbs %@@SENDER@@%@@SMSPREFIX@@%@@SMS@@

on error resume next

Set Args = WScript.Arguments
For I = 0 to Args.Count - 1
LogTxt = LogTxt & Args(I)
Next
Set Args = nothing

writelog(LogTxt)

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

I am still unable to create the log file, though I can create it by clicking on the "incall.vbs".

Thanks.
Bryce Norwood - NowSMS Support
Posted on Saturday, September 27, 2003 - 05:18 pm:   

I tried it on Windows XP as well (although I'm not sure you mean by "through infra coms").

Maybe we're looking at this from the wrong perspective. Maybe the script configuration and the script are fine. Maybe the message isn't being received by the system.

How would you receive an SMS on your system? Are you using a GSM modem? A connection to an SMSC?

I'm wondering if the message is ever coming into the system.

Remove the command from the 2-way table. Restart the gateway.

Send an SMS message to a phone number that would be received by your system (such as the phone number of the GSM modem). The gateway should retrieve it and create a file in the SMS-IN subdirectory (under the NowSMS program directory). Does this happen?

Tell me more about your SMSC or GSM modem configuration.
KH
Posted on Sunday, September 28, 2003 - 09:54 am:   

Thanks for the great support!

I am using infra-red communication port.Nokia 6510, GSM.

The message came to the system. A .SMS file was created in the SMS-IN folder.

[SMS-IN]
Sender=+8888
Data=test
Binary=0

Thanks.
CC
Posted on Monday, September 29, 2003 - 08:27 am:   

Hi KH,

Would appreciate if you could share with me how do you set up the connection to your Nokia 6510 via IR. I have problem on this.

Thanks in advance.
KH
Posted on Tuesday, September 30, 2003 - 01:08 am:   

I am using IR built in to a laptop. I assume you have the IP setup properly? i.e. it works with other device.

When you select Infraed on Nokia's Menu, you will see "IR reception ativated". Once you put the IR port(right side of the mobile) near your PC, you will get a message that your Nokia 6510 is near your PC.

In nowsms gateway, SMSC tab, add GSM phone or modem. Under "Select Available Modem", select "Standard Modem over IR link".
If you don't have this, your IR is not setup properly for any device, not just for the mobile.
KH
Posted on Thursday, October 02, 2003 - 08:50 am:   

I really want this to work badly.
I tried both cscript.exe and wscript.exe

A 3F7BD60B.in file is created and then disappears after. The contend is:

[SMS-IN]
Sender=888888
Data=a
Binary=0

"a" is the SMS command Prefix.

Thanks.
Bryce Norwood - NowSMS Support
Posted on Thursday, October 02, 2003 - 06:30 pm:   

If the file is being deleted, this suggests that the message is being processed by the 2-way command.

Is there no "c:\temp\TEST.LOG" file created on your system?
KH
Posted on Friday, October 03, 2003 - 02:33 am:   

The "TEST.Log" was generated when I click the .vbs. No additional line was added when the .in file disappear

Will I have problem if I my "Text Service and Input Languages", installed service includes Chinese character?

Thanks
Bryce Norwood - NowSMS Support
Posted on Saturday, October 04, 2003 - 03:56 pm:   

I wouldn't expect the language to cause a problem.

NowSMS will convert any text to the local code page when running an executable program as a 2-way command, whereas it uses UTF-8 as the character set when executing an HTTP command as a 2-way command. (If you want to force to a particular character set, you could edit SMSGW.INI, and under the [SMSGW] section header, add ReceiveSMSCharset=big5 or gb2312.)

I'd suggest looking at a debug log, so that we can see the command that NowSMS is executing. Manually edit SMSGW.INI, and under the [SMSGW] section header, add Debug=Yes. Then restart the gateway service, and let's take a look at SMSDEBUG.LOG to see what command the gateway is executing when it processes the message. Since the message is getting deleted, it would seem that NowSMS is executing some command.

Another thought ... try the 2-way command example in our documentation with the ECHO command:

http://www.nowsms.com/documentation/ProductDocumentation/2_way_sms_support.htm