SMSSYNC web service error

Hi, I am using the latest playsms and also smssync.I enabled smssync feature, put secret key. I added playsms to smssync android app like usual, but when i click test integration on the app, it gives me an error

“Web service doesnt seem to have the right endpoit”

I have tried older versions of smssync app with no success on playsms. But the app works with other applications that have smssync integration.

I have confirm i am using the right url “http://mydomain.com/plugin/feature/sms_sync/sync.php?uid=1” and also correct secret key.

Test integration does not send other required parameters, it only send secret parameter
so I need to change something in sync.php, hold on

anton

ok, this just fixed:

anton

Thanks for the update, error on app is gone, but I am still not getting any messages on playsms from smssync. I checked webserver logs it shows the app accessing the server.

Edit : the app shows all messages sent.

can you paste those logs ? (pls sanitized private infos)

anton

11.22.33.44 - - [24/Nov/2015:17:57:24 +0000] “GET /index.php?app=ws&op=credit HTTP/1.1” 200 37 “http://mydomain.com/index.php?app=main&inc=feature_sms_sync&op=sms_sync_list” “Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36” "-"
11.22.33.44 - - [24/Nov/2015:17:57:28 +0000] “GET /index.php?app=ws&op=credit HTTP/1.1” 200 37 “http://mydomain.com/index.php?app=main&inc=feature_report&route=all_inbox&op=all_inbox” “Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36” "-"
11.22.33.44 - - [24/Nov/2015:17:57:34 +0000] “GET /index.php?app=ws&op=credit HTTP/1.1” 200 37 “http://mydomain.com/index.php?app=main&inc=feature_sms_sync&op=sms_sync_list” “Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36” "-"
11.22.33.44 - - [24/Nov/2015:17:57:39 +0000] “GET /index.php?app=ws&op=credit HTTP/1.1” 200 37 “http://mydomain.com/index.php?app=main&inc=feature_report&route=all_inbox&op=all_inbox” “Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36” "-"
11.22.33.44 - - [24/Nov/2015:17:57:45 +0000] “GET /index.php?app=ws&op=credit HTTP/1.1” 200 37 “http://mydomain.com/index.php?app=main&inc=feature_sms_sync&op=sms_sync_list” “Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36” "-"
11.22.33.44 - - [24/Nov/2015:17:57:50 +0000] “GET /index.php?app=ws&op=credit HTTP/1.1” 200 37 “http://mydomain.com/index.php?app=main&inc=feature_report&route=all_inbox&op=all_inbox” “Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36” "-"
11.22.33.44 - - [24/Nov/2015:17:57:52 +0000] “POST /plugin/feature/sms_sync/sync.php?uid=1 HTTP/1.1” 200 54 “-” “SMSSync-Android/v2.8.1” "-"
11.22.33.44 - - [24/Nov/2015:17:57:55 +0000] “GET /index.php?app=ws&op=credit HTTP/1.1” 200 37 “http://mydomain.com/index.php?app=main&inc=feature_sms_sync&op=sms_sync_list” “Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36” "-"
11.22.33.44 - - [24/Nov/2015:17:58:01 +0000] “GET /index.php?app=ws&op=credit HTTP/1.1” 200 37 “http://mydomain.com/index.php?app=main&inc=feature_report&route=all_inbox&op=all_inbox” “Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36” "-"
11.22.33.44 - - [24/Nov/2015:17:58:06 +0000] “GET /index.php?app=ws&op=credit HTTP/1.1” 200 37 “http://mydomain.com/index.php?app=main&inc=feature_sms_sync&op=sms_sync_list” “Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36” “-”

ok, can you insert below line:

_log('vars:[' . print_r($r, 1). ']', 3, 'sms_sync sync');

In line 35:

And then incoming SMS again, watch the playsms.log (not webserver’s log) and paste here the log

anton

