#
#
# artur #2014-11-11 18:57:09
PHP
# artur #, 2014-11-11 18:57:09

Does anyone work with SMSsync?

Hello!
I installed the application on smart smssync.ushahidi.com I uploaded the
sms.php file to the hosting, I drove the example code smssync.ushahidi.com/developers into it I
created a text.txt file with rights 777 in the root (for the duration of the test)
I set up the application , the secret key as in example 123456
I address like this:

http://сайт.ру/sms.php?from=номер отправителя&message=test&secret=123456&sent_to=номер получателя

3 lines fall into the text.txt file:
From: номер отправителя
Message: test
Sent to: номер получателя

The script outputs:
{"payload":{"success":true,"task":"send","secret":"123456","messages":[{"to":"номер получателя","message":"Your message has been received","uuid":"1ba368bd-c467-4374-bf28"}]}}{"payload":{"success":true,"error":null}}

Well, actually, that's all ...
SmsSync all this time gives out "Gateway is running"
in the logs, only the settings that I changed
the waiting list are empty
sent no
, and accordingly nothing goes anywhere
Help me figure it out, please

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg, 2015-01-22
@Sawell

Arthur, hello. Are you familiar with this service?

D
dobryshkin, 2015-08-08
@dobryshkin

I figured it out praying
, firstly, you need to enable auto-synchronization in the settings, check tasks, and if you need the result of sending the result API,
after that a message from the template will be sent to the number +0000000000 with each check of tasks.
in the send_task function, the message itself is formed,
and the get_sent_message_uuids function directly sends
it to fetch messages from mysql (example)

function send_task()
{
    /**
     * Comment the code below out if you want to send an instant
     * reply as SMS to the user.
     *
     * This feature requires the "Get reply from server" checked on SMSsync.
     */
    if (isset($_GET['task']) AND $_GET['task'] === 'send')
    {
  $q = mysql_query ('SELECT * FROM test WHERE status=0') or die (mysql_error());
  if (mysql_num_rows($q)>0){
  while($get = mysql_fetch_assoc($q)) {

        $message = $get['msg'];
        //$f = "+000-000-0000";
        $to = $get['phone'];
        $seccess = "true";
    $uuid = $get['msg_id'];
        $reply[] = [
            "to" => $to,
            "message" => $message,
            "uuid" => $uuid
        ];
    mysql_query('UPDATE test SET status=1 WHERE msg_id="'.$uuid.'"');
        // Send JSON response back to SMSsync
  }
        $response = json_encode(
            ["payload"=>[
                "success"=>$seccess,
                "task"=>"send",
                "secret" => "123456",
                "messages"=>array_values($reply)]
            ]);
        send_response($response);

    }
}
}

further, as far as I understand send_messages_uuids_for_sms_delivery_report to
create messages in the application itself in the pending / sent tab, if this function is turned off in the application and everything is empty, even if sending is successful , otherwise it will come empty)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question