cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
492
Views
0
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: Mark Applebee on 20-08-2013 08:56:35 AM
I have an application which is playing queue music for 6 minutes. Each 30 minutes, its looking into the database for finding the name of the  next wav file to play for next 30 sec and it will also check any emergency  flag  set in the DB. This is only in development stage. When I test the calls I noticed that if I change the emergency flag while a call is alredy  in the queue, then its not picking it up. When I looked in the activity logs, I noticed that immidiately after the call hits my app, its executing all the steps for next 6 minutes wav file. But my coding is like do a DB look for first 30 sec music>then check the flag in a loop.I was expecting it to do this checking every 30 sec as in my code, but its executing its all in once.Any idea why the complete code is executing just after the call hits the app instead of step by step like icm script?

Subject: RE: CVP Application how the app execute
Replied by: Eric van der Knaap on 20-08-2013 09:12:34 AM
The VXML Server will pre-calculate all the possible states in your application if there are no "user choice", i.e. menus.

The trick here to put a "dummy menu" for the last message (or music) prompt before executing the Db Fetch, i.e. use a 2_Option_Menu with :
- Noinput Timeout :0.1s
- Max NoInput Count : 1
- Max NoMatch Count 1
- No BargeIn

instead than a standard Voice Element - Audio.

Thus the VXML Server will have been fooled and will not pre-calculate all the states. The Db Fetch will be done when the message in the dummy menu will have finished playing.

Subject: RE: CVP Application how the app execute
Replied by: Janine Graves on 20-08-2013 09:23:05 AM
Hi Mark,
Erik is correct. - with Studio apps (in contrast to ICM microapps), an Audio element (that doesn't collect input from the caller)  doesn't actually complete on the gateway before the gateway returns to VxmlServer for the next instruction.

Instead, the voice browser on the gateway hands off the audio play request to an http client process to deal with. The  voice browser then immediately does then next http request to vxml server for the next page.

The ONLY way to get the GW to play the audio to completion is to either:

a) play the audio prompt(s) in a Studio element that collects input from
the caller. But, since you don't really want to collect any input, just
use a Digits element and set the NoInput timeout to 10ms, set
MaxNoInputs and MaxNoMatch to 1, set Min Digits to 1, set Max Digits to
1. Then connect all the exit states to your next Studio element.
-Or-
b) Do what Cisco does in their Courtesy Callback applications. That is, put the Audio element into a separate Studio application, and use the
Subdialog_Invoke element to invoke that Studio app as a subdialog (subroutine) - since subdialog applications   have to play their audio to completion before exiting.

Subject: RE: CVP Application how the app execute
Replied by: Mark Applebee on 20-08-2013 10:22:46 AM
Thanks for the replys.
Hemal,
I explained the logic as simple there. Basically it can be music or prompt. The message position field determine the next file to play. Customer have the option to change the message postion and the prompt. I am only a beginner in development. Is there anyway I can get the entire  messages wav file name list in the order as an an array or somrething into the app from a sinle  dblookup.

Subject: RE: New Message from Janine Graves in Customer Voice Portal (CVP) - CVP - A
Replied by: Hemal Mehta on 20-08-2013 09:43:50 AM
In addition, why do DB fetches every 30 secs or whatever the time may be.  There are better ways to handle this from memory.  What is the logic behind the next music file.  Is it random file or some fixed one.  Either way it can be handled much elegantly from the memory without having overheads of hitting the DB each time.
Hemal

From: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
Sent: Tuesday, August 20, 2013 9:23 AM
To: cdicuser@developer.cisco.com
Subject: New Message from Janine Graves in Customer Voice Portal (CVP) - CVP - All Versions: RE: CVP Application how the app execute

Janine Graves has created a new message in the forum "CVP - All Versions": -------------------------------------------------------------- Hi Mark,
Erik is correct. - with Studio apps (in contrast to ICM microapps), an Audio element (that doesn't collect input from the caller)  doesn't actually complete on the gateway before the gateway returns to VxmlServer for the next instruction.

Instead, the voice browser on the gateway hands off the audio play request to an http client process to deal with. The voice browser then immediately does then next http request to vxml server for the next page.

The ONLY way to get the GW to play the audio to completion is to either:

a) play the audio prompt(s) in a Studio element that collects input from
the caller. But, since you don't really want to collect any input, just
use a Digits element and set the NoInput timeout to 10ms, set
MaxNoInputs and MaxNoMatch to 1, set Min Digits to 1, set Max Digits to
1. Then connect all the exit states to your next Studio element.
-Or-
b) Do what Cisco does in their Courtesy Callback applications. That is, put the Audio element into a separate Studio application, and use the
Subdialog_Invoke element to invoke that Studio app as a subdialog (subroutine) - since subdialog applications  have to play their audio to completion before exiting.
--
To respond to this post, please click the following link: http://developer.cisco.com/web/cvp/forums/-/message_boards/view_message/18418923 or simply reply to this email.

