vXML if statement (DTFM only) - vxml

I have a simple yes or no question being asked in vXML 2.0. I am trying to get the user to be able to press 1 for yes, or two for 2 for no. I have looked up dozens of answers to this question, however, they all mentioned voice input only and not dtfm. I'm sure it is an obvious answer, but I am at a loss.
Here is my code
<form>
<field name="verifyinput" type="digits?minlength=1;maxlength=1">
<prompt> You entered <?php echo $_SESSION["accountnumber"]; ?>. . If that is your Account Number Press 1. Otherwise Press 2.
</prompt>
<filled>
</filled>
</field>
</form>
I am not sure what to put in the Filled tab.

For simple recognition results, you can just check the value of the field name:
<form>
<field name="verifyinput" type="digits?minlength=1;maxlength=1">
<prompt> You entered <?php echo $_SESSION["accountnumber"]; ?>. . If that is your Account Number Press 1. Otherwise Press 2.
</prompt>
<filled>
<if cond="verifyinput == '1'">
<!-- executable content -->
<prompt>You said one</prompt>
<elseif cond="verifyinput == '2'"/>
<!-- executable content -->
<prompt>You said two</prompt>
<else/>
<!-- executable content -->
<prompt>You made an invalid choice</prompt>
</if>
</filled>

Related

Conditional blocks are executing after executing all the prompts inside a field in vxml

sample_vxml
<if cond="00==1">
<prompt><audio src="http://127.0.0.1/ivr/audio/en/cent.wav"/></prompt>
<else/>
<prompt><audio src="http://127.0.0.1/ivr/audio/en/cents.wav"/></prompt>
</if>
<prompt><audio src="http://127.0.0.1/ivr/audio/en/break500.wav"/> </prompt>
<prompt><audio src="http://127.0.0.1/ivr/audio/en/Press_3.wav"/> </prompt>
<prompt><audio src="http://127.0.0.1/ivr/audio/en/to_pay_your.wav"/> </prompt>
<prompt><audio src="http://127.0.0.1/ivr/audio/en/curr_stmt_bal_amt.wav"/> </prompt>
above the conditional block in the field tag is executing after all the prompt tags are executed.after "" this prompt it should play either cent.wav or cents.wav then it should play the remaining prompts after conditional block but it is entering into conditional block after all other prompts executed. can anyone suggest how can I resolve this issue.
You are using <if> in a parent that is not allowed, you can only use <if> inside the tags.
<block>, <catch>, <error>, <filled>, <foreach>, <help>, <if>, <noinput>, <nomatch>
You will have to create a variable with the locution that you want to give in a <block> before the <field> in the same <form>, for example.
There are a few places where it is documented as:- Dialogic

Angular 2 INTERNATIONALIZATION (I18N):Not able find target tag in ganerated xlf file

i am using angular-cli, followed angular-io to generate in Spanish language.
app.component.html
<h2 i18n="header">Login form</h2>
<div>
<span i18n>Email</span>
<input type="text" placeholder="Your email" i18n-placeholder>
</div>
<div>
<span i18n>Password</span>
<input type="password" placeholder="Password" i18n-placeholder>
</div>
<hr>
<div i18n>If you want to search something, go to Google</div>
message.es.xlf
<?xml version="1.0" encoding="UTF-8" ?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="ng2.template">
<body>
</body>
</file>
</xliff>
getting generated message.es.xlf file once completing ./node_modules/.bin/ng-xi18n,but not able to find target tag in that file.
please help me
A little late but may help someone. Had the same problem, I resolved it by specifying the output file:
./node_modules/.bin/ng-xi18n --i18nFormat=xmb --outFile=messages.xmb
It is 2019, when I come back to Angular, and I found this same issue. The problem is that your XLF file must have a pair of target tags for every pair of source tags. You may add those tags manually, probably by copying and pasting and renaming the source tags, or you may use this script:
https://github.com/geocarlos/angular-i18n-target-tagger

using variable in transfer tag in vxml

