| Server IP : 10.200.247.200 / Your IP : 216.73.217.19 Web Server : Apache System : Linux synergy-usa-sites 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64 User : jeremy ( 1001) PHP Version : 8.4.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/usa_sites/vx_testing/lib/ |
Upload File : |
<?php
function send_text($phone, $message) {
return false;
/*
send $message to $phone as a text
returns object:
stdClass Object
(
[custom_ticket] =>
[error_code] => 0
[message] => Message request received.
[result] => 1
[transaction_ticket] => B718D91D-0D2B-2853-573B-B7B37D0846B3-668338
)
result is 1 or 0 if it was successful
transaction_ticket is a unique id to check on the status
*/
include_once($_SERVER['DOCUMENT_ROOT'].'/vx/lib/mysql.php');
$txtwire_db = new MySQL('db.syndbs.com', 'lc2user', 'SYN57CRUZ', 'txtwire');
//check do not call list
$is_there = $txtwire_db->get_results("SELECT phone FROM do_not_call.phone WHERE phone='".$txtwire_db->clean($phone)."'");
if(!empty($is_there)) {
return 'do_not_call';
}
$wsdl = 'https://api.txtwire.com/webservices/?version=2.0.0&wsdl';
$soap = new SoapClient($wsdl,array('ssl_method'=>'SOAP_SSL_METHOD_SSLv23'));
//create an authentication object
$auth = array();
$auth['username'] = 'synergy';
$auth['password'] = 'password123!';
$auth['api_key'] = 'eea2ebc6bdc5fb5535c9ac162b68bb59474d6973';
//$auth['code'] = '4355621177'; //This one got blocked for spam
//$auth['code'] = '4355621179'; //This one also got blocked for spam
$auth['code'] = '8448889007';
$auth['keyword'] = 'WCQP5F';
$recipient = array();
$recipient['recipients'][] = array(
'sendTo' => ((strlen($phone)==10) ? '1'.$phone : $phone),
'type' => 1, //SMS
'carrier' => '',
'country' => 'US',
'locale' => 'EN-US',
'message' => '',
'customfields' => array()
);
try {
//mail('jeremy@synergytpsreports.com,hanskirchhausen@gmail.com','txtwire debug',print_r($auth,true).print_r($message,true).print_r($recipient,true),"From:noreply@surfcrm.com\r\n");
$results = $soap->sendMessageSpecifyLocale($auth, $message, $recipient, '', 'https://surfcrm.com/bin/ajax/insert_text_sent_status.php?account=usa');
$txtwire_id = $results->transaction_ticket;
$txtwire_db->query("INSERT INTO txtwire.sent_texts
(
phone
,text_body
,ts
,txtwire_id
,first_status
,from_group
) VALUES (
'".$txtwire_db->clean(preg_replace('/[^0-9]/','',$phone))."'
,'".$txtwire_db->clean($message)."'
,NOW()
,'".$txtwire_db->clean($txtwire_id)."'
,'".$txtwire_db->clean($results->message)."'
,'usa'
)");
} catch (Exception $e) {
$results = false;
}
if(!empty($results)) {
if ($results->result == 0 || $results->error > 0) {
$send_error = file_get_contents('https://surfcrm.com/bin/ajax/insert_text_error.php?phone='.urlencode($phone).'&account=usa&code='.urlencode($auth['code']).'&message='.urlencode($message).'&error_code='.urlencode($results->error).'&error='.urlencode($results->message));
}
}
return $results;
}
function fetch_responses($start_time, $end_time) {
/*
grabs all texts sent to us between $start_time and $end_time
returns object:
stdClass Object
(
[error_code] => 0
[message] => Successfully retrieved inbound messages report.
[response] => stdClass Object
(
[messagelist] => Array
(
[0] => stdClass Object
(
[code] => 8019803888
[group] => ATM Title Loans > API Division (DO NOT DELETE) > API Group
[message] => I have just $80 I know its not all of it but I can do the rest next week here is my new card 5311 0832 5264 8414 1218 code on back of card is 968
[phone] => 14357725043
[timestamp] => 01/14/2015 2:10 PM
)
[1] => stdClass Object
(
[code] => 8019803888
[group] => ATM Title Loans > API Division (DO NOT DELETE) > API Group
[message] => Will you take $1000 and call it paid in full if I brought you $1000 today?
[phone] => 14357737543
[timestamp] => 01/15/2015 1:07 PM
)
)
)
[result] => 1
)
result is 1 or 0 if it was successful
*/
$wsdl = 'https://api.txtwire.com/webservices/?version=2.0.0&wsdl';
$soap = new SoapClient($wsdl, array('trace'=>1,'ssl_method'=>'SOAP_SSL_METHOD_SSLv23'));
//create an authentication object
$auth = array();
$auth['username'] = 'synergy';
$auth['password'] = 'password123!';
$auth['api_key'] = 'eea2ebc6bdc5fb5535c9ac162b68bb59474d6973';
//$auth['code'] = '4355621177'; //This one got blocked for spam
//$auth['code'] = '4355621179';
$auth['code'] = '8448889007';
$auth['keyword'] = 'WCQP5F';
$start_date = date('m/d/Y H:i:s',strtotime($start_time));
$end_date = date('m/d/Y H:i:s',strtotime($end_time));
$timezone = 'MST';
try {
$results = $soap->inboundMessages($auth,$start_date,$end_date,$timezone);
/*if(!empty($results->response->messagelist)) {
mail('jeremy@synergytpsreports.com,hanskirchhausen@gmail.com','txtwire import debug',print_r($auth,true).print_r($results,true),"From:noreply@surfcrm.com\r\n");
}*/
} catch (Exception $e) {
$results = array();
print_r($e);
print_r($soap->__getLastResponse());
}
return $results;
}