//ini_set('display_errors', true);
require 'mmsoap/MMSoap.php';
// get credentials
require 'credentials.php';
/*
// if you don't want to use the credetials import, just use the below variables 
// Set up account details
$username = '******';
$password = '******';

// http://www.acma.gov.au/Citizen/Consumer-info/All-about-numbers/Special-numbers/fictitious-numbers-for-radio-film-and-television-i-acma
$recipient = "+61491570156";
*/
require 'getStdin.php';
// Create new MMSoap class
$soap = new MMSoap($username, $password, $options);
echo "** Do you want to send a message to {$recipient}, y followed by ENTER to send, or ENTER to skip.\n";
if (getStdin("y")) {
    // send the message
    $response = $soap->sendMessage($recipient, "messagemedia-php: please reply & press Enter on example when done.");
    if ($response instanceof SoapFault) {
        exit('Error: ' . $response->getMessage());
    }
    $result = $response->getResult();
    echo $result->sent . ' sent / ' . $result->scheduled . ' scheduled / ' . $result->failed . " failed\n\n";
    // message has been sent, give the user time to reply
    echo "Please reply to the message you just received and hit ENTER.\n";
    getStdin("");
}
echo "** Check for replies\n";
$response = $soap->getReplies();
Exemplo n.º 2
0
// Set up sendMessage parameters
// http://www.acma.gov.au/Citizen/Consumer-info/All-about-numbers/Special-numbers/fictitious-numbers-for-radio-film-and-television-i-acma
$recipients = array('+61491570156');
$origin = "+61491570157";
$message = 'Hello from messagemedia-php!';
// for scheduled messages lets schedule a message 1 minte in the future
$oneMinuteInTheFuture = mktime(date("H"), date("i") + 1, date("s"), date("m"), date("d"), date("Y"));
// Capture the wsdl host
//$host = parse_url(WsdlClass::VALUE_WSDL_URL, PHP_URL_HOST);
// Set up stream context Server Name Indication (SNI) for use with proxy and HTTPS
//$opts = array('ssl' => array('SNI_server_name' => $host,'SNI_enabled' => TRUE));
//$context = stream_context_create($opts);
// Set up SOAP Options
$options = array();
// Create new MMSoap class
$soap = new MMSoap($username, $password, $options);
// Check user info
echo "\n** User Info\n";
$response = $soap->getUserInfo();
if ($response instanceof SoapFault) {
    exit('Error: ' . $response->getMessage());
}
$result = $response->getResult();
$accountDetails = $result->accountDetails;
echo 'Account type: ' . $accountDetails->type . "\n";
echo $result->accountDetails->creditRemaining . " credits remaining\n";
// Send messages using rotary
echo "\n** Send Messages using rotary\n";
echo "Sending '{$message}' to " . implode(', ', $recipients) . "\n";
// Example of sending a message
$response = $soap->sendMessages($recipients, $message);
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Uncomment the following line for debugging information
//ini_set('display_errors', true);
require 'mmsoap/MMSoap.php';
// user credentials
require 'credentials.php';
/*
// if you don't want to use the credetials import, just use the below variables 
// Set up account details
$username = '******';
$password = '******';

// http://www.acma.gov.au/Citizen/Consumer-info/All-about-numbers/Special-numbers/fictitious-numbers-for-radio-film-and-television-i-acma
$recipient = "+61491570156";
*/
// Create new MMSoap class
$soap = new MMSoap($username, $password, $options);
// Check user info
echo "\n** User Info\n";
$response = $soap->getUserInfo();
if ($response instanceof SoapFault) {
    exit('Error: ' . $response->getMessage());
}
$result = $response->getResult();
$accountDetails = $result->accountDetails;
echo 'Account type: ' . $accountDetails->type . "\n";
echo $result->accountDetails->creditRemaining . " credits remaining\n";
$username = '******';
$password = '******';

