We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

catch event with count attribute ignored

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
terry.aney
Posts: 4
Joined: Tue Oct 21, 2014 11:23 am

catch event with count attribute ignored

Post by terry.aney »

Given the code below that occurs directly below the <vxml/> element, I'm trying to get it so that if you answer No, then Yes, it prompts with "You must file..." and starts over. But if you answer that 3 times, it prompts with 'Because you have not...' and ends the call. I never hit the count=3 <catch/> element. I jus keep cycling through.

Code: Select all

	<form id="severance">
	    <catch event="noUnemployedInsurance" count="3">
		    <prompt cond="culture=='en-US'">Because you have not......</prompt>
		    <goto next='../Shared.Severance/VXML/EndCall.aspx' maxage="0" maxstale="0"/>
	    </catch>
	    <catch event="noUnemployedInsurance">
		    <prompt cond="culture=='en-US'">You must file...</prompt>
		    <goto next="#severance" />
	    </catch>

		<field name="isUnemployedInsurance" type="boolean" cond='true' expr='undefined'>
			<prompt cond="culture=='en-US'">Have you filed for state unemployment insurance benefits?  Please press 1 for yes or 2 for no.</prompt>
		</field>
		<field name="isUnemployed" type="boolean">
			<prompt cond="culture=='en-US'">Are you currently unemployed?  Please press 1 for yes or 2 for no.</prompt>
			<filled>
				<if cond="!isUnemployedInsurance && isUnemployed">
				    <assign name="isUnemployed" expr="undefined"/>
				    <assign name="isUnemployedInsurance" expr="undefined"/>
				    <throw event="noUnemployedInsurance"/>
				</if>
			</filled>
		</field>

     ....

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: catch event with count attribute ignored

Post by support »

Hi Terry,

The reason that you were not reaching the <catch event="noUnemployedInsurance" count="3"> block in your code was due to the <goto next="#severance" /> line in your <catch event="noUnemployedInsurance"> block. Each form contains an internal counter, which gets reset each time the form is entered. Each time you issued the <goto next="#severance"/> command, the form's counter was being reset, therefore causing the counter to always be one and always hit the same <catch> block.

You can remedy this by modifying the <goto> in you <catch event="noUnemployedInsurance"> as such:

Code: Select all

<catch event="noUnemployedInsurance">
    <prompt>You must file...</prompt>
    <goto nextitem="isUnemployedInsurance"/>
</catch>
This way, instead of re-entering the form and clearing the form's internal counter, you will redirect to the first field element to re-prompt the user, and the counter will remain intact.

Please let us know if you have any additional questions.

Regards,
Plum Support

terry.aney
Posts: 4
Joined: Tue Oct 21, 2014 11:23 am

Re: catch event with count attribute ignored

Post by terry.aney »

Correct. I discovered this right before I posted, then was going to continue to post and answer myself for benefit of others, but I had to wait for post to be moderated. Thanks for confirmation.

Post Reply