Inbox displays incorrect date on received messages

Hello Anton and group,

I just realized that when i receive a incoming message it is stored but with a wrong date. The log shows the date correctly but while checking the inbox is displaying a wrong date.

What could i check to fix this?

Thanks.

104.155.4.54 sms.linkedip.com 2016-03-10 10:25:27 PID56e14b977dd30 - L2 telerivet__callback # pushed secret:myS3cr3t2015 service_id:SVea669f36b8c9d3b5 context:message event:incoming_message contact:Array state:Array id:SM05331230ae0f9b98 phone_id:PNa18683c7de3a2740 contact_id:CTc387878491b5ea40 direction:incoming status:processing message_type:sms source:provider time_created:1457622070 from_number:19546087693 to_number:13056771049 content:Reply test starred:0 simulated:0 external_id:03000000DD0D8E8F project_id:PJc9f8f5dfc57b7146 phone:Array from_number_e164:+19546087693
104.155.4.54 sms.linkedip.com 2016-03-10 10:25:27 PID56e14b977dd30 - L2 telerivet__callback # incoming smsc:telerivet message_id: s:19546087693 d:13056771049

    • 2016-03-10 10:25:27 PID56da221586518 - L2 recvsms_inbox_add # saving sender:19546087693 receiver:13056771049 target:mtavera reference_id:
    • 2016-03-10 10:25:27 PID56da221586518 - L2 recvsms_inbox_add # saved id:41 sender:19546087693 receiver:13056771049 target:mtavera

can you have a look at the database in the outgoing-tables, which date is stored there?

Hey Andre, thanks for replying.
Yes, the table playsms_tblincoming shows exactly the same data “1970-01-01”.

    0 |    46 |            0 |      1 | incoming   | telerivet  | 13052067439 | 13056771049 |            | Stop                                                                                                                                                   | 1970-01-01 05:00:00 |         0 |

| 0 | 47 | 0 | 1 | incoming | telerivet | 13052137461 | 13056771049 | | STOP | 1970-01-01 05:00:00 | 0 |
| 0 | 48 | 0 | 1 | incoming | telerivet | 19546087693 | 13056771049 | | Reply test | 1970-01-01 05:00:00 | 0 |
| 0 | 49 | 0 | 1 | incoming | telerivet | 19546087693 | 13056771049 | | Reply test 3/10 10:21 am | 1970-01-01 05:00:00 | 0 |
±------------±------±-------------±-------±-----------±-----------±------------±------------±-----------±-------------------------------------------------------------------------------------------------------------------------------------------------------±--------------------±----------+

I really don’t get it.

on a first view everything looks fine. but i saw on github there was a correction for telerivet and receive_sms. do you have an older version installed?
maybe that will fix it. but it is just a guess, not knowing…

Hi Andre,

Thanks for your reply. I’m on 1.3.1.

i have only one idea:
in tele* gateway the following variables are set:
if ($_POST['event'] == 'incoming_message') { $c_smsc = 'telerivet'; $c_remote_id = $_POST['id']; $c_message_type = $_POST['message_type']; $c_content = htmlspecialchars_decode(urldecode($_POST['content'])); $c_from_number = $_POST['from_number']; $c_to_number = $_POST['to_number']; $c_time_created = $_POST['time_created']; $c_time_sent = $_POST['time_sent']; $c_contact_id = $_POST['contact_id']; $c_phone_id = $_POST['phone_id']; $c_service_id = $_POST['service_id']; $c_project_id = $_POST['project_id']; # Convert timestamp to datetime $c_time = date('Y-m-d H:i:s', $c_time_sent); logger_print("incoming smsc:" . $c_smsc . " message_id:" . $c_remote_slid . " s:" . $c_from_number . " d:" . $c_to_number, 2, "telerivet callback"); $c_from_number = addslashes($c_from_number); $c_content = addslashes($c_content); recvsms($c_time, $c_from_number, $c_content, $c_to_number, $c_smsc);

=> used value is c_time, which is created from c_time_sent. from gateway two values are “expected”(?):
$c_time_created = $_POST[‘time_created’];
$c_time_sent = $_POST[‘time_sent’];

can you check, which variable is overgiven by your gateway? maybe changing the callback.php from
$c_time = date(‘Y-m-d H:i:s’, $c_time_sent);
to
$c_time = date(‘Y-m-d H:i:s’, $c_time_created);

will solve the issue.

regards,
andre

Hey Andre!

Thanks a lot. It did work!!!

Hmm
It’s working now but i just realized it’s not using my servers time but something else time. It is good because now there is at least a date recorded but the time is not correct. What could it be now?

i guess timezone settings are not reflected. please do me a favour and open a bug, so the root cause might be fixed by someone who has more knowledge of that gateway. and maybe someone (at least anton?) knows immediately where to look for timezone things.

regards,
andre

Hi sure. Where do i open bugs? is there a bug tracker portal?