Help how to auto forward sms to phone number | Search |
NowSMS Support Forums ⬆ NowSMS Support - SMS Issues ⬆ Archive through June 24, 2009 ⬆ |
◄ ► |
Author | Message | |||||
wong kam hoe New member Username: Wkamhoe Post Number: 1 Registered: 05-2009 |
I found a thread here http://support.nowsms.com/discus/messages/1/7944.html and i've tried the command http://127.0.0.1:8800/?user=username&password=password&phonenumber=1,2,3,4,5&tex t=@@SENDER@@/@@FULLSMS@@ But it just doesnt forward to the number i set in the command. I dont know which part i did wrongly. p/s: i noticed the "text" are typed "tex t" is that on purpose or it has to be like that? I copied the command from that thread listed above | |||||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 754 Registered: 08-2008 |
Hi, The discussion board software that we use here adds spaces to some long URLs. There is not supposed to be any spaces in the URL. I assume you have a working installation of NowSMS that can send SMS. Have you tried other 2-way commands ... are you sure that your system is actually receiving messages? "username" and "password" are valid for an account defined under "SMS Users" on your system?? I usually start troubleshooting by asking people to enable the SMSDEBUG.LOG (checkbox on "Serial #" page) ... send in another message, and the SMSDEBUG.LOG shows the actual URL that NowSMS tried to connect to, and what happened. If you want to enable the SMSDEBUG.LOG and then post it in reply here, that would be helpful. -- Des NowSMS Support | |||||
wong kam hoe New member Username: Wkamhoe Post Number: 2 Registered: 05-2009 |
Hi Des, Here is the initial log, which i found that 127.0.0.1 has connection error, so i have changed the command to pointing to the gateway host instead.
I have glanced thru (in the initial log) and found the sms replied to NowSMS gateway has been received by the modem. 14:27:37:532 [2] ModemReceiveMessages: Decoding received message index 4 from message storage SM 14:27:37:532 [2] ModemReceiveMessages: 07910621000010F5240B910621232472F10000905011417233230AD4F29C0E9297E1EC3C 14:27:37:532 [2] ModemReceiveMessages: SMSC address len = 7 14:27:37:532 [2] ModemReceiveMessages: SMSC Address = +60120000015 14:27:37:532 [2] ModemReceiveMessages: SMS Message Type = SMS-DELIVER 14:27:37:532 [2] ModemReceiveMessages: Sender address len = 11 14:27:37:532 [2] ModemReceiveMessages: Sender Address = +60123242271 14:27:37:532 [2] ModemReceiveMessages: PID = 00 14:27:37:532 [2] ModemReceiveMessages: DCS = 00 14:27:37:532 [2] ModemReceiveMessages: Anticipated user data length = 10 14:27:37:532 [2] ModemReceiveMessages: Message = Test reply 14:27:37:532 [2] ModemReceiveMessages: AT+CMGD=4 14:27:37:860 [2] ModemReceiveMessages: OK However the autoforwarding did not reach the receipient. Here is the 2nd log that has the address pointing directly to the gateway host.
From the device i replied to the gateway, i received an sms from gateway with content "command not completed. request returned invalid content type: text/html" | |||||
wong kam hoe New member Username: Wkamhoe Post Number: 3 Registered: 05-2009 |
I can see the sms successfully received by modem, and web login accepted, but its still failed. Do i need to specify anything when replying sms to gateway? 15:50:22:253 [2] ModemReceiveMessages: OK 15:50:22:455 [4] ThreadProcessInboundSMS: Processing 4A010E5D.in... 15:50:22:455 [4] GetProgramToExecute: http://10.40.3.6:8800/?user=klwke&password=aaaa&phonenumber=+60123549107&text=@@SENDER@@/@@FULLSMS@@ 15:50:22:455 [4] GetProgramToExecute: http://10.40.3.6:8800/?user=klwke&password=aaaa&phonenumber=+60123549107&text=%2 B60123242271/Test%20reply%20after%20changed%20host%20address 15:50:22:455 [4] ThreadProcessInboundSMS: Executing http://10.40.3.6:8800/?user=klwke&password=aaaa&phonenumber=+60123549107&text=%2 B60123242271/Test%20reply%20after%20changed%20host%20address 15:50:22:455 [4] RetrieveURL: Retrieving http://10.40.3.6:8800/?user=klwke&password=aaaa&phonenumber=+60123549107&text=%2 B60123242271/Test%20reply%20after%20changed%20host%20address 15:50:22:455 [4] RetrieveURL: Retrieving ?user=klwke&password=aaaa&phonenumber=+60123549107&text=%2B60123242271/Test%20re ply%20after%20changed%20host%20address 15:50:22:455 [4] RetrieveURL: GET /?user=klwke&password=aaaa&phonenumber=+60123549107&text=%2B60123242271/Test%20r eply%20after%20changed%20host%20address HTTP/1.1 User-Agent: Now SMS/MMS Gateway v2008.06.03 Accept: */* Connection: close Host: 10.40.3.6:8800 15:50:22:455 [12] ThreadProcessConnection: Processing connection from 10.40.3.6... 15:50:22:455 [12] ThreadProcessConnection: Processing request /?user=klwke&password=aaaa&phonenumber=+60123549107&text=%2B60123242271/Test%20r eply%20after%20changed%20host%20address 15:50:22:455 [12] Debug: 1 recipient entries 15:50:22:455 [12] ThreadProcessConnection: Before message loop 15:50:22:455 [12] ThreadProcessConnection: Before message loop 15:50:22:455 [12] ThreadProcessConnection: Begin message loop 15:50:22:455 [12] ThreadProcessConnection: End message loop 15:50:22:455 [4] HttpResponseWait: ioctlsocket indicates end of request 15:50:22:455 [4] RetrieveURL: got success response 15:50:22:455 [4] RetrieveURL: text/html 15:50:22:455 [4] ThreadProcessInboundSMS: Command not completed. Request returned invalid content type: text/html 15:50:22:455 [12] WaitForSocketClose: WinSock reported ioctlsocket complete 15:50:22:455 [12] ThreadProcessConnection: Request processing complete 15:50:23:562 [2] ThreadProcessModem: Processing 4A010E5E.req... 15:50:23:562 [2] ThreadProcessModem: OUT: AT+CMGS=57 15:50:23:624 [2] ThreadProcessModem: IN: | |||||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 764 Registered: 08-2008 |
Edit the 2-way command and uncheck "Command returns response text". Ah ... and I see the other problem ... Edit your 2-way command URL so that the phone number that you are forwarding to starts with "%2B" instead of "+". A quick of URL encoding requirements is that "+" means " " (space character) in a URL, so to encode a "+", you need to specify "%2B". -- Des NowSMS Support | |||||
wong kam hoe New member Username: Wkamhoe Post Number: 4 Registered: 05-2009 |
Hi Des, Cool its working perfectly now. Is there a way to customise the @@SENDER@@ to show name instead of mobile number? | |||||
wong kam hoe New member Username: Wkamhoe Post Number: 5 Registered: 05-2009 |
Another question. How do i need to set the command to execute auto forward to mobile number specified by the sender sms sent to the gateway? sms eg. "+60123549107 this is test sms" Gateway will receive the sms and forward the content to the above specified number. I found @@RECIP@@ command but not sure how to set it. | |||||
wong kam hoe New member Username: Wkamhoe Post Number: 6 Registered: 05-2009 |
Next question. This is regarding "mailto:@@SMSPREFIX@@" command that im trying to route sms to email. The question is, will it work if i use "@domain.com" as the prefix? SMS would sound like "user@domain.com this is test sms" Im trying to configure it without using wildcard *,with minimal configuration in the gateway (creating local SMS user account), and having option for sender to choose whether they want to forward the sms to specified mobile number or specified email address. Something like "+60123549107 this is test sms" and "user@domain.com this is test sms" which will be forwarded to the receiver as specified. | |||||
wong kam hoe New member Username: Wkamhoe Post Number: 7 Registered: 05-2009 |
Let me rephrase if that was too confusing. What i need is when sms ""+60123549107 this is test sms" is received, it will be processed so that it will forwarded to the mentioned mobile number. And "user@domain.com this is test sms" received will be forwarded to the mentioned email address. What kind of prefix and execute command should i use? | |||||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 766 Registered: 08-2008 |
Not with a GSM modem. When using a GSM modem, the sender id is always inserted automatically by the mobile operator. Some SMS providers allow some flexibility in using alternate sender addresses (using protocols other than GSM modem). Using a name instead of a number is commonly known as "alphanumeric sender". This is not supported as widely as it once was as more countries and mobile operators have rules and regulations requiring valid sender addresses.
In this case, the phone number would be the SMS command prefix, as it is the first word of the message. @@SMSPREFIX@@ would have this first word ... and @@SMS@@ would have the remainder of the SMS text. @@RECIP@@ is the phone number for which the message was received, in this case the phone number of the GSM modem. This value is only set for a GSM modem if the "Phone Number" property is manually applied in the configuration.
You can use a wildcard in the pattern ... it could be either "*@domain.com" or "*@*" if you want to capture e-mail address. -- Des NowSMS Support | |||||
wong kam hoe New member Username: Wkamhoe Post Number: 8 Registered: 05-2009 |
Hi Des, I still dont understand how to use @@SMSPREFIX@@ command to forward sms to mobile. Is this how the command should be? http://10.40.3.6:8800/?user=klwke&password=aaaa&phonenumber=@@SMSPREFIX@@&text=From@@SENDER@@/@@SMS@@ | |||||
wong kam hoe New member Username: Wkamhoe Post Number: 9 Registered: 05-2009 |
I have tried that with "+*" as prefix, but the mobile didnt received the sms. This is the SMSOUT.log 2009-05-13 11:25:04,SAR-+60123549107-4a010e7f-2-1.req,10.40.3.6,+60123549107,OK -- GlobeTrotter 3G+ Modem Interface,SubmitUser=klwke;Binary=1;UDH=050003870201;Data=8CF2777B6583C56EB21C0D6683C15EF4F29C0EA297E77410BD3CA783E8E5391D346FCF41F3F61C346FCF4166B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD 2009-05-13 11:26:03,SAR-+60123549107-4a010e7f-2-2.req,10.40.3.6,+60123549107,OK -- GlobeTrotter 3G+ Modem Interface,SubmitUser=klwke;Binary=1;UDH=050003870202;Data=CC66B3D96C369BCD6633 And SMSWEB.log 2009-05-13 11:24:55,10.40.3.6,klwke,SAR-+60123549107-4a010e7f-2-1.req,LongText 2009-05-13 11:24:55,10.40.3.6,klwke,SAR-+60123549107-4a010e7f-2-2.req,LongText And SMSDEBUG.log
| |||||
wong kam hoe New member Username: Wkamhoe Post Number: 10 Registered: 05-2009 |
I have tried that with "+*" as prefix, but the mobile didnt received the sms. This is the SMSOUT.log 2009-05-13 11:25:04,SAR-+60123549107-4a010e7f-2-1.req,10.40.3.6,+60123549107,OK -- GlobeTrotter 3G+ Modem Interface,SubmitUser=klwke;Binary=1;UDH=050003870201;Data=8CF2777B6583C56EB21C0D 6683C15EF4F29C0EA297E77410BD3CA783E8E5391D346FCF41F3F61C346FCF4166B3D96C369BCD66 B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369B CD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C 369BCD 2009-05-13 11:26:03,SAR-+60123549107-4a010e7f-2-2.req,10.40.3.6,+60123549107,OK -- GlobeTrotter 3G+ Modem Interface,SubmitUser=klwke;Binary=1;UDH=050003870202;Data=CC66B3D96C369BCD6633 And SMSWEB.log 2009-05-13 11:24:55,10.40.3.6,klwke,SAR-+60123549107-4a010e7f-2-1.req,LongText 2009-05-13 11:24:55,10.40.3.6,klwke,SAR-+60123549107-4a010e7f-2-2.req,LongText And SMSDEBUG.log | |||||
wong kam hoe New member Username: Wkamhoe Post Number: 11 Registered: 05-2009 |
I have tried that with "+*" as prefix, but the mobile didnt received the sms. This is the SMSOUT.log 2009-05-13 11:25:04,SAR-+60123549107-4a010e7f-2-1.req,10.40.3.6,+60123549107,OK -- GlobeTrotter 3G+ Modem Interface,SubmitUser=klwke;Binary=1;UDH=050003870201;Data=8CF2777B6583C56EB21C0D6683C15EF4F29C0EA297E77410BD3CA783E8E5391D346FCF41F3F61C346FCF4166B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD66B3D96C369BCD 2009-05-13 11:26:03,SAR-+60123549107-4a010e7f-2-2.req,10.40.3.6,+60123549107,OK -- GlobeTrotter 3G+ Modem Interface,SubmitUser=klwke;Binary=1;UDH=050003870202;Data=CC66B3D96C369BCD6633 And SMSWEB.log 2009-05-13 11:24:55,10.40.3.6,klwke,SAR-+60123549107-4a010e7f-2-1.req,LongText 2009-05-13 11:24:55,10.40.3.6,klwke,SAR-+60123549107-4a010e7f-2-2.req,LongText And SMSDEBUG.log
| |||||
wong kam hoe New member Username: Wkamhoe Post Number: 12 Registered: 05-2009 |
weird..here is the log | |||||
wong kam hoe New member Username: Wkamhoe Post Number: 13 Registered: 05-2009 |
sorry the log doesnt comes out.. Anyhow, i tested again by sending sms using "00" instead of "+" as the command prefix. But i prefer to use + instead as not to confuse the sender when typing the mobile number | |||||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 782 Registered: 08-2008 |
The log is posting fine ... I can read it. It looks like the message is being sent out ok. If it is not being received, maybe there is some other problem. Are you able to send simple test text messages from the NowSMS web interface? | |||||
wong kam hoe New member Username: Wkamhoe Post Number: 14 Registered: 05-2009 |
Hi Des, Okay, its solved when i test again this morning. Next question. http://10.40.3.6:8800/?user=klwke&password=aaaa&phonenumber=@@SMSPREFIX@@&text=From@@SENDER@@/@@SMS@@ Is there a way not to hardcode the username and password in the command string? So sender must provide their username in the sms, and possibly if the user account is not found, gateway will reply with a reject confirmation? | |||||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 791 Registered: 08-2008 |
You'd have to write your own script to handle a more complex scenario. A PHP script example that parses individual words from a received SMS can be found here: http://support.nowsms.com/discus/messages/1/24891.html If you use this approach, instead of having your script return a response, you'd want to have your script issue a new HTTP request to NowSMS to send a message. The following recent thread discusses our sendsms.php example script: http://support.nowsms.com/discus/messages/1/25070.html Admittedly, this is all quite a bit more complicated than what you're working with right now ... and this might initially add some confusion ... -- Des NowSMS Support |