Conditional blocks are executing after executing all the prompts inside a field in vxml - 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

Related

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.

Camel - StringTemplate doesn't display CamelBatchSize

I've a small string template (fragment for testing):
{headers.CamelBatchSize}
{headers.CamelFileName}
{headers.CamelFilePath}
{headers.fileCount}
And when I call it:
<setHeader headerName="fileCount">
<simple>${headers.CamelBatchSize}</simple>
</setHeader>
<to uri="string-template:file:notifymail.tm?delimiterStart={&delimiterStop=}" />
The first row is empty (CamelBatchSize) while the others displayed well. Why cannot I use the CamelBatchSize (without putting it into another header variable)? Where am I wrong?
Are you using a Batch-Consumer? https://camel.apache.org/batch-consumer.html

vXML if statement (DTFM only)

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>

How do you use the Solr DIH to select XML based on descriptive values?

The XML has some descriptive fields and I would like to use them to select specific fields. Is there a way to get the data import handler to pick only "Text Block A" and "Text Block B" using "code=34089-3" as a key? The code field has no data but it is unique to the type of information I want to pick. When I use xpath="/document/component/section/text/paragraph" I end up with text blocks A, B, C and D. Ideally I would like to be able to pick only text block A. Is this even possible?
<component>
<section>
<id root="f915965e-fe3b-44eb-a2ed-c11f807e7f23"/>
<code code="34089-3"/>
<title>Title A</title>
<text>
<paragraph>Text Block A</paragraph>
<paragraph>Text Block B</paragraph>
</text>
</section>
</component>
<component>
<section>
<id root="80b7e2f1-f49f-4309-a340-210536705d4a"/>
<code code="34090-1"/>
<title>Title B</title>
<text>
<paragraph>Text Block C</paragraph>
<paragraph>Text Block D</paragraph>
</text>
</section>
</component>
<entity
name="IUPAC"
processor="XPathEntityProcessor"
forEach="/document"
url="${f.fileAbsolutePath}">
<field column="chemical_name" xpath="/document/component/section/code[#code='34089-3']/access below values???" />
</entity>
Try something like that:
/document/component/section[code/#code='34089-3']/text/paragraph

determine issued rowCommand by command name

I have two row commands running on a gridpanel like the following:
<ext:CommandColumn>
<Commands>
<ext:GridCommand Icon="NoteEdit" CommandName="mailEdit">
<ToolTip Text="Edit" />
</ext:GridCommand>
<ext:GridCommand Icon="ApplicationLightning" CommandName="mailChangeBlock">
<ToolTip Text="block/unblock" />
</ext:GridCommand>
</Commands>
</ext:CommandColumn>
now i listen to these row commands:
<Listeners>
<Command Handler="if(command == 'mailEdit'){mailEdit}else{mailChangeBlock}; console.log(command);"/>
</Listeners>
another try was following:
<Command Handler="(command == 'mailEdit') ? mailEdit : mailChangeBlock;" />
the console log is executed without problems, but a console.log in the function called is not executed, even though the function gets called as soon as you add brackets to each call, but then the data passed to the function is lost.
my question is now, how can i determine which command was executed and call a corresponding function and give value, metadata and record to it?
It is possible to send the Command name and other values by Extra Params:
<DirectEvents>
<Command OnEvent="GridCommand">
<ExtraParameters>
<ext:Parameter Name="commandname" Value="command" Mode="Raw" />
<ext:Parameter Name="recordid" Value="record.data.id" Mode="Raw" />
</ExtraParameters>
</Command>
</DirectEvents>
the determination of command can then be executed server-sided (command returns the CommandName defined in the CommandColumn) and then execute server-sided script.

Resources