Subject: RE: New Message from Mark Applebee in Customer Voice Portal (CVP) - CVP - A
Replied by: Hemal Mehta on 20-08-2013 11:39:50 AM
You just need a single hit to DB, get the records into a data structure like HashTable and it should be good.  This is assuming that these values or position does not change dynamically during the call.
Hemal

From: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
Sent: Tuesday, August 20, 2013 11:13 AM
To: cdicuser@developer.cisco.com
Subject: New Message from Mark Applebee in Customer Voice Portal (CVP) - CVP - All Versions: RE: CVP Application how the app execute

Mark Applebee has created a new message in the forum "CVP - All Versions": -------------------------------------------------------------- They  are just audio files. Each DN have mutilple records with unique message position. Customer can edit the record to change the message position or custom message wav file name.
At the moment I am calling the DB for each record with a counter variable. Its good if I can store all the message file names into an array so I can avoid calling the DB each time. Hope this is more clear?
--
To respond to this post, please click the following link: http://developer.cisco.com/web/cvp/forums/-/message_boards/view_message/18424635 or simply reply to this email.

Subject: Re: New Message from Hemal Mehta in Customer Voice Portal (CVP) - CVP - All
Replied by: Janine Graves on 20-08-2013 12:15:50 PM
Hemal, You're assuming that Mark knows java programming well. In the past, he's indicated that he doesn't really know java. So, it's not so easy to use the DB multiple or to work with a hash table.

Subject: RE: New Message from Mark Applebee in Customer Voice Portal (CVP) - CVP - A
Replied by: Hemal Mehta on 20-08-2013 11:06:00 AM
Define, what exactly is a message here.  Is it just a audio file ?  How does the customer change the message position ?
Hemal

From: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
Sent: Tuesday, August 20, 2013 10:23 AM
To: cdicuser@developer.cisco.com
Subject: New Message from Mark Applebee in Customer Voice Portal (CVP) - CVP - All Versions: RE: CVP Application how the app execute

Mark Applebee has created a new message in the forum "CVP - All Versions": -------------------------------------------------------------- Thanks for the replys.
Hemal,
I explained the logic as simple there. Basically it can be music or prompt. The message position field determine the next file to play. Customer have the option to change the message postion and the prompt. I am only a beginner in development. Is there anyway I can get the entire  messages wav file name list in the order as an an array or somrething into the app from a sinle  dblookup.
--
To respond to this post, please click the following link: http://developer.cisco.com/web/cvp/forums/-/message_boards/view_message/18419978 or simply reply to this email.

Subject: RE: CVP Application how the app execute
Replied by: Mark Applebee on 20-08-2013 11:12:26 AM
They  are just audio files. Each DN have mutilple records with unique message position. Customer can edit the record to change the message position or custom message wav file name.
At the moment I am calling the DB for each record with a counter variable. Its good if I can store all the message file names into an array so I can avoid calling the DB each time. Hope this is more clear?

Subject: RE: New Message from Mark Applebee in Customer Voice Portal (CVP) - CVP - A
Replied by: Hemal Mehta on 20-08-2013 01:39:50 PM
How many calls do you get for this app per day and what is the max no of calls at peak times ?

From: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
Sent: Tuesday, August 20, 2013 12:58 PM
To: cdicuser@developer.cisco.com
Subject: New Message from Mark Applebee in Customer Voice Portal (CVP) - CVP - All Versions: RE: CVP Application how the app execute

Mark Applebee has created a new message in the forum "CVP - All Versions": -------------------------------------------------------------- Hi Janine,
You are right. I think Hemal is asking me to configure a dynamic audio voice element with HashTable.I know thats the way to go forward, but at the moment its a bit advance step for me.
Please let me know my logic of fetching DB will have any serious impact on system performance?
Thanks
--
To respond to this post, please click the following link: http://developer.cisco.com/web/cvp/forums/-/message_boards/view_message/18428164 or simply reply to this email.

Subject: RE: CVP Application how the app execute
Replied by: Mark Applebee on 20-08-2013 12:58:11 PM
Hi Janine,
You are right. I think Hemal is asking me to configure a dynamic audio voice element with HashTable.I know thats the way to go forward, but at the moment its a bit advance step for me.
Please let me know my logic of fetching DB will have any serious impact on system performance?
Thanks

