playSMS Forum

[solved] PlaySMS not deducting user credit after SMS successfully delievered

Hello all,

Thanks for the good work on PlaySMS.

I successfully deployed and configured PlaySMS. All seems fine except that when I send an SMS user credit doesnt get deducted even when the message is successfully delivered. I also notice d that admin credit doesnt get updated when I add credit to a user.

Below is a sample log from PlaySMS log file. It shows that all went well.

- - 2017-08-10 09:57:38 PID598c2e12a372b - L3 kannel__outgoing # smslog_id:14 response:0: Accepted for delivery
- - 2017-08-10 09:57:38 PID598c2e12a372b - L3 dlr # isdlrd:1 smslog_id:14 p_status:0 uid:3
- - 2017-08-10 09:57:38 PID598c2e12a372b - L3 kannel__outgoing # end smslog_id:14 p_status:0
- - 2017-08-10 09:57:38 PID598c2e12a372b - L2 simplerate_hook_rate_deduct # enter smslog_id:14
- - 2017-08-10 09:57:38 PID598c2e12a372b - L3 simplerate_hook_rate_getbyprefix # found rate id:1 prefix:234817 rate:2.000 description:Nigeria to:2348170311628
- - 2017-08-10 09:57:38 PID598c2e12a372b - L3 simplerate_hook_rate_getcharges # uid:3 u:saheedalbert2 len:12 unicode:0 to:2348170311628 enable_credit_unicode:1 count:1 rate:2.000 charge:2
- - 2017-08-10 09:57:38 PID598c2e12a372b - L2 simplebilling_hook_billing_post # saving smslog_id:14 rate:2.000 count:1 charge:2
- - 2017-08-10 09:57:38 PID598c2e12a372b - L2 simplebilling_hook_billing_post # saved smslog_id:14 id:3
- - 2017-08-10 09:57:38 PID598c2e12a372b - L3 simplerate_hook_rate_deduct # deduct successful uid:3 parent_uid:0 smslog_id:14
- - 2017-08-10 09:57:38 PID598c2e12a372b - L2 sendsms_process # end
- - 2017-08-10 09:57:38 PID598c2e12a372b - L3 sendsms_throttle_count # throttle bucket exists start:2017-08-09 16:25:18 sum:9 limit:2160000
- - 2017-08-10 09:57:38 PID598c2e12a372b - L3 sendsms_throttle_count # expired start:2017-08-10 09:57:38
- - 2017-08-10 09:57:38 PID598c2e12a372b - L2 sendsmsd # result queue_code:8cc9ba983d254fb92f9a24e178324588 to:2348170311628 flag:1 smslog_id:14
- - 2017-08-10 09:57:39 PID598c2e12a372b - L3 sendsms_throttle_isoverlimit # under quota not overlimit sum:0
- - 2017-08-10 09:57:39 PID598c2e12a372b - L2 sendsmsd # finish processing queue_code:8cc9ba983d254fb92f9a24e178324588 uid:3 sender_id:1960SMS queue_count:1 sms_count:1
- - 2017-08-10 09:57:39 PID598b376d85a55 - L3 dlrd # id:14 smslog_id:14 p_status:0 uid:3

Please kindly advise.

Thanks

Hi,

You have to activate the sms rate. It can be made on main configuration option, Default SMS rate and set any value Ex: 10.
it will dedut 10 on your credit per each massege you send

@mateus

I tried that, but account balance not decreased when i send sms -seems i have same issue as OP

thanks for suggestion tho

Hello,
Please, tell what gateway do you use ?
Thanks.

@astra_Jj we are using Kannel.

Please paste playsmsd check here

Anton

no, run: playsmsd check

anton

will do and will revert a bit later today
thank you

the result should be similar to this:

PLAYSMSD_CONF = /etc/playsmsd.conf
PLAYSMS_PATH = /var/www/html/playsms
PLAYSMS_LIB = /var/lib/playsms
PLAYSMS_BIN = /usr/local/bin
PLAYSMS_LOG = /var/log/playsms
DAEMON_SLEEP = 1
ERROR_REPORTING = E_ALL ^ (E_NOTICE | E_WARNING)
IS_RUNNING = 1
PIDS schedule = 28351
PIDS ratesmsd = 28353
PIDS dlrssmsd = 28355
PIDS recvsmsd = 28357
PIDS sendsmsd = 28359

These are daemon scripts that need to be active all time:

PIDS schedule = 28351
PIDS ratesmsd = 28353
PIDS dlrssmsd = 28355
PIDS recvsmsd = 28357
PIDS sendsmsd = 28359

credits and balance are updated by ratesmsd

also run playsmsd version, it should be 1.4.2 the latest

anton

@anton thank you

ver 1.4.1 is what we have

we will upgrade to 1.4.2 thanks

@anton this is now resolved thank you. v1.4.2. fixed the problem.

I have v1.4.2 but still have issue below is error

