1

I am trying to consume the Plivo web api. What i am trying to achieve is making a call through the plivo api and recording the call and returning the data back to store into database.

I want to create the xml file with the following nodes and then use that file to record the call.

Any one have tried this api before and have some code snippet or steps to achieve this thing it would be a great help.

<Response> <Wait> <Speak> <Record> <Dial> <Number>

Maxi Capodacqua
  • 303
  • 1
  • 15
Sachin Trivedi
  • 2,033
  • 4
  • 28
  • 57

1 Answers1

1

I'm new using Plivo, but AFAIK if you want to record a call you just need something like:

<Response>
    <Record action="http://www.example.com/get_recording/" startOnDialAnswer="true" redirect="false"/>
    <Dial>
      <Number>15551234567</Number>
    </Dial>
  </Response>

You can add the Wait and Speak tags like this:

<Response>
  <Wait length="10" />
  <Speak> Hello </Speak>
  <Record action="http://www.example.com/get_recording/" startOnDialAnswer="true" redirect="false"/>
  <Dial>
     <Number>15551234567</Number>
  </Dial>
</Response>

You will receive the RecordUrl parameter on http://www.example.com/get_recording/, so you can save that URL on your database.

Maxi Capodacqua
  • 303
  • 1
  • 15
  • 1
    thanks. I will give this a try and will let you know. One more thing. Do i need to create any application with answer_url and any other information ? and what should be the implementation of get_recording ? – Sachin Trivedi Jul 30 '14 at 06:53
  • @SachinTrivedi I'm not sure about when will you need to create a new application on your account. about the get_recording implementation, I can help you but only in `php` (my native language by the moment), but it is really easy, you will get many data from GET after the call ends, one of the data that you will receive is called `RecordUrl`, that field is a url to an audio file that have the call recorded, you can store that URL on your database. Let me know if you need some code example (in `php`). – Maxi Capodacqua Jul 30 '14 at 13:03
  • Thanks. So here is what i am understanding by whole scenario. i will make the call using plivo Call api By providing to, from,answer_url to this xml file and method as GET. then it will automatically record the conversation and the details will be given back in the Get_record method right ? – Sachin Trivedi Jul 31 '14 at 03:50
  • @SachinTrivedi, yes, you can change the method to `POST` if you wanted. The details of the call will be given back to /get_recording/ route. – Maxi Capodacqua Jul 31 '14 at 12:11
  • in /get_recording how can i get the parameters ? is it the request that contains the parameters ? also i would like to know that when i make a call by providing the answer url to xml file the response is invalid_numbers : ? can you provide me the php code for understanding the flow ? thanks. – Sachin Trivedi Aug 02 '14 at 03:53
  • @SachinTrivedi, yes, you will received the data in the request. About `invalid_numbers`, can you share the full response? – Maxi Capodacqua Aug 04 '14 at 11:08
  • i solved the issue related to invalid_numbers. now i am facing another issue that is "my call gets disconnected in probably 5 sec." and the action url is not also getting called. it just get called once when my call duration was about 14 sec. do you have any idea on this ? – Sachin Trivedi Aug 04 '14 at 11:12
  • Well, if you were able to make the call, everything should be fine. Maybe you have to submit a support ticket to PLIVO – Maxi Capodacqua Aug 04 '14 at 13:36
  • @MaxiCapodacqua I appreciate your level of research on the topic. I implemented the same . As you mentioned "You will receive the RecordUrl parameter on http://www.example.com/get_recording/, so you can save that URL on your database." How am I suppose to get that URL? Do I need to create a php file there to fetch the response back URL that I get or is there any other way for the same ? – Jiteen Nov 17 '14 at 07:50
  • @Jiteen did you find the solution? I am trying to get that URL and Im not sure how... – zachu May 31 '16 at 23:13