I am using vxml powered by an engine similar to TellMe. I adding voice recognition to telephone prompts for a voice mail system. The new menu will first prompt the user for verbal input, and if no match is found, or if no input is given, the user is prompted again with touch tone options.
The original menus look like this:
<menu id="msgedit">
<prompt><enumerate><value expr="_prompt"/>press <value expr="_dtmf"/>.</enumerate></prompt>
<choice dtmf="9" next="#checkurgent">To deliver your message </choice>
<choice dtmf="7" next="#playmsg">To play your message </choice>
<choice dtmf="3" next="#rerecord">To discard your message and record over </choice>
<choice dtmf="2" next="#addtomsg">To add to your message </choice>
<choice dtmf="6" next="#testnumber">To enter a phone number where you may be reached </choice>
<choice dtmf="1" next="#cancel">To cancel making a message </choice>
<!-- handle no input/no match -->
</menu>
The new menu looks like this:
<form id="msgedit">
<field name="choice">
<prompt>
<if count == 0">
Please choose one of the following.
deliver, play back, rerecord, add to,
enter a callback number, or cancel.
<else/>
Please choose one of the following.
To deliver your message, press 9.
To play back your message, press 7.
To discard your message and rerecord, press 3.
To add to your message, press 2.
To enter a callback number, press 6.
To cancel your message, press 1.
</if>
</prompt>
</field>
<filled>
<if cond="choice == 'deliver' || choice == '9'">
<goto next="#checkurgent"/>
<elseif cond="choice == 'play' || choice == '7'"/>
<goto next="#playmsg"/>
<elseif cond="choice == 'rerecord' || choice == '3'"/>
<goto next="#rerecord"/>
<elseif cond="choice == 'add' || choice == 'add to' || choice == '2'"/>
<goto next="#addtomsg"/>
<elseif cond="choice == 'enter callback number' || choice == 'callback number' || choice =='6'"/>
<goto next="#testnumber"/>
<elseif cond="choice == 'cancel' || choice =='1'"/>
<goto next="#cancel"/>
<else/>
<throw event="nomatch"/>
</if>
</filled>
<!-- handle no input/no match -->
</form>
However, I want to use the <enumerate> and <choice> behavior from the original menu to reprompt instead of the long text (which is too long and causes an error).
HERE'S THE QUESTION: is there a way to use the first style of prompt within the second style of prompt? can i put and inside of a field? and how would i do that?
The choice element is specific to menu. While can use enumerate in a general prompts, the way it is used in the first example, it is tying the prompts to the allowed input. For a field, you are getting the available inputs from a defined grammar.
On the latter point, your snippet doesn't mention grammar nor does the field indicate a type. Is the grammar defined at a higher level within the VoiceXML document or a built in grammar ? If not, that may be the source of your error.
You can use speech recognition with menus and choices, but the way the selections are defined with the enumeration:
This is a modified example from the VoiceXML 2.0 specification:
<menu>
<choice dtmf="1" next="http://www.sports.example.com/vxml/start.vxml">
<grammar src="sports.grxml" type="application/srgs+xml"/>
Press 1 or say Sports for sports scores
</choice>
<choice dtmf="2" next="http://www.weather.example.com/intro.vxml">
<grammar src="weather.grxml" type="application/srgs+xml"/>
Press 2 or say weather for weather
</choice>
<choice dtmf="3" next="http://www.stargazer.example.com/voice/astronews.vxml">
<grammar src="astronews.grxml" type="application/srgs+xml"/>
press 3 or say Stargazer astrophysics for ?
</choice>
</menu>
If you put the prompts into an ECMAScript array, you could probably use the enumeration as well.
In general, I would recommend the field approach. You gain a lot more flexibility for providing rich prompts and error handling. menu/choice is a shortcut mechanism that is meant for simple, limited cases.
Related
In splunk dashboard(Classic) I want to hide/hide the input radio option choice based on previous input radio button selection.
<form>
<label>tst2</label>
<fieldset>
<input type="radio" token="environment">
<label>ENV</label>
<choice value="US">USA</choice>
<choice value="Asia">APAC</choice>
<choice value="UAE">UAE</choice>
</input>
<input type="radio" token="sub-environment1">
<label>S-ENV</label>
<choice value="*">All</choice>
<choice value="NewYork">NY</choice>
<choice value="LA">LA</choice>
<choice value="Washington">WT</choice>
<choice value="Delhi">DL</choice>
<choice value="Mumbai">MB</choice>
<choice value="Tokio">TK</choice>
<choice value="Dubai">DB</choice>
<choice value="Abu-Dabhi">ABD</choice>
</input>
</fieldset>
</form>
In this case
if i select USA then it should display - NY,LA,WT and * . Rest all other sub-environment should hide.
if i select APAC it should display radio inputs as DL, MB,TK and * . Rest all other sub-environment should hide.
if i select UAE it should display DB, ABD and * . Rest all other sub-environment should hide.
Is there any why we can use tokens or depends or any other approach to hide/unhide these second(sub-environment) radio input choices
The depends="$token$" format works on almost every XML element in Splunk Dashboards
I do this to force choices to happen in a certain order
For example, if you must choose a Region before a Datacenter, you might have the dropdown for Datacenter have depends="$regiontok$", so that Region has to be set first
I'm working with apache camel V2.24.3,and I want to check if ${body} contains this 2 strings.
<choice id="ldap_response">
<when id="ldap_response_adding">
<simple>${body} contains 'adding' && 'modifying'</simple>
</when>
</choice>
this code returns an error:
'The identity name must immediately follow the "&" character in the
entity reference.'
Try <simple>${body} contains 'adding' and ${body} contains 'modifying'</simple>
Please note that although this question is an entirely different question, it relates directly to this question.
The following is the script that returns the dataset for my SSRS chart:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" aggregate="true">
<entity name="account">
<attribute name="bio_employeesworldwide" alias="TotalWorldWideEmployees" aggregate="sum" />
<filter>
<condition attribute="customertypecode" operator="eq" value="2" />
</filter>
<link-entity name="contact" from="parentcustomerid" to="accountid" alias="contact">
<attribute name="bio_webuseraccountstatus" alias="count_bio_webuseraccountstatus" aggregate="countcolumn" />
<attribute name="bio_webuseraccountstatus" alias="bio_webuseraccountstatusgroupby" groupby="true" />
</link-entity>
</entity>
</fetch>
The values for bio_webuseraccountstatus can be Active, Inactive, Disabled, Pending, etc..
In FetchXML is there a way to do a case statement where you "InActive" for every value that is not equal to "Active" ?
As you can see I've been trying to solve this issue within the reporting layer, but am experiencing lots of "string format" issues.
Can this be done with the dataset layer (fetchxml) instead?
According to this Microsoft forum post:
There's no equivalent function in FetchXml. Instead, you will need to return each field value, and process the CASE logic in the calling code. If this FetchXml is to be used in a report, then you may be able to implement the CASE logic in a calculated field on the report.
You can always parse the output of the fetchxml on return.
So rather than pushing to the screen, report, or db, the original record field of isreceivetravelalerts, you check the status (zero or one) and rewrite it, and add the new variable to your output. Clunky, but useful.
if ($record->isreceivetravelalerts == 1)
{
$travel_alerts = "Active";
}
$travel_alerts = "Inactive";
I needed to split a message into 3 different payloads and transform and send to 3 routers. So the payload initially will have a header a body or detail and a footer. These 3 different payloads need to be extracted and send to 3 different routers. What would be the most efficient way to do it.
It depends on your body/payload type. If your payload is XML, you can easily split it using xpath and route it using content based routing similar to:
<splitter expression="#[xpath('//nodes/node)']" />
<choice>
<when expression="#[xpath('//node/id').text ='myid']">
<!-- Route somewhere -->
</when>
<otherwise>
<!-- Route somewhere else -->
</otherwise>
</choice>
The expression splitter above can take any MEL expression to split up your payload. There are many other splitters, for example if your payload is already a java Collection, you can simply use the collection-splitter.
Other splitter info can be found here: http://www.mulesoft.org/documentation-3.2/display/32X/Message+Splitting+and+Aggregation
Also there are other routers that can help you with fork and join patterns if you need to process messages asynchronously as well. Here's a good post on that: http://java.dzone.com/articles/aggregation-mule-%E2%80%93-%E2%80%9Cfork-and
When and in what case , the invalidMessage is shown ??
Here in my case , the invalidMessage is never shown .
<input
type="text"
id="firstName"
size="20"
dojoType="dijit.form.ValidationTextBox"
required="true"
propercase="true"
promptMessage="Enter first name."
invalidMessage="First name is required."
trim="true"
/>
Invalid message appears when the content of the text box is invalid according to a given regular expression (passed using the regExp parameter). In your case you do not pass a regExp parameter, so the content is always valid.
What you want is the "promptMessage" parameter, which appears when the text box is empty and on focus (null by default). Think of this like a tooltip that tells the user what to do, not an error message that tells the user what they've done wrong. Message disappears when user starts typing.
All of this is explained in the reference and in the API, both of which I have in my browser when programming with Dojo.