Web Application (PHP) and NowSMS

Web Application (PHP) and NowSMS SearchSearch
Author Message
Freddie Emerson
New member
Username: Fredang85

Post Number: 1
Registered: 05-2012
Posted on Friday, May 18, 2012 - 05:17 am:   

We are currently developing a web application and we wish that the software can be used to send & receive SMS.

The user will be able to send a message through the software, and any replies can be seen too.

May I know if I am right in this setup:
- GSM modem connected to desktop installed with nowSMS
- SMS constantly updating server upon message received

Any message sent from the web application will then send a message to the desktop which will in turn send an SMS out.

I hope more people have done this setup so that I can see some examples.

Thank you!
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3961
Registered: 08-2008
Posted on Friday, May 18, 2012 - 10:10 pm:   

Hi Freddie,

Your understanding is correct.

The best thing I can advise is to get your hands on a GSM modem (preferably one of the dedicated USB stick devices), and then install the NowSMS trial to get familiar with how it works.

Models and manufacturers of GSM modems tend to vary from country to country. I tend to like the Option ICON models (3xx, 4xx, or 5xx series ... avoid 2xx). Huawei and Sierra Wireless are also good, although those models tend to require some specific setup to work properly. You're generally best off getting an unlocked modem and moving a SIM that was provisioned for a phone to the modem. The reason for this is that SIMs that come with data cards tend to be provisioned with the expectation that they will be used for mobile internet access, and their rates for messaging are not as good. So you may want to do a little investigation of plans before you get started.

--
Des
NowSMS Support
Freddie Emerson
New member
Username: Fredang85

Post Number: 2
Registered: 05-2012
Posted on Saturday, May 19, 2012 - 05:19 pm:   

With a stroke of luck, I was researching on which GSM modem to purchase when I realised that they are exactly the same thing as my "Internet Dongle" bought 2 years ago.

Now, it probably might not be an industrial quality but at least, I managed to setup NowSMS lite successfully, and even connected it.

However, I am unable to send any SMS out from the software. The modem had it's own program to send out SMS and it works, however, when I used the web application of nowsms, the message gets queued and doesn't send.

What kind of details can I provide?
aravindh
New member
Username: 9059346342

Post Number: 1
Registered: 05-2012
Posted on Sunday, May 20, 2012 - 02:35 pm:   

haiiiiiiiiiiiii
Freddie Emerson
New member
Username: Fredang85

Post Number: 3
Registered: 05-2012
Posted on Sunday, May 20, 2012 - 02:39 pm:   

hai :)

