Problem running a command upon receiving SMS

Problem running a command upon receiving SMS SearchSearch

SMS & MMS Technical Forum » NowSMS Support - SMS Issues (Product Support Only) » Archive through June 24, 2009 » Problem running a command upon receiving SMS « Previous || Next »
Author Message
Vassilios Tikas
New member
Username: Vtikas

Post Number: 1
Registered: 05-2009
Posted on Wednesday, May 27, 2009 - 11:32 am:   

I receive the SMS (It is stored in the SMSIN Folder and I see it in the log), but it does not execute the following command C:\WINDOWS\system32\wscript.exe C:\RSS\Transfer.vbs %@@FULLSMS@@, where the Transfer.vbs is
Const ForReading = 1
Const ForWriting = 2
text = Wscript.Arguments(0)

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("\192.168.101.100\rss\RSSORI.xml", ForReading)

strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, "Δοκιμή ενημέρωσης από κινητό τηλέφωνο", text)

Set objFile = objFSO.OpenTextFile("\192.168.101.100\rss\RSS.xml", ForWriting)
objFile.WriteLine strNewText
objFile.Close


The script worcs fine (if I run the command in the Start->Run or a command prompt, it works fine). Could you please help me? Thanks in advance.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 857
Registered: 08-2008
Posted on Wednesday, May 27, 2009 - 03:34 pm:   

Hi,

Can you enable the SMSDEBUG.LOG, then send in another message?

Post the SMSDEBUG.LOG attached to the reply, as I'd like to take a closer look.

--
Des
NowSMS Support
Vassilios Tikas
New member
Username: Vtikas

Post Number: 2
Registered: 05-2009
Posted on Thursday, May 28, 2009 - 06:57 am:   

I enabled the SMSDEBUG.LOG but it is always empty (I sent 4 SMS to test it). On the 2-Way page, when I view the received SMS, I can see all the messages I sent, but on the Status column it says "Queued". Why queued? I am also posting the SMSIN.LOG
2009-05-28 10:43:53,+306932619048,Text,test,
2009-05-28 10:45:30,+306932619048,Text,test2,
2009-05-28 10:46:40,+306932619048,Text,ddddd
Thanks
Vassilios Tikas
New member
Username: Vtikas

Post Number: 3
Registered: 05-2009
Posted on Thursday, May 28, 2009 - 07:00 am:   

Sorry, after a while the messages disappear from the queued status and I can see hem in the SMSIN.LOG, but still the command does not work..
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 860
Registered: 08-2008
Posted on Thursday, May 28, 2009 - 12:18 pm:   

Are you sure the SMSDEBUG.LOG is always empty?

Maybe the program you are using to try to view it does not like the fact that NowSMS keeps it open while it is running (because it is adding to it).

If you click the "View" button next to the button that enables SMSDEBUG.LOG (on the "Serial #" page), it should launch NOTEPAD to view SMSDEBUG.LOG.

Do you see the file then?

We really need to see that.

The SMSIN-yyyymmdd.LOG shows that the messages are being received.

Are the received messages remaining as files in the SMS-IN directory, or are they disappearing?

I assume that NowSMS is running your script, but something unexpected is happening ... either a typo in the 2-way command ... or maybe a rights issue with the script.

Actually, a rights issue may be the culprit.

I see that you are trying to open a file on another server within your script.

NowSMS runs as a service, so it runs in the LocalSystem context, and the LocalSystem does not necessarily have rights to access remote files.

For testing, try using a local file instead of a remote file.

To enable access to a remote file ...

Use the Services applet under Administrative Tools in the Control Panel to assign a user account to the NowSMS service.

--
Des
NowSMS Support
Vassilios Tikas
New member
Username: Vtikas

Post Number: 4
Registered: 05-2009
Posted on Thursday, May 28, 2009 - 01:02 pm:   

You were absolutely right, it was a rights issue. Everything works fine. Thnks a lot.

Login Login / Register Logout Logout Search Last 30 Days Topics Topics