This Question is Possibly Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
2 Replies Last post: Nov 1, 2009 6:20 PM by Vic W  
Sunil Kartikey Newbie 1 posts since
Sep 1, 2009
Currently Being Moderated

Oct 30, 2009 9:58 AM

Problem in implementing Voice TTS PHP

  I have been successful in integrating SMS and Email parts of the API
with JobSubmit call. But facing issues with Voice jobs.

I am using PHP for the development. Please check below information and
let me know.

Also do you have any sample for voice job submit in php ?

XML which i have captured from WireShark:-

<?xml  version="1.0" encoding="UTF-8" ?>
- <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://premconn.premiereconnect.com/2007/02">
- <SOAP-ENV:Header>
- <ns1:Request>
<ns1:ReceiverKey>http://xoa.pt.premiereglobal.com/soap/sync</ns1:ReceiverKey>
- <ns1:Authentication>
- <ns1:XDDSAuth>
<ns1:RequesterID>user</ns1:RequesterID>
<ns1:Password>pass</ns1:Password>
</ns1:XDDSAuth>
</ns1:Authentication>
</ns1:Request>
</SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <ns1:JobSubmitRequest>
- <ns1:DocumentSet>
- <ns1:Document ref="DocRef0">
<ns1:DocType>unspec</ns1:DocType>
<ns1:DocData format="text" />
</ns1:Document>
</ns1:DocumentSet>
- <ns1:Message>
- <ns1:JobOptions>
<ns1:BillingCode>XOA MessageREACH Job</ns1:BillingCode>
<ns1:CustomerReference>Voice Job from Premiere Connect</ns1:CustomerReference>
- <ns1:VoiceOptions>
<ns1:VoiceDeliveryMethod>PAMD</ns1:VoiceDeliveryMethod>
<ns1:ANI>555</ns1:ANI>
</ns1:VoiceOptions>
</ns1:JobOptions>
- <ns1:Destinations>
- <ns1:Voice ref="Testing">
<ns1:Phone>0750000000</ns1:Phone>
</ns1:Voice>
</ns1:Destinations>
- <ns1:Contents>
- <ns1:Part>
- <ns1:Document>
<ns1:DocType>unspec</ns1:DocType>
</ns1:Document>
</ns1:Part>
</ns1:Contents>
</ns1:Message>
</ns1:JobSubmitRequest>

[ ERROR: Un recognized text ]



This is my jobsubmit function

public function jobSubmitText2Voice($recipient) {
    $voice="Hello, We're testing a new provider and you've been selected as a test subject. Thanks for volunteering!";
        $voice=array("format" => "text");
        $report=array("DeliveryReport"=>array("DeliveryReportType"=>"detail","ReportAddress"=>"MBOX"),"ReportTemplate"=>"me_default");
     $params = array("JobSubmitRequest" => array(
                      "DocumentSet" => array( "Document" => array("ref" => "DocRef0", "DocType" => "unspec","SosObject" => "tts_insert","DocData" => $voice)),
                        "Message" => array("Report"=>$report,
                                "JobOptions" => array(
                                        "BillingCode" => "XOA MessageREACH Job",
                                        "CustomerReference" => "Voice Job from Premiere Connect",
                                        "VoiceOptions" => array("VoiceDeliveryMethod" => "PAMD","ANI" => "555")),
                                "Destinations" => array("Voice" => array(
                                        "ref" => "Testing",
                                //      "InsertList" => array("number" => "1","Insert" => $data),
                                        "Phone" => "$recipient")),
                                "Contents" => array("Part" => array("Document" => array("DocRef" => "DocRef0","DocType" => "unspec","Treatment" => "voice_all"))))));

 

              print_r($params);

 

              return $this->_soapCall("JobSubmit", $params);
     }

 


Please let me know if i am missing something here.

Thanks
Sunil
Vic W PGiGenius 276 posts since
Oct 2, 2008
Currently Being Moderated
Oct 30, 2009 11:34 AM in response to: Sunil Kartikey
Re: Problem in implementing Voice TTS PHP

Your Document has no information on what is to be played on the other end of a call. It's missing the reference loaction to a wav file to be played or you need to  embed the actual audio (base64 encoded) in the submission. Please see the attached which has wav file as part of the payload. Provided valid credentials and destination, once the recipient answers and audio is detected (ie: "hello"), the message will begin to play (which is a "ring ring" wav file).

 

Vic

Attachments:
Vic W PGiGenius 276 posts since
Oct 2, 2008
Currently Being Moderated
Nov 1, 2009 6:20 PM in response to: Sunil Kartikey
Re: Problem in implementing Voice TTS PHP

I've attached creation of the TTS SOS object and the job submit XMLs.

 

All you need to do in enter proper credentials and a destination phone number.

 

Note that the TTS_SOS_Create.xml has base64 data or else you will need to replace the special chars with HTML escape chars as explained in http://www.pgiconnect.com/api/community/messaging/blog/2008/10/31/creating-and-using-tts-object

Attachments:

More Like This

  • Retrieving data ...