// http://www.acma.gov.au/Citizen/Consumer-info/All-about-numbers/Special-numbers/fictitious-numbers-for-radio-film-and-television-i-acma
$recipient = "+61491570156";
*/
// Set up sendMessage parameters
// http://www.acma.gov.au/Citizen/Consumer-info/All-about-numbers/Special-numbers/fictitious-numbers-for-radio-film-and-television-i-acma
$recipients = array($recipient);
// MessageId array matches each recipient. i.e. 61491570156 will match 24.
$messageIds = array('24');
$origin = "+61491570157";
// for scheduled messages lets schedule a message 1 minte in the future
$oneMinuteInTheFuture = mktime(date("H"), date("i") + 1, date("s"), date("m"), date("d"), date("Y"));
// Create new MMSoap class
$soap = new MMSoap($username, $password, $options);
// Send a simple message
$recipient = $recipients[0];
echo "\n** Send Messages\n";
echo "Sending message to {$recipient}\n";
$response = $soap->sendMessage($recipient, "messagemedia-php: simple message");
if ($response instanceof SoapFault) {
    exit('Error: ' . $response->getMessage());
}
$result = $response->getResult();
echo $result->sent . ' sent / ' . $result->scheduled . ' scheduled / ' . $result->failed . " failed\n";
// Example sending a more complex request
// - scheduled
// - source number
// - delivery report
// - sequence number
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Uncomment the following line for debugging information
//ini_set('display_errors', true);
require 'mmsoap/MMSoap.php';
// get credentials
require 'credentials.php';
// Set up sendMessage parameters
// http://www.acma.gov.au/Citizen/Consumer-info/All-about-numbers/Special-numbers/fictitious-numbers-for-radio-film-and-television-i-acma
$recipients = array($recipient);
// MessageId array matches each recipient. i.e. 61491570156 will match 24.
$messageIds = array('24');
$origin = "+61491570157";
// Create new MMSoap class
$soap = new MMSoap($username, $password, $options);
// Example sending a more complex request
// - scheduled
// - source number
// - delivery report
// - sequence number
// - message ids
// - message send mode
echo "\nTesting sending messages to " . implode(', ', $recipients) . "\n";
$sequenceNumber = 10;
$response1 = $soap->sendMessages($recipients, "messagemedia-php: drop random", null, $origin, TRUE, $sequenceNumber, $messageIds, 'dropAll');
$sequenceNumber++;
$response2 = $soap->sendMessages($recipients, "messagemedia-php: dropAllWithErrors", null, $origin, TRUE, $sequenceNumber, $messageIds, 'dropAllWithErrors');
$sequenceNumber++;
$response3 = $soap->sendMessages($recipients, "messagemedia-php: dropAllWithSuccess", null, $origin, TRUE, $sequenceNumber, $messageIds, 'dropAllWithSuccess');
if ($response1 instanceof SoapFault) {
//ini_set('display_errors', true);
require 'mmsoap/MMSoap.php';
// get credentials
require 'credentials.php';
/*
// if you don't want to use the credetials import, just use the below variables 
// Set up account details
$username = '******';
$password = '******';

// http://www.acma.gov.au/Citizen/Consumer-info/All-about-numbers/Special-numbers/fictitious-numbers-for-radio-film-and-television-i-acma
$recipient = "+61491570156";
*/
require 'getStdin.php';
// Create new MMSoap class
$soap = new MMSoap($username, $password, $options);
echo "** Do you want to send a message to {$recipient}, y followed by ENTER to send, or ENTER to skip.\n";
if (getStdin("y")) {
    echo "** Send message to {$recipient}\n";
    // send the message
    $response = $soap->sendMessages(array($recipient), "messagemedia-php: msg with report", null, null, TRUE);
    if ($response instanceof SoapFault) {
        exit('Error: ' . $response->getMessage());
    }
    $result = $response->getResult();
    echo $result->sent . ' sent / ' . $result->scheduled . ' scheduled / ' . $result->failed . " failed\n\n";
    // sleep a little bit to give the message time to be delivered
    sleep(5);
}
echo "** Check for reports\n";
$response = $soap->getReports();
Exemplo n.º 7
0
// Set up sendMessage parameters
// http://www.acma.gov.au/Citizen/Consumer-info/All-about-numbers/Special-numbers/fictitious-numbers-for-radio-film-and-television-i-acma
$recipients = array('+61491570156');
$origin = "+61491570157";
$message = 'Hello from messagemedia-php!';
// for scheduled messages lets schedule a message 1 minte in the future
$oneMinuteInTheFuture = mktime(date("H"), date("i") + 1, date("s"), date("m"), date("d"), date("Y"));
// Capture the wsdl host
//$host = parse_url(WsdlClass::VALUE_WSDL_URL, PHP_URL_HOST);
// Set up stream context Server Name Indication (SNI) for use with proxy and HTTPS
//$opts = array('ssl' => array('SNI_server_name' => $host,'SNI_enabled' => TRUE));
//$context = stream_context_create($opts);
// Set up SOAP Options
$options = array();
// Create new MMSoap class
$soap = new MMSoap($username, $password, $options);
// Check user info
echo "\n** User Info\n";
$response = $soap->getUserInfo();
if ($response instanceof SoapFault) {
    exit('Error: ' . $response->getMessage());
}
$result = $response->getResult();
$accountDetails = $result->accountDetails;
echo 'Account type: ' . $accountDetails->type . "\n";
echo $result->accountDetails->creditRemaining . " credits remaining\n";
// Send messages using rotary
echo "\n** Send Messages using rotary\n";
echo "Sending '{$message}' to " . implode(', ', $recipients) . "\n";
// Example of sending a message
$response = $soap->sendMessages($recipients, $message);