Accessing Twilio TranscriptionText in a simple PHP application











up vote
0
down vote

favorite












I need to retrieve the transcription of a recording done with the Record Twiml verb but I can't get it to work.



Here's what I've tried:



1. call.php



<Response>    
<Record maxLength="5" transcribe="true" action="getTranscription.php" />
</Response>


2. getTranscription.php



<Response>
<Say>Here's your audio recording transcription: <?php echo $_REQUEST['TranscriptionText']; ?></Say>
</Response>


I have no problem recording voice and playing it back with the following code:



1. call.php



<Response>    
<Record action="getRecording.php" />
</Response>


2. getRecording.php



<Response>
<Say language="fr-CA">Here's your audio recording.</Say>
<Play><?php echo $_REQUEST['RecordingUrl']; ?></Play>
</Response>


It would be really appreciated if you guys could give me some hints on how to get the transcription back. Thanks a lot!










share|improve this question




























    up vote
    0
    down vote

    favorite












    I need to retrieve the transcription of a recording done with the Record Twiml verb but I can't get it to work.



    Here's what I've tried:



    1. call.php



    <Response>    
    <Record maxLength="5" transcribe="true" action="getTranscription.php" />
    </Response>


    2. getTranscription.php



    <Response>
    <Say>Here's your audio recording transcription: <?php echo $_REQUEST['TranscriptionText']; ?></Say>
    </Response>


    I have no problem recording voice and playing it back with the following code:



    1. call.php



    <Response>    
    <Record action="getRecording.php" />
    </Response>


    2. getRecording.php



    <Response>
    <Say language="fr-CA">Here's your audio recording.</Say>
    <Play><?php echo $_REQUEST['RecordingUrl']; ?></Play>
    </Response>


    It would be really appreciated if you guys could give me some hints on how to get the transcription back. Thanks a lot!










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I need to retrieve the transcription of a recording done with the Record Twiml verb but I can't get it to work.



      Here's what I've tried:



      1. call.php



      <Response>    
      <Record maxLength="5" transcribe="true" action="getTranscription.php" />
      </Response>


      2. getTranscription.php



      <Response>
      <Say>Here's your audio recording transcription: <?php echo $_REQUEST['TranscriptionText']; ?></Say>
      </Response>


      I have no problem recording voice and playing it back with the following code:



      1. call.php



      <Response>    
      <Record action="getRecording.php" />
      </Response>


      2. getRecording.php



      <Response>
      <Say language="fr-CA">Here's your audio recording.</Say>
      <Play><?php echo $_REQUEST['RecordingUrl']; ?></Play>
      </Response>


      It would be really appreciated if you guys could give me some hints on how to get the transcription back. Thanks a lot!










      share|improve this question















      I need to retrieve the transcription of a recording done with the Record Twiml verb but I can't get it to work.



      Here's what I've tried:



      1. call.php



      <Response>    
      <Record maxLength="5" transcribe="true" action="getTranscription.php" />
      </Response>


      2. getTranscription.php



      <Response>
      <Say>Here's your audio recording transcription: <?php echo $_REQUEST['TranscriptionText']; ?></Say>
      </Response>


      I have no problem recording voice and playing it back with the following code:



      1. call.php



      <Response>    
      <Record action="getRecording.php" />
      </Response>


      2. getRecording.php



      <Response>
      <Say language="fr-CA">Here's your audio recording.</Say>
      <Play><?php echo $_REQUEST['RecordingUrl']; ?></Play>
      </Response>


      It would be really appreciated if you guys could give me some hints on how to get the transcription back. Thanks a lot!







      php twilio twiml






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 11 at 0:16

























      asked Nov 10 at 21:32









      mckaymental

      104




      104
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          Twilio developer evangelist here.



          The transcription of a recording is done asynchronously to the call so you won't get the result when you get the webhook to the action URL.



          So, you need to provide a transcribeCallback attribute too.



          <Response>    
          <Record maxLength="5" transcribe="true" action="getRecordResult.php" transcribeCallback="getTranscription.php" />
          </Response>


          There is no guarantee on how long the transcription will take, so it's hard to play the transcription back to the caller. It's better to use the transcribeCallback URL to save the transcription alongside the call record.



          If you are trying to drive the call based on transcribing the caller's words then using <Record> and transcriptions is not recommended. Instead, I recommend you check out using <Gather> with input="speech". This will give you live voice transcription in the call.



          Let me know if this helps at all.






          share|improve this answer





















          • Glad to hear it! Hope the rest of your application goes well.
            – philnash
            Nov 14 at 6:24











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53243616%2faccessing-twilio-transcriptiontext-in-a-simple-php-application%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote



          accepted










          Twilio developer evangelist here.



          The transcription of a recording is done asynchronously to the call so you won't get the result when you get the webhook to the action URL.



          So, you need to provide a transcribeCallback attribute too.



          <Response>    
          <Record maxLength="5" transcribe="true" action="getRecordResult.php" transcribeCallback="getTranscription.php" />
          </Response>


          There is no guarantee on how long the transcription will take, so it's hard to play the transcription back to the caller. It's better to use the transcribeCallback URL to save the transcription alongside the call record.



          If you are trying to drive the call based on transcribing the caller's words then using <Record> and transcriptions is not recommended. Instead, I recommend you check out using <Gather> with input="speech". This will give you live voice transcription in the call.



          Let me know if this helps at all.






          share|improve this answer





















          • Glad to hear it! Hope the rest of your application goes well.
            – philnash
            Nov 14 at 6:24















          up vote
          0
          down vote



          accepted










          Twilio developer evangelist here.



          The transcription of a recording is done asynchronously to the call so you won't get the result when you get the webhook to the action URL.



          So, you need to provide a transcribeCallback attribute too.



          <Response>    
          <Record maxLength="5" transcribe="true" action="getRecordResult.php" transcribeCallback="getTranscription.php" />
          </Response>


          There is no guarantee on how long the transcription will take, so it's hard to play the transcription back to the caller. It's better to use the transcribeCallback URL to save the transcription alongside the call record.



          If you are trying to drive the call based on transcribing the caller's words then using <Record> and transcriptions is not recommended. Instead, I recommend you check out using <Gather> with input="speech". This will give you live voice transcription in the call.



          Let me know if this helps at all.






          share|improve this answer





















          • Glad to hear it! Hope the rest of your application goes well.
            – philnash
            Nov 14 at 6:24













          up vote
          0
          down vote



          accepted







          up vote
          0
          down vote



          accepted






          Twilio developer evangelist here.



          The transcription of a recording is done asynchronously to the call so you won't get the result when you get the webhook to the action URL.



          So, you need to provide a transcribeCallback attribute too.



          <Response>    
          <Record maxLength="5" transcribe="true" action="getRecordResult.php" transcribeCallback="getTranscription.php" />
          </Response>


          There is no guarantee on how long the transcription will take, so it's hard to play the transcription back to the caller. It's better to use the transcribeCallback URL to save the transcription alongside the call record.



          If you are trying to drive the call based on transcribing the caller's words then using <Record> and transcriptions is not recommended. Instead, I recommend you check out using <Gather> with input="speech". This will give you live voice transcription in the call.



          Let me know if this helps at all.






          share|improve this answer












          Twilio developer evangelist here.



          The transcription of a recording is done asynchronously to the call so you won't get the result when you get the webhook to the action URL.



          So, you need to provide a transcribeCallback attribute too.



          <Response>    
          <Record maxLength="5" transcribe="true" action="getRecordResult.php" transcribeCallback="getTranscription.php" />
          </Response>


          There is no guarantee on how long the transcription will take, so it's hard to play the transcription back to the caller. It's better to use the transcribeCallback URL to save the transcription alongside the call record.



          If you are trying to drive the call based on transcribing the caller's words then using <Record> and transcriptions is not recommended. Instead, I recommend you check out using <Gather> with input="speech". This will give you live voice transcription in the call.



          Let me know if this helps at all.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 13 at 2:58









          philnash

          36.2k93353




          36.2k93353












          • Glad to hear it! Hope the rest of your application goes well.
            – philnash
            Nov 14 at 6:24


















          • Glad to hear it! Hope the rest of your application goes well.
            – philnash
            Nov 14 at 6:24
















          Glad to hear it! Hope the rest of your application goes well.
          – philnash
          Nov 14 at 6:24




          Glad to hear it! Hope the rest of your application goes well.
          – philnash
          Nov 14 at 6:24


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53243616%2faccessing-twilio-transcriptiontext-in-a-simple-php-application%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Florida Star v. B. J. F.

          Danny Elfman

          Retrieve a Users Dashboard in Tumblr with R and TumblR. Oauth Issues