Subject: RE: CVP Application how the app execute
Replied by: Mark Applebee on 20-08-2013 03:15:41 PM
Not sure about exactly how many calls per day. But approximately 60-80 calls at peak time.

Subject: RE: CVP Application how the app execute
Replied by: Paul Tindall on 20-08-2013 06:42:56 PM
If anyone wants to use it, I've attached an extended version of the Audio element I had that will return control to the server synchronously.  As always, sold as seen.

Paul

Subject: Re: New Message from Paul Tindall in Customer Voice Portal (CVP) - CVP - Al
Replied by: Janine Graves on 20-08-2013 11:21:50 PM
Wow Paul, that will come in handy! Thanks! I thought that the <form> containing ones custom code had to be called 'start' - how did you make it execute your form named 'sync'  <form id="sync">?

Subject: RE: Re: New Message from Paul Tindall in Customer Voice Portal (CVP) - CVP
Replied by: Paul Tindall on 21-08-2013 07:11:34 AM
Janine,

I think it's documented that way but from experience when building custom voice classes the audium_start_form goto link is added such that it references the first form you add regardless of name.

Subject: RE: CVP Application how the app execute
Replied by: Hemal Mehta on 22-08-2013 10:16:37 AM
Paul Tindall:
If anyone wants to use it, I've attached an extended version of the Audio element I had that will return control to the server synchronously.  As always, sold as seen.

Paul
Just couple of things. One would have to also implement ElementInterface for it to show up in studio.   Also why have the iteration check.  Why not just add the
lines to set the parms.  That should work.

Subject: RE: CVP Application how the app execute
Replied by: Paul Tindall on 22-08-2013 10:35:49 AM
What doesn&#039;t show up in Studio? 

The iteration check is there because there are multiple passes before &#034;done&#034; is returned to the script.  To cause the audio to block, a doc containing a dummy object element is sent; the final iteration that returns non-null &#40;&#034;done&#034;&#41; happens when the submit is received from that doc which will happen as soon as the audio has finished playing.

Subject: RE: CVP Application how the app execute
Replied by: Hemal Mehta on 22-08-2013 11:54:25 AM
I meant you were missing:
public class SyncAudio extends MAudio  implements ElementInterface 

Also  could clarify this:
The iteration check is there because there are multiple passes before &#034;done&#034; is returned to the script. 

It did not come out clearly. What determines the exact number of passes.

Subject: RE: CVP Application how the app execute
Replied by: Paul Tindall on 22-08-2013 05:42:49 PM
It&#039;s deliberately missing because the standard audio element class I&#039;m extending already implements ElementInterface.

Regarding the multiple iterations through addXmlBody, the first one results in the main audio-playing doc being sent, the second pass handles the submit from that and sends the blocking document containing a dummy object element, the third and final pass handles the submit from the dummy object doc and finally exits with done exit-state back to the application.

It was done this way for simplicity as it means the element config remains identical and the standard element is used to build the audio-playing doc as normal, it's just the run-time behaviour that is different.  In theory, I could have inserted the dummy object element before the submit in the main audio-playing document but there's no easy way to do that without recreating the whole audio doc part from scratch.

Subject: RE: New Message from Paul Tindall in Customer Voice Portal (CVP) - CVP - Al
Replied by: Hemal Mehta on 22-08-2013 09:44:49 PM
Thanks for the info Paul. I am testing this to see how it works at the low level. I removed the loop and it produced exactly same vxml code in both scenarios. Will test the behavior and confirm.
Hemal
________________________________
From: Cisco Developer Community Forums [cdicuser@developer.cisco.com]
Sent: Thursday, August 22, 2013 5:42 PM
To: cdicuser@developer.cisco.com
Subject: New Message from Paul Tindall in Customer Voice Portal (CVP) - CVP - All Versions: RE: CVP Application how the app execute

Paul Tindall has created a new message in the forum "CVP - All Versions": -------------------------------------------------------------- It&#039;s deliberately missing because the standard audio element class I&#039;m extending already implements ElementInterface.

Regarding the multiple iterations through addXmlBody, the first one results in the main audio-playing doc being sent, the second pass handles the submit from that and sends the blocking document containing a dummy object element, the third and final pass handles the submit from the dummy object doc and finally exits with done exit-state back to the application.

It was done this way for simplicity as it means the element config remains identical and the standard element is used to build the audio-playing doc as normal, it's just the run-time behaviour that is different.  In theory, I could have inserted the dummy object element before the submit in the main audio-playing document but there's no easy way to do that without recreating the whole audio doc part from scratch.
--
To respond to this post, please click the following link: http://developer.cisco.com/web/cvp/forums/-/message_boards/view_message/18522607 or simply reply to this email.
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links