You made me a little excited that there was a reply :(
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3966
Registered: 08-2008
Posted on Monday, May 21, 2012 - 09:51 pm:   

Sorry, we don't always monitor replies on the weekend. (On my first look at this thread, I saw the second message that just said "haiiiiiiii", and I assumed the thread was just spam, and put off responding to this query for last today. Sorry about that confusion!)

Does the Status screen report any retries or failures?

The best way for us to see what is happening is to have you enable the SMSDEBUG.LOG. Try sending again, then reply back with the content of that log.

You do have an active SIM in that dongle right? If not, you can move a SIM from a phone into the dongle.


--
Des
NowSMS Support
Freddie Emerson
New member
Username: Fredang85

Post Number: 4
Registered: 05-2012
Posted on Tuesday, May 22, 2012 - 02:44 pm:   

No report of any retries or failures. This is the SMSDEBUG.LOG

14:01:15:141 [0] UseRouteCache: No
14:01:17:155 [0] main: Before InitStatCounters
14:01:17:374 [0] main: After InitStatCounters
14:01:17:623 [0] main: Before CheckDatabaseIntegrity
14:01:17:654 [0] main: After CheckDatabaseIntegrity
14:01:19:682 [0] main: Now SMS/MMS Gateway v2012.05.01 Web server started on port number 8800
14:01:19:682 [5] ThreadScanAlerts: Before CheckDatabaseIntegrity
14:01:19:698 [0] main: 27 Days remaining in trial version
14:01:19:714 [5] ThreadScanAlerts: After CheckDatabaseIntegrity
14:01:25:714 [0] UseRouteCache: No
15:00:00:747 [0] main: 27 Days remaining in trial version
21:30:24:509 [0] main: 27 Days remaining in trial version


I don't feel that there is any information in this log. I just sent an SMS before viewing the log and there is nothing logged.

An active SIM is in the dongle. I can SMS with their own little program without problems.

Now, under the Text Message tab, there is a Send Test SMS which I added +65xxxxxxxx. The Status stays on waiting for very long and nothing happens even after 30mins.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3967
Registered: 08-2008
Posted on Tuesday, May 22, 2012 - 03:27 pm:   

The SMSDEBUG.LOG doesn't report any messages being submitted either?

Even requesting the NowSMS web interface would generate some activity in the SMSDEBUG.LOG.

It's also not even attempting to talk to the modem if that is all that is in the SMSDEBUG.LOG.

What version of Windows are you running on?

This sounds like a rights issue, where for some reason the setup wizard is not able to create configuration files that the service can find.

Most of the configuration details are saved in a file named SMSGW.INI. The wizard normally stores this in a file in the ProgramData\NowSMS directory. Can you locate an SMSGW.INI file on your system? (Or perhaps more than one?)

--
Des
NowSMS Support
Freddie Emerson
New member
Username: Fredang85

Post Number: 5
Registered: 05-2012
Posted on Tuesday, May 22, 2012 - 03:55 pm:   

Yes, SMSGW.ini is available in
C:\ProgramData\NowSMS

Since you mentioned about the Rights, I tried to run it as Administrator.

Still the same, no difference. Not able to send any SMS.

But at least, there is more logged in SMSDEBUG

22:52:44:405 [0] UseRouteCache: No
22:52:46:408 [0] main: Before InitStatCounters
22:52:46:521 [0] main: After InitStatCounters
22:52:46:911 [0] main: Before CheckDatabaseIntegrity
22:52:46:913 [0] main: After CheckDatabaseIntegrity
22:52:48:915 [0] main: Now SMS/MMS Gateway v2012.05.01 Web server started on port number 8800
22:52:48:919 [9] ThreadScanAlerts: Before CheckDatabaseIntegrity
22:52:48:920 [9] ThreadScanAlerts: After CheckDatabaseIntegrity
22:52:48:923 [0] main: 27 Days remaining in trial version
22:52:48:935 [16] ThreadProcessModem: BandLuxe 3.5G Modem
22:52:48:997 [16] ThreadProcessModem: Before ModemAllocate - BandLuxe 3.5G Modem
22:52:49:011 [16] ThreadProcessModem: After ModemAllocate - BandLuxe 3.5G Modem - OK
22:52:49:011 [16] ThreadProcessModem: Re-initializing modem: BandLuxe 3.5G Modem ...
22:52:49:194 [16] ThreadProcessModem: ATI0
22:52:49:194 [16] ThreadProcessModem:
Manufacturer: QUALCOMM INCORPORATED
Model: C-179
Revision: 120016_001_063 1 [Apr 03 2009 13:46:19]
IMEI: 358093020844364
+GCAP: +CGSM,+DS,+ES

OK

22:52:49:234 [16] ModemTest: BandLuxe 3.5G Modem
22:52:49:299 [16] ModemTest: OK
22:52:49:299 [16] ThreadProcessModem: AT+CPMS?
22:52:49:315 [16] ThreadProcessModem:
+CPMS: "ME",0,255,"ME",0,255,"ME",0,255

OK

22:52:49:315 [16] ThreadProcessModem: AT+CNMI=2,0
22:52:49:330 [16] ThreadProcessModem:
OK

22:52:49:330 [16] ThreadProcessModem: AT+CNMI?
22:52:49:343 [16] ThreadProcessModem:
+CNMI: 2,0,0,0,0

OK

22:52:49:343 [16] ThreadProcessModem: AT+CNMI=2,1
22:52:49:359 [16] ThreadProcessModem:
OK

22:52:49:359 [16] ThreadProcessModem: AT+CNMI?
22:52:49:372 [16] ThreadProcessModem:
+CNMI: 2,1,0,0,0

OK

22:52:49:372 [16] ThreadProcessModem: AT+CNMI=2,1,0,1
22:52:49:384 [16] ThreadProcessModem:
+CMS ERROR: 303

22:52:49:384 [16] ThreadProcessModem: AT+CNMI=2,1,0,2
22:52:49:401 [16] ThreadProcessModem:
OK

22:52:49:401 [16] ThreadProcessModem: AT+CPMS=?
22:52:49:414 [16] ThreadProcessModem:
+CPMS: ("ME","MT","SM","SR"),("ME","MT","SM","SR"),("ME","MT","SM","SR")

OK

22:52:49:465 [16] ThreadProcessModem: AT+CPMS="SM","SM","SM"
22:52:49:482 [16] ThreadProcessModem:
+CPMS: 0,30,0,30,0,30

OK

22:52:49:482 [16] ThreadProcessModem: AT+CPMS?
22:52:49:495 [16] ThreadProcessModem:
+CPMS: "SM",0,30,"SM",0,30,"SM",0,30

OK

22:52:49:495 [16] ThreadProcessModem: AT+CGSMS=3
22:52:49:510 [16] ThreadProcessModem:
OK

22:52:49:524 [16] ThreadProcessModem: AT+CNMI?
22:52:49:536 [16] ThreadProcessModem:
+CNMI: 2,1,0,2,0

OK

22:52:49:536 [16] ThreadProcessModem: AT+CNMI=?
22:52:49:548 [16] ThreadProcessModem:
+CNMI: (0,1,2),(0,1,2,3),(0,2),(0,1,2),(0,1)

OK

22:52:49:548 [16] ThreadProcessModem: AT+COPS?
22:52:49:560 [16] ThreadProcessModem:
+COPS: 0,0,"SingTel",2

OK

22:52:49:560 [16] ThreadProcessModem: AT+CSQ
22:52:49:573 [16] ThreadProcessModem:
+CSQ: 17,99

OK

22:52:49:573 [16] ThreadProcessModem: AT+CNUM
22:52:49:586 [16] ThreadProcessModem:
+CNUM: ,"+6596655447",145


OK

22:52:49:586 [16] ThreadProcessModem: +6596655447
22:52:49:586 [16] ThreadProcessModem: Modem initialization complete: BandLuxe 3.5G Modem
22:52:49:760 [16] ThreadProcessModem: Processing 4FB7B1C4.req...
22:52:49:775 [16] ThreadProcessModem: OUT: AT+CMGS=19

22:52:49:786 [16] ThreadProcessModem: IN:
>
22:52:49:786 [16] ThreadProcessModem: OUT: 00010108810930829600000977F4FBFD7EBFDF6F
22:52:51:784 [16] ThreadProcessModem: +CMGS: 1

OK

22:52:51:912 [16] ThreadProcessModem: Processing 4FB7B1C5.req...
22:52:51:912 [16] ThreadProcessModem: OUT: AT+CMGS=20

22:52:51:924 [16] ThreadProcessModem: IN:
>
22:52:51:924 [16] ThreadProcessModem: OUT: 0001020A81560930829600000977F4FBFD7EBFDF6F
22:52:54:934 [0] UseRouteCache: No
22:52:54:935 [0] main: RoutingDbReset
22:52:55:435 [0] main: RoutingDbReset2


I am using BandLuxe C170 modem.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3968
Registered: 08-2008
Posted on Tuesday, May 22, 2012 - 05:41 pm:   

Hmm ... according to the log the message was sent.

At least the first message. The log may have been truncated before the second message was accepted by the network.

Can you send messages to the same number using the modem's own software?

--
Des
NowSMS Support
Freddie Emerson
New member
Username: Fredang85

Post Number: 6
Registered: 05-2012
Posted on Friday, May 25, 2012 - 05:19 pm:   

Okay, I know whats the problem now. Running as administrator is a must, or anything to be sent.

The reason why I wasn't able to send is because I have some queues which I did not delete. After deleting, everything is to how it should be!

Thanks alot!
Freddie Emerson
New member
Username: Fredang85

Post Number: 7
Registered: 05-2012
Posted on Friday, May 25, 2012 - 05:29 pm:   

Now that I understand how does the SMS work by sending through my local pc, I need to know more on how I can integrate it on my web app (PHP) which is hosted on another server.

Now, what I want to do is like a vBulletin(or any other forum) messaging system. For example, when I send a message from the webapp, a message will be relayed to my local computer to send out that message. When a message is received, the opposite will be done and an alert(in the webapp) will notify that a message is received.

Would like to know how the relaying could be done, and if there is any examples lying around.

Thank you!