I am writing a VXML script to execute a Bridge transfer.
This is how it looks-
<?xml version="1.0" encoding="UTF-8"?>
<vxml xmlns="http://www.w3.org/2001/vxml" version="2.0" >
<form id="F1">
<transfer aai="name:Caller1; ANI:94100; myAaiCDATA" name="T_1" bridge="true" dest="sip:5060#10.130.140.38" >
<prompt>
Placing the call
</prompt>
</transfer>
</form>
</vxml>
It completes the transfer successfully.
Now, instead of passing hard-coded values for aai name, ANI, I want to pass on variables.
For e.g.- I want to pass transfer dest value from a variable.
How can I do that?
Your help is greatly appreciated.
Per the specification, you can set the aii and dest values dynamically with aiiexpr and destexpr. With these attributes, the value is treated as an ECMAScript expression that is executed with the result value being used.

Submit data-table in JSF / Primefaces?

I am working on a web application using jsf/ primefaces, netbeans and tomcat.
I have a datatable with some values loaded in from another table and some editable fields. My question is, after the user has edited this table how do i submit the whole table so it can be stored in a database, in a new table?
<h:form id="form" prependId="false">
<h3>All of your Paddocks</h3>
<p:dataTable var="paddock" value="#{paddock.getfromPaddock()}" editable="true">
<p:ajax event="rowEdit" listener="#{paddock.onRowEdit}" />
<p:ajax event="rowEditCancel" listener="#{paddock.onRowCancel}" />
<p:column headerText="Id">
<h:outputText value="#{paddock.idPaddock}" />
</p:column>
<p:column headerText="Name">
<h:outputText value="#{paddock.name}" />
</p:column>
<p:column headerText="Area">
<h:outputText value="#{paddock.area}" />
</p:column>
<p:column headerText="Enter Grass Weight">
<p:cellEditor>
<f:facet name="output"><h:outputText value="0" /></f:facet>
<f:facet name="input"><p:inputText id="modelInput" value="0" style="width:100%"/></f:facet>
</p:cellEditor>
</p:column>
<p:column style="width:32px">
<p:rowEditor />
</p:column>
</p:dataTable>
<h:commandButton value="Log" action="#{paddock.add}" />
</h:form>
Note that the only editable column is the grass column.
First of all, there are two main mistakes which may have undesired side effects:
<h:form ... prependId="false">
Never use prependId. Remove the whole attribute.
<p:dataTable var="paddock" value="#{paddock.getfromPaddock()}">
You should give var a different name than the managed bean. E.g. paddockItem.
As to the concrete question, your other mistake is here:
<p:inputText id="modelInput" value="0" />
You didn't bind the input value to the model. So JSF won't be able to update the model with the submitted values anyway.
Fix it accordingly, e.g.:
<p:inputText id="modelInput" value="#{paddockItem.grass}" />
In the submit method, it'll be right away there in the model.
You should only make absolutely sure that you aren't interacting with the database in the getter method of the <p:dataTable value>, otherwise you will be overwriting the model on every iteration round, hereby basically trashing the submitted values until the last row before the submit method is hit. The strange method name behind the data table value value="#{paddock.getfromPaddock()}" namely suggests that you're doing that. If it were a real property, the average starter would just have used value="#{paddock.fromPaddock}" or so.
See also:
How and when should I load the model from database for h:dataTable

CakePHP: How do I reference a flash asset in my plugin's webroot?

I'm using CakePHP to build a plugin and am trying to add a flash asset to my view.
The tag looks like this:
<object type="application/x-shockwave-flash" data="unknown_url" id="VideoPlayback">
<param name="movie" value="unknown_url" />
<other params....>
</object>
Unfortunately I don't know what url to point to!
Given that my plugin is using standard structure (for CakePHP 1.3x) i would like to access my flash file which is stored here:
app/plugins/my_plugin/webroot/flash/my_flash_file.swf
I know that in the php side /my_plugin/flash/my_flash_file.swf gets rewritten to route correctly (this works just fine when I try something like $this->Html->img('URL') ), but I don't know of any Html Helper function to create object tags.
Any help would be appreciated!
You can use $this->Html->url() to create correct URLs.
<object type="application/x-shockwave-flash" data="<?php echo $this->Html->url( ' /my_plugin/flash/my_flash_file.swf' ); ?>" id="VideoPlayback">
<param name="movie" value="<?php echo $this->Html->url( ' /my_plugin/flash/my_flash_file.swf' ); ?>" />
<other params....>
</object>
<?php echo $html->url('/webroot/uploadify/uploadify.swf');?>
it will give you link like /your_app_name/webroot/uploadify/uploadify.swf

Resources