2
votes

How to return the DTMF input during voice file playback. I am executing AGI from Asterisk dial plan and from the vxml file I want to return the collected DTMF. Here is my vxml

<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
<form id="top">
  <property name="inputmodes" value="dtmf"/>
  <field name="mydigits" type="digits?maxlength=1">
    <prompt>
      <audio type="audio/basic" src="http://127.0.0.1/soundfiles/mysound.wav"/>     
    </prompt>
    <grammar mode="dtmf" version="1.0">
    <rule id="digit" scope="public">
     <one-of>      
       <item> 1 </item>
       <item> 2 </item>
       <item> 3 </item>      
     </one-of>
    </rule>
    </grammar>    
  </field>
  <filled mode="any">    
    <return namelist="mydigits"/>
  </filled>
</form>
</vxml>

I read that from my asterisk dial plan as:-

;;this will call the local hosted vxml file above     
    exten => 1,n,Agi(agi://127.0.0.1/url=${vxmlurl})


;;try to read the data set at vxml file.    
exten => 1,n,Verbose(0, "got mydigits ${mydigits} !")

But it does not get anything other than empty to the Asterisk dial plan variable.
Any idea of what I miss there?

2

2 Answers

0
votes

Are you using Voximal ? If you want to return a value from the Voximal to the Dialplan, the simplest way is to use tag like . The value will pass to the dialplan context channel with the variable VOXIMAL_RESULT.

0
votes

BINGO. I was able to pass it via exit element.

And I was able to get it from asterisk dial plan.

Also I am using the Voiceglue

in my Dial plan

exten => 1,n(PLAYAGI),Agi(agi://127.0.0.1/url=${vxmlurl})
exten => 1,n,Verbose(0, "got mydigits ${mydigits} !")

in my vmxl mydigits contains the DTMF input by caller.

<exit namelist="mydigits"/>

vmxl interpreter take care the rest of the work and sets it to the Asterisk variable so that I could access as normal variable ${mydigits}