44.33.22.11 mydomain.com 2015-11-24 18:31:36 PID5654ad080b726 admin L2 auth_block # WARNING: no access or blocked. sid:rt0q8vrr2sg4vb8k5nf4cl8ud4 ip:44.33.22.11 uid:1 app:main inc:core_auth op:block route:block
44.33.22.11 mydomain.com 2015-11-24 18:31:55 PID5654ad1b76f7d admin L2 sendsms # start uid:1 sender_id:[IBSMS] smsc:[]
44.33.22.11 mydomain.com 2015-11-24 18:31:55 PID5654ad1b76f7d admin L2 sendsms_queue_create # saving queue_code:9a3002ae039b06f4dcbbf20407936705 src:IBSMS scheduled:2015-11-24 18:31:55
44.33.22.11 mydomain.com 2015-11-24 18:31:55 PID5654ad1b76f7d admin L2 sendsms_queue_create # saved queue_code:9a3002ae039b06f4dcbbf20407936705 id:38
44.33.22.11 mydomain.com 2015-11-24 18:31:55 PID5654ad1b76f7d admin L2 sendsms # dst:1 sms_count:1 total_charges:1
44.33.22.11 mydomain.com 2015-11-24 18:31:55 PID5654ad1b76f7d admin L2 sendsms_queue_push # saving queue_code:9a3002ae039b06f4dcbbf20407936705 dst:254712345678
44.33.22.11 mydomain.com 2015-11-24 18:31:55 PID5654ad1b76f7d admin L2 sendsms_queue_push # saved queue_code:9a3002ae039b06f4dcbbf20407936705 smslog_id:36
44.33.22.11 mydomain.com 2015-11-24 18:31:55 PID5654ad1b76f7d admin L2 sendsms # end queue_code:9a3002ae039b06f4dcbbf20407936705 queue_count:1 sms_count:1 failed_queue:0 failed_sms:0

Note : I have removed real IP addresses and login data. As you can see theres no log about sms sync. received 3 messages on the app that said they were sent to the server, but nothing on the server side…Adding app logs

SMSSYNC app logs

24-11 21:38 Received SMS - [ Sasa ] from [ +254712345678 ]
24-11 21:38 HTTP Entity format is [ URLEncoded ]
24-11 21:38 SMS [ Sasa ] successfully sent to [ http://mydomain.com/plugin/feature/sms_sync/sync.php?uid=1 ]
24-11 21:38 SMSsync Message Sent.
24-11 21:40 Received SMS - [ ABC4WI17WE Confirmed.on 17/11/15 at 6:26 PMKsh60.00 received from 254712345678 Ba OPIYO.New Account balance is Ksh60.00 ] from [ +254712345678 ]
24-11 21:41 HTTP Entity format is [ URLEncoded ]
24-11 21:41 SMS [ ABC4WI17WE Confirmed.on 17/11/15 at 6:26 PMKsh60.00 received from 254712345678 Ba OPIYO.New Account balance is Ksh60.00 ] successfully sent to [ http://mydomain.com/plugin/feature/sms_sync/sync.php?uid=1 ]
24-11 21:41 SMSsync Message Sent.

Oh I noticed that the log was on logstate 2, set it to logstate 3, change it on config.php, and then restart playsmsd, try again

the log for sms sync will have the sync on the line, so you can filter that:

cat /var/log/playsms/playsms.log | grep sync > sync1.txt

edit sync1.txt and paste here (if possible only the relevant info, look at the time for example)

anton

Hi, sorry for the delay in reply. I found all the messages, they are in sandbox. I have setup keywords in the command feature but none of the them are being routed properly

are those messages in sandbox from sms_sync containing @username ?

anton

yes they do , they all have they all have @admin

ic, is it possible you haven’t configure incoming route ?

Settings → Route incoming SMS → Pre rules tab → Scan incoming SMS for @username, set to Yes

anton

I have configured that. Messages going to admin inbox now ,but keywords not being seen by features (quiz, poll, command etc)

ok, can you try to replace your sync.php with this one?
https://raw.githubusercontent.com/antonraharja/playSMS/master/web/plugin/feature/sms_sync/sync.php

anton

If i put @username goes user’s inbox, if i don’t put username, goes to sandbox. But playsms is still not reading the keyword and forwarding to correct sms feature like polls and quizes

have you tried the new sync.php ? the one I gave you the link before this post

anton

yes i have, tried with two sms messages, no change

ok, try only the one without @username, try for example using incoming SMS: TEST 123, where you have configured a feature (for example SMS board, or quiz, or whatever) with keyword TEST

the fail result would be message goes to admin’s inbox
the success result would be message goes to the feature
the unknown error result would be message goes to sandbox, or not showing anywhere

also please post the log for that test

anton