We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

Upload recording to app server

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
cfromm
Posts: 4
Joined: Wed Aug 27, 2003 4:52 pm

Upload recording to app server

Post by cfromm »

I'm having a problem with an application to essentially Record and upload to the application server. Uses of many various upload components and routines all show same symptoms. Upload code sees the multipart/form-data form, but show the file to be ContentType unknown and 0 bytes. I've run a packet sniffer to confirm that the file is not 0 bytes in the postdata.

I believe the issue is the mime type coming out of the IVR post.

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">


<%
Action = Request.QueryString("Action")


If Action = "submit" then

set upload = server.createobject("comUpload.UploadObj")


If upload.Filecount <> 0 then
Dept = upload.Form("dept")


fileName = replace( upload.file.fileName, "#", "_" )	' we don't want '#' sign in the file name.
		fileSize = upload.File.fileSize
		contentType = upload.File.contentType


		'if upload.File.fileSize > 0 then



			upload.AttachRandomNumber = true	' if same file exists, attach random number

			on error resume next
			savedAs = upload.SaveAs( "c:\" & fileName)	' actually save file to the disk
								' this function also returns saved file name
								' if file already exists


		'End if



End If
%>

<form id="read">
	<block>
	<prompt>
       Your message has been sent.
    </prompt>
	</block>
</form>


<% Else %>
<form id="callin">
	<block>
	<prompt>
       <audio src="wav1/welcome.wav">
          You have reached the One Travel employee call in hotline.
       </audio>
    </prompt>
	</block>

	 <field name="dept" type="digits?length=1">

		<prompt>
		       <audio src="wav1/welcome.wav">
		         Please choose your department from the following:  One for Sales, Two for Customer Service, Three for Processing.
		       </audio>
    	</prompt>

	</field>

	<record name="excuse" type="audio/x-wav" beep="true">

	<prompt>

	Please record your message after the beep.
	</prompt>
	<filled>

	The following will be sent to your supervisor and human resources.
	<value expr="excuse"/>
	</filled>
	</record>





	<filled>


        <submit next="callin.asp?action=submit" method="post" enctype="multipart/form-data" namelist="dept excuse"/>
    </filled>

</form>
<%End If%>



<%
Set upload = nothing
%>


</vxml>
Sniffing the POST shows:

Code: Select all

POST /callin.asp?action=submit HTTP/1.0

User-Agent: PlumVoicePortal/2.4

Host: ivr.onetravel.net

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

Cookie: ASPSESSIONIDQAARRQDB=MKKDBKICAHJNOPOLKHBKHCEG

Content-Length: 13627

Expect: 100-continue

Content-Type: multipart/form-data; boundary=----------------------------8654300ec28a



------------------------------8654300ec28a

Content-Disposition: form-data; name="dept"



2

------------------------------8654300ec28a

Content-Disposition: form-data; name="excuse"; filename="excuse"

Content-Type: a



RIFF,4..WAVEfmt ........@...@.......data.4..xx..........x...................x.xx....................x.x...................x.......x...x..x..x..
...................x...........x..x....x....x...........x......x......x...x........x.x.......x....x...................x....x...
..x........x..x.............x....x...xxx..x.........x.................x.......x......x............x............x...............
....x..............x...................x......x..x...x...xx.........x..x......x.xqxxqx................xxxxx.xxxx..............x
......x..x...x............x...xx............xxqqqqqx................xx...x.xxqqqqx................qei_be_bbbmix............me__
_[[_biq..........qi]]XZZX_bm.............e[VRQOQTZ_m..........x_TOOKKOQVZm.............m[ROIIIIKOT]x..........iXIFAAADIQxx...x.
.x.......x......x.........x..........x.........xx........x........................x....x.......x.............x........x....x...
....x...............x................................x....x..........x........xx..xx......................xx.....x.............
......x..xx............x.................x....x........x.....................x......x....................x................x....
..........................xx.xx.....x.....x........x............................x..xx....................................x.....
...........x..........x.......x.................................x..x...x..............x...

------------------------------8654300ec28a--

HTTP/1.1 200 OK

Server: Microsoft-IIS/5.0

Date: Tue, 05 Oct 2004 17:57:24 GMT

X-Powered-By: ASP.NET

Connection: Keep-Alive

Content-Length: 180

Content-Type: text/html

Cache-control: private



<?xml version="1.0"?>

<vxml version="2.0">









<form id="read">

.<block>

.<prompt>

       Your message has been sent.

    </prompt>

.</block>

</form>
I believe the culprit is "Content-Type: a" coming out of the IVR post.

cfromm
Posts: 4
Joined: Wed Aug 27, 2003 4:52 pm

Post by cfromm »

OK... we have gotten rid of the "ContentType: a" with the updates you guys made to my system. but still not working.

Code works using html form and browser to submit. Please see sniffs:

This was submitted with html and browser. It works fine, file is recognized, not 0 bytes, and is saved to the server.

Code: Select all

POST /callin.asp HTTP/1.1

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/msword, */*

Accept-Language: en-us

Content-Type: multipart/form-data; boundary=---------------------------7d430a2a340fb4

Accept-Encoding: gzip, deflate

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)

Host: ivr.onetravel.net

Content-Length: 8832

Connection: Keep-Alive

Cache-Control: no-cache

Cookie: fcP=C=1&T=1096642712614&V=1096642746256; ASPSESSIONIDQAARRQDB=GFLDBKICKFALAGDAOEOKCBFD



HTTP/1.1 100 Continue

Server: Microsoft-IIS/5.0

Date: Wed, 06 Oct 2004 03:02:45 GMT

X-Powered-By: ASP.NET



-----------------------------7d430a2a340fb4

Content-Disposition: form-data; name="dept"



8

-----------------------------7d430a2a340fb4

Content-Disposition: form-data; name="excuse"; filename="C:\excuse"

Content-Type: audio/basic



.snd...(.. ........@....glass clink......|vuurrxy|.{..~............||~..}........zsxxyy.........~..............{-N...8....
'...../..)........=...;..*.,.1.IJ!.9.+...0.C...9...9..2&..>....%...)...?b..+O.S$..A"1...0...!.."...A.T...-..&C..3-...L..5J.. 4..#:..(........./......3$...'..`F..:,..+?...'..-.....<...'..*$..8..
.T)...-B.L2..K9..>...M.....$......7..._.H..)...)3..F[..2=..#`..%.......6.....:.. +..*...8+......57..<:......3.....,...%..,...:.o..%5..'@..?a...X.V"...!.... ..2...e.B...(..) ..7*..\/..39..91..-...4r...tx...ww...uu..vq...oz..qp..yn}..nx...v...t|..ypx..yv|..sr..~n~..mq..~n...ls..qn...v...|v}..}x...wz..
{o|..mw..xl...nw..rq..zqw..wv...|s~..wx..zo...nt..sn...qy..qt..yp}..~.....{...to..|r}..mr..sn...p...uv..{w...xt..~|{{..sz.
.{p...w...{n..wl...ro..{r...y

-----------------------------7d430a2a340fb4

Content-Disposition: form-data; name="UploadFile"



Upload

-----------------------------7d430a2a340fb4--

HTTP/1.1 200 OK

Server: Microsoft-IIS/5.0

Date: Wed, 06 Oct 2004 03:02:45 GMT

X-Powered-By: ASP.NET

Content-Length: 180

Content-Type: text/html

Cache-control: private



<?xml version="1.0"?>

<vxml version="2.0">

<form id="read">

.<block>

.<prompt>

       Your message has been sent.

    </prompt>

.</block>

</form>
</vxml>
This one was submitted thru IVR. Doesn't work. Field is recognized, but file seen as 0 bytes and unknown mime type.

Code: Select all

POST /callin.asp HTTP/1.0

User-Agent: PlumVoicePortal/2.4

Host: ivr.onetravel.net

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

Cookie: ASPSESSIONIDQAARRQDB=LHLDBKICCACHOFMCFHDGDFFJ

Content-Length: 22809

Expect: 100-continue

Content-Type: multipart/form-data; boundary=----------------------------38ac1358864a



------------------------------38ac1358864a

Content-Disposition: form-data; name="dept"



6

------------------------------38ac1358864a

Content-Disposition: form-data; name="excuse"; filename="excuse"

Content-Type: audio/basic



ss......{soo.{{....w{{{{........{so......{..{w..ww..{w{...{...w{.....{mmsw{w{w.......
....miigssos.........{om...m_][Yo.............dY[[UU`go.........b][_]SOYbkmiw
..........w{{`UQY`gw...o]U^{..'S..........;%....../.......U..',#).........'.......5..........2(%....#0K.......*..'
*%5..............
{ww{..www{.{.....{ww.w..o.s{.w.{....w{......{s.s....{..{.{{.o...ss.w.{{..{.....{.{..{.{.....sw.s...{{....{.w{.{..os{...{...

------------------------------38ac1358864a--

HTTP/1.1 200 OK

Server: Microsoft-IIS/5.0

Date: Wed, 06 Oct 2004 02:48:01 GMT

X-Powered-By: ASP.NET

Connection: Keep-Alive

Content-Length: 180

Content-Type: text/html

Cache-control: private



<?xml version="1.0"?>

<vxml version="2.0">

<form id="read">

.<block>

.<prompt>

       Your message has been sent.

    </prompt>

.</block>

</form>
</vxml>
The only differences I can see are:

1. A few extra headers in brower post (accept-language, connection, cache-control)
2. In the brower post, the server prompted a Continue. In IVR post, the client requested a Continue.
3. Browser post includes "C:\" in filename.
4. Browser post includes 1 extra form element, which is the Submit button itself.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

link on IVR forum to post with similar ASP issue

Post by support »

Hello:

I'm not sure what is wrong with what you are trying to do, but then again I'm not all that familiar with ASP :P

There is a post on the IVR forum from another user having similar difficulties. Please see if this thread helps you. Page 2 contains a 2 part example of vxml that submits audio data to an app server (part 1), and the php section handles it (part 2):

http://support.plumvoice.com/viewtopic. ... c&start=15

If this does not help, please let us knowand we'll see whatwe can do.

kind regards,

Plum Support
Last edited by support on Fri Jan 15, 2010 2:36 pm, edited 2 times in total.

leftkost
Posts: 11
Joined: Tue Feb 24, 2004 12:51 am

Upload recording to app server

Post by leftkost »

I've tried to use the scripts provided, changed the global upload directory, but get an "error bad fetch" when I try and use it as you suggested.

I'd like the files to reside on our plum IVR box, but our web server is a hosting company. I got the same message no matter which local direcdtory I used, and they all are writable.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

post excerpt from log to solve IVR issue

Post by support »

Can you post an excerpt from your IVR log file indicating what URL the IVR was attempting to fetch when it errored out? Also, other than the global upload directory, did you make any other changes to the scripts? Where are these IVR scripts served from?

Post Reply