mymanga
November 23, 2015, 8:14pm
1
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.
anton
November 24, 2015, 1:17pm
2
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
mymanga
November 24, 2015, 5:23pm
4
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.
anton
November 24, 2015, 5:25pm
5
can you paste those logs ? (pls sanitized private infos)
anton
mymanga
November 24, 2015, 6:00pm
6
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” “-”
anton
November 24, 2015, 6:11pm
7
ok, can you insert below line:
_log('vars:[' . print_r($r, 1). ']', 3, 'sms_sync sync');
In line 35:
// ignore CSRF
$core_config['init']['ignore_csrf'] = TRUE;
include "init.php";
include $core_config['apps_path']['libs'] . "/function.php";
chdir("plugin/feature/sms_sync/");
}
$r = $_REQUEST;
$c_uid = (int) trim($r['uid']);
$list = registry_search($c_uid, 'feature', 'sms_sync');
$sms_sync_secret = $list['feature']['sms_sync']['secret'];
$sms_sync_enable = $list['feature']['sms_sync']['enable'];
$message_id = trim($r['message_id']);
$sms_datetime = core_display_datetime(core_get_datetime());
$sms_sender = trim($r['from']);
$message = trim($r['message']);
$sms_receiver = trim($r['sent_to']);
And then incoming SMS again, watch the playsms.log (not webserver’s log) and paste here the log
anton
mymanga
November 24, 2015, 6:48pm
8
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
2015-11-24 18:31:56 PID5654ad1c99b9c - L2 sendsmsd # start processing queue_code:9a3002ae039b06f4dcbbf20407936705 chunk:0 queue_count:1 sms_count:1 scheduled:2015-11-24 18:31:55 uid:1 gpid:0 sender_id:IBSMS
2015-11-24 18:31:56 PID5654ad1c99b9c - L2 sendsmsd # sending queue_code:9a3002ae039b06f4dcbbf20407936705 smslog_id:36 to:254712345678 sms_count:1 counter:1
2015-11-24 18:31:56 PID5654ad1c99b9c - L2 sendsms_process # start
2015-11-24 18:31:56 PID5654ad1c99b9c - L2 simplerate__cansend # allowed user uid:1 sms_to:254712345678 credit:37.000 count:1 rate:1.000 charge:1 balance:36
2015-11-24 18:31:56 PID5654ad1c99b9c - L2 sendsms # saving smslog_id:36 u:1 g:0 gw:infobip smsc:infobip s:IBSMS d:254712345678 type:text unicode:0 status:0
2015-11-24 18:31:56 PID5654ad1c99b9c - L2 sendsms_process # saved smslog_id:36 id:36
2015-11-24 18:31:57 PID5654ad1c99b9c - L2 infobip__outgoing # smslog_id:36 charge:0 p_status:0 response:0
2015-11-24 18:31:57 PID5654ad1c99b9c - L2 simplerate__deduct # enter smslog_id:36
2015-11-24 18:31:57 PID5654ad1c99b9c - L2 credit_hook_rate_setusercredit # saving uid:1 balance:36
2015-11-24 18:31:57 PID5654ad1c99b9c - L2 credit_hook_rate_setusercredit # saved uid:1 balance:36
2015-11-24 18:31:57 PID5654ad1c99b9c - L2 simplerate__deduct # user uid:1 parent_uid: smslog_id:36 msglen:119 count:1 rate:1.000 charge:1 credit:37.000 balance:36
2015-11-24 18:31:57 PID5654ad1c99b9c - L2 simplebilling__post # saving smslog_id:36 rate:1.000 credit:37.000 count:1 charge:1
2015-11-24 18:31:57 PID5654ad1c99b9c - L2 simplebilling__post # saved smslog_id:36 id:36
2015-11-24 18:31:57 PID5654ad1c99b9c - L2 sendsms_process # end
2015-11-24 18:31:57 PID5654ad1c99b9c - L2 sendsmsd # result queue_code:9a3002ae039b06f4dcbbf20407936705 to:254712345678 flag:1 smslog_id:36
2015-11-24 18:31:57 PID5654ad1c99b9c - L2 sendsmsd # finish processing queue_code:9a3002ae039b06f4dcbbf20407936705 uid:1 sender_id:IBSMS queue_count:1 sms_count:1
2015-11-24 18:32:05 PID5654ab4bcb88c - L2 simplebilling__finalize # saving smslog_id:36
2015-11-24 18:32:05 PID5654ab4bcb88c - L2 simplebilling__finalize # saved smslog_id:36
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
mymanga
November 24, 2015, 6:56pm
9
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.
anton
November 25, 2015, 12:35am
10
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
mymanga
November 25, 2015, 5:10pm
11
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
anton
November 25, 2015, 9:05pm
12
are those messages in sandbox from sms_sync containing @username ?
anton
mymanga
November 26, 2015, 11:37am
13
yes they do , they all have they all have @admin
anton
November 26, 2015, 11:50am
14
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
mymanga
November 26, 2015, 11:57am
15
I have configured that. Messages going to admin inbox now ,but keywords not being seen by features (quiz, poll, command etc)
anton
November 26, 2015, 12:01pm
16
mymanga
November 26, 2015, 12:10pm
17
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
anton
November 26, 2015, 12:11pm
18
have you tried the new sync.php ? the one I gave you the link before this post
anton
mymanga
November 26, 2015, 12:12pm
19
yes i have, tried with two sms messages, no change
anton
November 26, 2015, 12:14pm
20
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