Page 1 of 1

Issue with POST request

Posted: Wed Aug 08, 2018 10:07 am
by wes@@@
I have an application that I'm making a POST request to in order to send and store a recording of the call, but it keeps giving me errors (the IVR app, not my app). I have tested the application using postman and it works there. I've also checked the logs for the app I'm posting to, and it doesn't even show the POST ever hitting the server, so the issue must lie with how I'm making the POST request in the IVR app.

I have the flow as such (for testing): call begin -> call_recording begins -> prompt that says stuff -> call_recording ends -> POST request to my app with variables in the body set as id = session.id and file = call_recording.

As a side note, the post request returns nothing except a status and I've tried having the IVR's post return type as empty and text. Also, I see that you can handle errors some how... but how do I know what the error is that occurred from inside the IVR app?

Any suggestions?

Re: Issue with POST request

Posted: Thu Aug 09, 2018 11:38 am
by wes@@@
wes@@@ wrote:It's saved as "callrecording" even though it shows "call_recording" on the head as default in the fuse+ interface?

Here is how it currently looks, with everything else disconnected for testing purposes:
https://i.imgur.com/BknUyoY.png
The REST module currently has the timeout set to 30s as well.

More information:

The application I'm sending to is a node app hosted on GCloud that simply accepts the POST and sends a status code back (which is why I tried having the response from the app be empty first).

Upon checking the app's logs and the call log, I noticed that the app isn't even logging the POST and the call log shows:

Code: Select all

07 AUG 2018 04:22:40 PM -0500: var_68, [rest] - ยป
ERROR:
HTTP response code was non-2xx.
REQUEST:
URL: https://******.appspot.com/
TYPE: POST
User-Agent: curl/7.29.0
Variable Value
id 200060;006;1533676672
file <audio file upload>
(please note first portion of url has been removed for privacy)
Also, this error occurs even when I explicitly send a 200 status from my app. So, I'm unsure why this error is being shown.

Also, here is an example of log output when the app is POSTed to (this example is using postman):

Code: Select all

I  POST 200 187 B 3.9 s PostmanRuntime/7.1.5 / POST 200 187 B 3.9 s PostmanRuntime/7.1.5 5b6b491e00ff0651b1ed7152f30001737e67636c6f7564667573656c6f676765720001323031383038303874313432393530000100
  70.165.119.234 - - [08/Aug/2018:14:48:46 -0500] "POST / HTTP/1.1" 200 187 - "PostmanRuntime/7.1.5" "******.appspot.com" ms=NaN cpu_ms=5539 cpm_usd=2.0898e-8 loading_request=1 instance=00c61b117c95452111f67ec598645cb4d04e50cda881d95c794bfcdf45e528cddec5af4ae049 app_engine_release=1.9.54 trace_id=3fe5a6a4bb57b83f3d7fb3eff278179d
A  Server is running on port: 8080 
A  POST to / received! 
A  10000;10;1022 
A  { fieldname: 'file', 
A    originalname: 'wavy.wav', 
A    encoding: '7bit', 
A    mimetype: 'audio/wave', 
A    buffer: <Buffer 52 49 46 46 2a 30 92 00 57 41 56 45 66 6d 74 20 12 00 00 00 01 00 02 00 44 ac 00 00 10 b1 02 00 04 00 10 00 00 00 64 61 74 61 04 30 92 00 00 00 00 00 ... >, 
A    size: 9580594 } 
A  Uploaded -> [object Object] 
(again, url to app has been edited for privacy)

I assume an XML response is not required when using the rest data module. Is there not another way to remedy this?

Info posted on other thread before closure.

Re: Issue with POST request

Posted: Thu Aug 09, 2018 1:56 pm
by support
Hi,

Based on a previous post you provided we were able to look at the call logs directly and have found that the phone number you are using to test is being routed to our PCI environment. Unfortunately the domain you are attempting to submit to has not yet been authorized on our PCI network. The security in place on PCI phone numbers numbers is much more strict than our normal environemnt, all of the external domains / IPs you wish to connect to have to be preauthorized via a request to our support team. You can reach out to our support team via email to request additional whitelisting as necessary. Until access is granted all requests from this phone number to that domain will fail because they will be blocked by our firewalls. Alternatively, you could utilize a non-PCI phone number for testing your code before putting in the whitelisting request.

Regards,
Plum Support

Re: Issue with POST request

Posted: Thu Aug 09, 2018 2:39 pm
by wes@@@
support wrote:Hi,

Based on a previous post you provided we were able to look at the call logs directly and have found that the phone number you are using to test is being routed to our PCI environment. Unfortunately the domain you are attempting to submit to has not yet been authorized on our PCI network. The security in place on PCI phone numbers numbers is much more strict than our normal environemnt, all of the external domains / IPs you wish to connect to have to be preauthorized via a request to our support team. You can reach out to our support team via email to request additional whitelisting as necessary. Until access is granted all requests from this phone number to that domain will fail because they will be blocked by our firewalls. Alternatively, you could utilize a non-PCI phone number for testing your code before putting in the whitelisting request.

Regards,
Plum Support
I attempted it now deployed to another non-PCI number and now my app is seeing the POST. Thanks!

Also, what is the correct way to reference the id and audio recording of the current call from within the app? session.id and callrecording?


EDIT: I'm receiving the file and saving it as a .wav file, but the mimetype is showing it as an audio/x-wav? Is this correct? Saving the file as .wav and trying to play it only gives an error.

NVM, I see now that the files are in .ul format..... why?

Re: Issue with POST request

Posted: Thu Aug 09, 2018 3:48 pm
by support
Hi,

You are correct for the session.id variable name. In the case of Fuse+, you will want to use the call_recording variable name to get access to the recording. The IVR platform creates the call recording as a UL file. Fuse+ does not modify the file, the system sends exactly what the IVR platform recorded. If you need to do automated conversions of the .ul file into a .wav file, we recommend using SoX.

Regards,
Plum Support