When sending SMS using Twilio, credits do not change

Insert that instead, its from the log

Focus to try to find solution why your playSMS not saving info to db table twilio, once that fixed then credit and other things related to it will be fixed too

Hi, Anton! Just moment

Try this one:

INSERT INTO playsms_gatewayTwilio (local_smslog_id,remote_smslog_id,status,error_text) VALUES ('56692','SM2beda4c820274a678346287f320734ae','queued','queued||');

ah there you go, change the status field type to varchar(20)

run this:

DROP TABLE IF EXISTS `playsms_gatewayTwilio`;
CREATE TABLE `playsms_gatewayTwilio` (
  `c_timestamp` bigint(20) NOT NULL DEFAULT '0',
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `local_smslog_id` int(11) NOT NULL DEFAULT '0',
  `remote_smslog_id` varchar(40) NOT NULL DEFAULT '0',
  `status` varchar(20) NOT NULL DEFAULT '',
  `error_text` varchar(100) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

yes, drop the db table and re-create (you’re helping me testing it too)

anton

Log output:
192.168.100.216 smsd.uz 2019-04-03 16:22:30 PID5ca4ddc668989 tr7 L2 sendsms # start uid:17 sender_id:[SMSd] smsc:
192.168.100.216 smsd.uz 2019-04-03 16:22:30 PID5ca4ddc668989 tr7 L3 sendsms # maxlen:3672 footerlen:5 footer:[ @tr7] msglen:41 message:[Hi Kevin! SMSd, a service for sending SMS]
192.168.100.216 smsd.uz 2019-04-03 16:22:30 PID5ca4ddc668989 tr7 L2 sendsms_queue_create # saving queue_code:c7690edb222204b832f41deaea9dfaf8 src:SMSd scheduled:2019-04-03 16:22:30
192.168.100.216 smsd.uz 2019-04-03 16:22:30 PID5ca4ddc668989 tr7 L2 sendsms_queue_create # saved queue_code:c7690edb222204b832f41deaea9dfaf8 id:54792
192.168.100.216 smsd.uz 2019-04-03 16:22:30 PID5ca4ddc668989 tr7 L3 sendsms_manipulate_prefix # before prefix manipulation:[+998935217698]
192.168.100.216 smsd.uz 2019-04-03 16:22:30 PID5ca4ddc668989 tr7 L3 sendsms_manipulate_prefix # after prefix manipulation:[+998935217698]
192.168.100.216 smsd.uz 2019-04-03 16:22:30 PID5ca4ddc668989 tr7 L3 simplerate_hook_rate_getbyprefix # rate not found to:+998935217698 default_rate:0.01
192.168.100.216 smsd.uz 2019-04-03 16:22:30 PID5ca4ddc668989 tr7 L3 simplerate_hook_rate_getcharges # uid:17 u:tr7 len:46 unicode:0 to:+998935217698 enable_credit_unicode:0 count:1 rate:0.01 charge:0.01
192.168.100.216 smsd.uz 2019-04-03 16:22:30 PID5ca4ddc668989 tr7 L2 sendsms # dst_count:1 sms_count:1 total_charges:0.01
192.168.100.216 smsd.uz 2019-04-03 16:22:30 PID5ca4ddc668989 tr7 L2 sendsms_queue_push # saving queue_code:c7690edb222204b832f41deaea9dfaf8 dst:+998935217698
192.168.100.216 smsd.uz 2019-04-03 16:22:30 PID5ca4ddc668989 tr7 L2 sendsms_queue_push # saved queue_code:c7690edb222204b832f41deaea9dfaf8 smslog_id:56696
192.168.100.216 smsd.uz 2019-04-03 16:22:30 PID5ca4ddc668989 tr7 L2 sendsms # end queue_code:c7690edb222204b832f41deaea9dfaf8 queue_count:1 sms_count:1 failed_queue:0 failed_sms:0

    • 2019-04-03 16:22:31 PID5ca4ddc752241 - L2 sendsmsd # start processing queue_code:c7690edb222204b832f41deaea9dfaf8 chunk:0 queue_count:1 sms_count:1 scheduled:2019-04-03 16:22:30 uid:17 gpid:0 sender_id:SMSd
    • 2019-04-03 16:22:31 PID5ca4ddc752241 - L2 sendsmsd # sending queue_code:c7690edb222204b832f41deaea9dfaf8 smslog_id:56696 to:+998935217698 sms_count:1 counter:1
    • 2019-04-03 16:22:31 PID5ca4ddc752241 - L3 sendsms_intercept # msgtemplate modified sms_sender:[SMSd] sms_footer:[@tr7] sms_to:[+998935217698] sms_msg:[Hi Kevin! SMSd, a service for sending SMS] uid:[17] gpid:[0] sms_type:[text] unicode:[0] queue_code:[c7690edb222204b832f41deaea9dfaf8] smsc:
    • 2019-04-03 16:22:31 PID5ca4ddc752241 - L3 outgoing_hook_sendsms_intercept # found SMSCs:[twilio]
    • 2019-04-03 16:22:31 PID5ca4ddc752241 - L3 outgoing_hook_sendsms_intercept # using prefix based smsc smsc:[twilio] uid:17 parent_uid:0 from:SMSd to:+998935217698
    • 2019-04-03 16:22:31 PID5ca4ddc752241 - L3 sendsms_intercept # outgoing modified sms_sender:[SMSd] sms_footer:[@tr7] sms_to:[+998935217698] sms_msg:[Hi Kevin! SMSd, a service for sending SMS] uid:[17] gpid:[0] sms_type:[text] unicode:[0] queue_code:[c7690edb222204b832f41deaea9dfaf8] smsc:[twilio]
    • 2019-04-03 16:22:31 PID5ca4ddc752241 - L2 sendsms_process # start
    • 2019-04-03 16:22:31 PID5ca4ddc752241 - L3 simplerate_hook_rate_getbyprefix # rate not found to:+998935217698 default_rate:0.01
    • 2019-04-03 16:22:31 PID5ca4ddc752241 - L3 simplerate_hook_rate_getcharges # uid:17 u:tr7 len:46 unicode:0 to:+998935217698 enable_credit_unicode:0 count:1 rate:0.01 charge:0.01
    • 2019-04-03 16:22:31 PID5ca4ddc752241 - L2 simplerate_hook_rate_cansend # allowed user uid:17 sms_to:+998935217698 adhoc_credit:0.1 count:1 rate:0.01 charge:0.01 adhoc_balance:0.09
    • 2019-04-03 16:22:31 PID5ca4ddc752241 - L2 sendsms # saving smslog_id:56696 u:17 parent_uid:0 g:0 gw:twilio smsc:twilio s:SMSd d:+998935217698 type:text unicode:0 status:0
    • 2019-04-03 16:22:31 PID5ca4ddc752241 - L2 sendsms_process # saved smslog_id:56696 id:54274
    • 2019-04-03 16:22:31 PID5ca4ddc752241 - L3 sendsms # final smslog_id:56696 gw:twilio smsc:twilio message:Hi Kevin! SMSd, a service for sending SMS @tr7 len:46
    • 2019-04-03 16:22:31 PID5ca4ddc752241 - L3 twilio_hook_sendsms # enter smsc:twilio smslog_id:56696 uid:17 to:+998935217698
    • 2019-04-03 16:22:31 PID5ca4ddc752241 - L3 twilio_hook_sendsms # sendsms start
    • 2019-04-03 16:22:33 PID5ca4ddc752241 - L2 twilio_hook_sendsms # sent smslog_id:56696 message_id:SM1aed8f1672704b94ae502f68196bb495 status:queued error:queued|| smsc:[twilio]
    • 2019-04-03 16:22:33 PID5ca4ddc752241 - L2 twilio_hook_sendsms # db_query:[ INSERT INTO playsms_gatewayTwilio (local_smslog_id,remote_smslog_id,status,error_text) VALUES (‘56696’,‘SM1aed8f1672704b94ae502f68196bb495’,‘queued’,‘queued||’)]
    • 2019-04-03 16:22:33 PID5ca4ddc752241 - L3 dlr # isdlrd:1 smslog_id:56696 p_status:0 uid:17
    • 2019-04-03 16:22:33 PID5ca4ddc752241 - L3 twilio_hook_sendsms # sendsms end
    • 2019-04-03 16:22:33 PID5ca4ddc752241 - L2 simplerate_hook_rate_deduct # enter smslog_id:56696
    • 2019-04-03 16:22:33 PID5ca4ddc752241 - L3 simplerate_hook_rate_getbyprefix # rate not found to:+998935217698 default_rate:0.01
    • 2019-04-03 16:22:33 PID5ca4ddc752241 - L3 simplerate_hook_rate_getcharges # uid:17 u:tr7 len:46 unicode:0 to:+998935217698 enable_credit_unicode:0 count:1 rate:0.01 charge:0.01
    • 2019-04-03 16:22:33 PID5ca4ddc752241 - L2 simplebilling_hook_billing_post # saving smslog_id:56696 rate:0.01 count:1 charge:0.01
    • 2019-04-03 16:22:33 PID5ca4ddc752241 - L2 simplebilling_hook_billing_post # saved smslog_id:56696 id:54092
    • 2019-04-03 16:22:33 PID5ca4ddc752241 - L3 simplerate_hook_rate_deduct # deduct successful uid:17 parent_uid:0 smslog_id:56696
    • 2019-04-03 16:22:33 PID5ca4ddc752241 - L2 sendsms_process # end
    • 2019-04-03 16:22:33 PID5ca4ddc752241 - L2 sendsmsd # result queue_code:c7690edb222204b832f41deaea9dfaf8 to:+998935217698 flag:1 smslog_id:56696
    • 2019-04-03 16:22:33 PID5ca4ddc752241 - L2 sendsmsd # finish processing queue_code:c7690edb222204b832f41deaea9dfaf8 uid:17 sender_id:SMSd queue_count:1 sms_count:1
      192.168.100.216 smsd.uz 2019-04-03 16:22:34 PID5ca4ddca0de54 - L2 twilio__callback # pushed SmsSid:SM1aed8f1672704b94ae502f68196bb495 SmsStatus:sent MessageStatus:sent To:+998935217698 MessageSid:SM1aed8f1672704b94ae502f68196bb495 AccountSid:ACf62145b6e01b6acedab929d05cfe6b61 From:+447480784589 ApiVersion:2010-04-01
      192.168.100.216 smsd.uz 2019-04-03 16:22:34 PID5ca4ddca0de54 - L2 twilio__callback # dlr uid:17 smslog_id:56696 message_id:SM1aed8f1672704b94ae502f68196bb495 status:sent
      192.168.100.216 smsd.uz 2019-04-03 16:22:34 PID5ca4ddca0de54 - L3 dlr # isdlrd:1 smslog_id:56696 p_status:1 uid:17
    • 2019-04-03 16:22:34 PID5ca4b4c894901 - L3 dlrd # id:105318 smslog_id:56696 p_status:0 uid:17
    • 2019-04-03 16:22:34 PID5ca4b4c894901 - L3 dlrd # id:105319 smslog_id:56696 p_status:1 uid:17
    • 2019-04-03 16:22:34 PID5ca4b4c894901 - L2 simplebilling__finalize # saving smslog_id:56696
    • 2019-04-03 16:22:34 PID5ca4b4c894901 - L2 simplebilling__finalize # saved smslog_id:56696

BINGO!
sdfaasdf

before and after:

use below to check table:

explain playsms_gatewayTwilio;

nice! so its solved, committing changes now

Everything is super! Anton, do you have a telegram?