41.223.117.77 178.79.154.208 2019-07-21 18:46:02 PID5d3488ba18c2b chris L2 sendsms # start uid:2 sender_id:[M-BET] smsc:[]
41.223.117.77 178.79.154.208 2019-07-21 18:46:02 PID5d3488ba18c2b chris L2 sendsms_queue_create # saving queue_code:15a866055375de17e9c22e23ccecec0d src:M-BET scheduled:2019-07-21 23:46:02
41.223.117.77 178.79.154.208 2019-07-21 18:46:02 PID5d3488ba18c2b chris L2 sendsms_queue_create # saved queue_code:15a866055375de17e9c22e23ccecec0d id:103
41.223.117.77 178.79.154.208 2019-07-21 18:46:02 PID5d3488ba18c2b chris L2 sendsms # dst_count:1 sms_count:1 total_charges:0.15
41.223.117.77 178.79.154.208 2019-07-21 18:46:02 PID5d3488ba18c2b chris L2 sendsms_queue_push # saving queue_code:15a866055375de17e9c22e23ccecec0d dst:260976198318
41.223.117.77 178.79.154.208 2019-07-21 18:46:02 PID5d3488ba18c2b chris L2 sendsms_queue_push # saved queue_code:15a866055375de17e9c22e23ccecec0d smslog_id:2286
41.223.117.77 178.79.154.208 2019-07-21 18:46:02 PID5d3488ba18c2b chris L2 sendsms # end queue_code:15a866055375de17e9c22e23ccecec0d queue_count:1 sms_count:1 failed_queue:0 failed_sms:0

    • 2019-07-21 18:46:02 PID5d3488bad8691 - L2 sendsmsd # start processing queue_code:15a866055375de17e9c22e23ccecec0d chunk:0 queue_count:1 sms_count:1 scheduled:2019-07-21 18:46:02 uid:2 gpid:0 sender_id:M-BET
    • 2019-07-21 18:46:02 PID5d3488bad8691 - L2 sendsmsd # sending queue_code:15a866055375de17e9c22e23ccecec0d smslog_id:2286 to:260976198318 sms_count:1 counter:1
    • 2019-07-21 18:46:02 PID5d3488bad8691 - L2 sendsms_process # start
    • 2019-07-21 18:46:02 PID5d3488bad8691 - L2 simplerate_hook_rate_cansend # allowed user uid:2 sms_to:260976198318 adhoc_credit:999.998 count:1 rate:0.150 charge:0.15 adhoc_balance:999.848
    • 2019-07-21 18:46:02 PID5d3488bad8691 - L2 sendsms # saving smslog_id:2286 u:2 parent_uid:0 g:0 gw:kannel smsc:routesms s:M-BET d:260976198318 type:text unicode:0 status:0
    • 2019-07-21 18:46:02 PID5d3488bad8691 - L2 sendsms_process # saved smslog_id:2286 id:2286
    • 2019-07-21 18:46:02 PID5d3488bad8691 - L2 simplerate_hook_rate_deduct # enter smslog_id:2286
    • 2019-07-21 18:46:02 PID5d3488bad8691 - L2 simplebilling_hook_billing_post # saving smslog_id:2286 rate:0.150 count:1 charge:0.15
    • 2019-07-21 18:46:02 PID5d3488bad8691 - L2 simplebilling_hook_billing_post # saved smslog_id:2286 id:2286
    • 2019-07-21 18:46:02 PID5d3488bad8691 - L2 sendsms_process # end
    • 2019-07-21 18:46:02 PID5d3488bad8691 - L2 sendsmsd # result queue_code:15a866055375de17e9c22e23ccecec0d to:260976198318 flag:1 smslog_id:2286
    • 2019-07-21 18:46:02 PID5d3488bad8691 - L2 sendsmsd # finish processing queue_code:15a866055375de17e9c22e23ccecec0d uid:2 sender_id:M-BET queue_count:1 sms_count:1
      178.79.154.208 178.79.154.208 2019-07-21 18:46:03 PID5d3488bb3995d - L2 kannel__call # start load:/var/www/html/criticalsms/plugin/gateway/kannel/dlr.php
      178.79.154.208 178.79.154.208 2019-07-21 18:46:03 PID5d3488bb3995d - L2 kannel__dlr # unable to process DLR. remote_addr:[178.79.154.208] or remote_host:[178.79.154.208] does not match with your bearerbox_host config:[localhost] smsc:[routesms]
      178.79.154.208 178.79.154.208 2019-07-21 18:46:10 PID5d3488c2997fc - L2 kannel__call # start load:/var/www/html/criticalsms/plugin/gateway/kannel/dlr.php
      178.79.154.208 178.79.154.208 2019-07-21 18:46:10 PID5d3488c2997fc - L2 kannel__dlr # unable to process DLR. remote_addr:[178.79.154.208] or remote_host:[178.79.154.208] does not match with your bearerbox_host config:[localhost] smsc:[routesms]