10-08-2014 10:21 AM
Hi
Is there any known way to troubleshoot uploading of WAV files via REST API? My Uploads work just fine, and I see in my greetings that the language has been set, but the player won't play anything, and the caller doesn't get to hear anything. This happens even if I use the conversion facilities of the .NET CUPI API. If I upload the same WAV file from the web interface, things work out just fine.
I've tried on both CUC 10.0 and 10.5 using the same WAV files - the issue remains the same. If I check the GreetingStreamFiles on the greeting after setting the WAV file, it shows me the files, with proper language and a filename set so it seems the files are uploaded just fine, but somehow get corrupted. If I don't use the built-in conversion facility, the files are not accepted at all.
10-08-2014 10:52 AM
all the CUPI library is doing there is converting via a CLI tool (from Unity) to convert the wav file into PCM before uploading - Connection is highly fussy about the wav file format - the web client does the same thing when you upload it via the CUCA page, although the conversion takes place on the server in that case instead of the client.
If you see it uploaded have you tried playing it back via the CUCA page (i.e. using the local speakers and/or the phone via TRAP)? Did you ensure the greeting was configured to playback the custom recording instead of the system default greeting (i.e. via CUCA for that greeting)?
Have yet to encounter a WAV file that didn't convert to PCM properly - anything's possible I suppose - best I can suggest is to send the WAV file over.
10-08-2014 11:03 AM
Is there any way I can privately send those files to you? Since they were recorded professionally, I'm not sure about the copyright status.
What I still want to try is if I upload them from the Web GUI and they play, download again using the web GUI, and upload again using the API (without conversion), to check if that changes something. Or Upload from web gui, download via API, then re-upload without conversion. But to test that I need to get my own system fully up and running (as part of other issues I upgraded to 10.5 but the system is not fully configured yet.. ).
10-08-2014 11:17 AM
sure - send them unicast to lindborg at cisco dot com...
10-08-2014 11:30 AM
Just testing against 10.0 and 10.5.1 using a couple different wav files here - both play back ok via CUCA or via the phone when converting to PCM first - using this simplified path to activate the alternate greeting, upload the wav file and set the play what to be the recorded greeting:
CallHandler oHandler;
CallHandler.GetCallHandler(out oHandler, connectionServer, "", "test");
Greeting oGreeting;
oTempHandler.GetGreeting(GreetingTypes.Alternate, out oGreeting);
oGreeting.SetGreetingWavFile(1033, @"c:\test.wav", true);
oGreeting.UpdateGreetingEnabledStatus(true,DateTime.Now.AddYears(1));
oGreeting.PlayWhat = PlayWhatTypes.RecordedGreeting;
oGreeting.Update();
we'll have to see if something is unusual about the professionally recorded WAV files keeping it from being converted properly on the client side - the Unity libraries there have been in use in many tools over the years, never seen them fail - but could switch over to the SoX library instead if it comes to that...
10-08-2014 12:17 PM
Thanks for that code bit.. I now suspect something in my greeting upates. Will report back ASAP.
10-08-2014 12:49 PM
I suspect it has something to do with activating the greeting after uploading. My PlayWhat remains stuck at system greeting, even though I follow up the upload with an update of the greeting. I've not bothered with the greeting enabled status, given as they are already set properly after creation, but I'll try that again now.
10-08-2014 01:16 PM
Urgh.. so I think the files are fine and the upload is fine. As for enabling the greeting, that is also fine, but it seems that the last update
oGreeting.PlayWhat = PlayWhatTypes.RecordedGreeting;
oGreeting.Update();
while returning 204, does nothing, and I verified that it is sending
<Greeting><PlayWhat>1</PlayWhat><PlayRecordMessagePrompt>0</PlayRecordMessagePrompt></Greeting>
Funny thing.. if I then add a second wav file (I have it in multiple languages), and set the PlayWhat again, then it works and I see both wav files in the player.
Then I did another test.. just adding things in my code as usual (creating box and every other object all one after another). Then I started a test program that just re-applies the greeting and enables things again. And... tada.. now it is all set. Another case of the "you're too fast" blues? Same thing happens on my dev box (10.5) and the prod system (10.0). Next step is immediately after setting, reload again, if not correct, try setting again and see what happens.
10-08-2014 02:15 PM
Okay - I give up. It appears to be working properly in my lab on 10.5, but on site (10.0), even though the config looks alright, the player does not offer the ability to play back the file so something is still off.
As for the PlayWhat thing - turned out to be an old typo in the code and the change was made, but on the mailbox greetings, not my callhandler greetings.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide