Asynch operation exception

Dedicated forum for the visual 'drag and drop' voice application designer that allows easy creation of advanced voice applications without programming knowledge

Moderators: kevin, 3CX staff

Asynch operation exception

Postby SWSDEV » Mon May 03, 2010 2:35 pm

I am getting this exception when trying to start an external code component.

This error is from the asp .net page having an issue and not the code component. But they could be linked I'm sure, have you guys run into this before?

Exception has been thrown by the target of an invocation. --> Asynchronous operations are not allowed in this context. Page starting an asynchronous operation has to have the Async attribute set to true and an asynchronous operation can only be started on a page prior to PreRenderComplete event.
Shahzad Qureshi
SWS Development - 3CX Certified Partner
Custom 3CX integration
Salt Lake City, UT USA
801-938-7712
swsdev.com
SWSDEV
Expert
Expert
 
Posts: 246
Joined: Sat Feb 23, 2008 6:51 am
Location: Salt Lake City, Utah - USA

Re: Asynch operation exception

Postby VAD_Support » Mon May 03, 2010 4:05 pm

Hi,

I never saw this behavior. What is the DLL doing? Are you launching some task in backgrund?

Thanks,
VAD_Support
3CX Valued Professional
3CX Valued Professional
 
Posts: 439
Joined: Thu Aug 06, 2009 5:29 pm

Re: Asynch operation exception

Postby SWSDEV » Mon May 03, 2010 4:07 pm

I am using the Speech API classes.

SpeechSynthesizer speaker = new SpeechSynthesizer();

Although I'm not 100% sure that is the cause, but that's the difference between everything else we've done.
Shahzad Qureshi
SWS Development - 3CX Certified Partner
Custom 3CX integration
Salt Lake City, UT USA
801-938-7712
swsdev.com
SWSDEV
Expert
Expert
 
Posts: 246
Joined: Sat Feb 23, 2008 6:51 am
Location: Salt Lake City, Utah - USA

Re: Asynch operation exception

Postby VAD_Support » Mon May 03, 2010 4:15 pm

Maybe that class triggers som task in background, not sure, I never used it.

Are you planning to generate TTS with that API? And stream it using the VAD? Maybe an option could be generate it in a separated process, and use an External Code Execution Component to communicate with it.
VAD_Support
3CX Valued Professional
3CX Valued Professional
 
Posts: 439
Joined: Thu Aug 06, 2009 5:29 pm

Re: Asynch operation exception

Postby SWSDEV » Mon May 03, 2010 8:50 pm

Yes I am using TTS. Using the code component to talk to the Microsoft library.

I'd like to avoid threading, because then when the VAD gets to the playback step there's no guarantee that the audio file will be ready for playback.
Shahzad Qureshi
SWS Development - 3CX Certified Partner
Custom 3CX integration
Salt Lake City, UT USA
801-938-7712
swsdev.com
SWSDEV
Expert
Expert
 
Posts: 246
Joined: Sat Feb 23, 2008 6:51 am
Location: Salt Lake City, Utah - USA

Re: Asynch operation exception

Postby SWSDEV » Tue May 04, 2010 5:01 am

Upon debugging the IIS worker process, the exact function it throws the exception on is

speaker.SetOutputToWaveFile(filename);

I tried setting Async="true" on the asp .net file, but that didn't help.
Shahzad Qureshi
SWS Development - 3CX Certified Partner
Custom 3CX integration
Salt Lake City, UT USA
801-938-7712
swsdev.com
SWSDEV
Expert
Expert
 
Posts: 246
Joined: Sat Feb 23, 2008 6:51 am
Location: Salt Lake City, Utah - USA

Re: Asynch operation exception

Postby VAD_Support » Tue May 04, 2010 2:28 pm

Something you may try is creating a separated process or web service to do the TTS task. Then you can connect with it using an External Code Execution or Web Services Interaction component, and wait there until the task is completed. That way the async operation will be out of the IIS process, and you should not have this problem.
VAD_Support
3CX Valued Professional
3CX Valued Professional
 
Posts: 439
Joined: Thu Aug 06, 2009 5:29 pm


Return to 3CX Voice Application Designer (VAD)


Who is online

Users browsing this forum: No registered users and 0 guests

Announcements: