public function testSendFaxSendBroadcast()
 {
     //needs actual connection
     //replace with valid username and password
     $client = new MonopondSOAPClientV2("user", "password", MPENV::Local);
     $filedata = fread(fopen("./tests/sample.txt", "r"), filesize("./tests/sample.txt"));
     $filedata = base64_encode($filedata);
     // TODO: Setup Document
     $document = new MonopondDocument();
     $document->FileName = "AnyFileName1.txt";
     $document->FileData = $filedata;
     $document->Order = 0;
     // TODO: Setup FaxMessage
     $faxMessage = new MonopondFaxMessage();
     $faxMessage->MessageRef = "Testing-message-1";
     $faxMessage->SendTo = "61011111111";
     $faxMessage2 = new MonopondFaxMessage();
     $faxMessage2->MessageRef = "Testing-message-2";
     $faxMessage2->SendTo = "61011111111";
     // TODO: Setup FaxSendRequest
     $sendFaxRequest = new MonopondSendFaxRequest();
     $sendFaxRequest->BroadcastRef = "Broadcast-test-1";
     $sendFaxRequest->SendRef = "Send-Ref-1";
     $sendFaxRequest->FaxMessages[] = $faxMessage;
     $sendFaxRequest->FaxMessages[] = $faxMessage2;
     $sendFaxRequest->Documents = array($document);
     $sendFaxRequest->SendFrom = "Test Fax";
     // Call send fax method
     $sendRespone = $client->sendFax($sendFaxRequest);
     // print_r($sendRespone);
 }
示例#2
0
$faxMessage2->SendFrom = "Test Fax 2";
$faxMessage2->Resolution = "normal";
$faxMessage2->Retries = 0;
$faxMessage2->BusyRetries = 2;
$faxMessage2->CLI = 61011111111;
/* Setup FaxSendRequest (Each contains an array of fax messages) */
$sendFaxRequest = new MonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "Broadcast-test-1";
$sendFaxRequest->SendRef = "Send-Ref-1";
$sendFaxRequest->HeaderFormat = "Testing";
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->FaxMessages[] = $faxMessage2;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->CLI = 3456;
/* Send request to Monopond */
$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */
print_r($sendRespone);
/* Setup FaxStatusRequest */
$faxStatusRequest = new MonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "test-2-1-1";
$faxStatusRequest->Verbosity = "all";
/* Send request to Monopond */
$faxStatus = $client->faxStatus($faxStatusRequest);
/* Display response */
print_r($faxStatus);
/* Setup StopFaxRequest */
$stopFaxRequest = new MonopondStopFaxRequest();
$stopFaxRequest->MessageRef = "test-2-2-1";
/* Send request to Monopond */
$stopFax = $client->resumeFax($stopFaxRequest);