inputphone-numberphone-calltransfervxml

VXML use the input for transfer


I'm trying to get user input (country code + phone number) in order to call it later on using the transfer element.

My problem meets at the transfer elements, which just hang up. I do not know how to debug them. I'm using NEXMO as a provider. I searched and tried a lot of stuff beforehand including testing each function seperately (which works!).

<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.1">
   <property name="inputmodes" value="dtmf" />
   <form id="get_mobile_number">
      <field name="mobileno" type="digits?minlength=7;maxlength=13">
         <prompt>
            <prosody rate="slow"> please enter your 7 to 13 digit mobile number !</prosody>
         </prompt>
         <!--INVALID-->
         <nomatch count="1">
            <prompt>
               <prosody rate="slow"> Is that a number? Please try again. </prosody>
            </prompt>
            <reprompt/>
         </nomatch>
         <!--TIMEOUT-->
         <noinput count="1">
            <prompt>Again, please enter your 7 to 13 digit mobile number !</prompt>
            <reprompt/>
         </noinput>
         <catch event="noinput nomatch" count="3">
            <prompt>Please try again later. Good bye.</prompt>
            <exit/>
         </catch>
         <filled>
            <goto next="#call_number"/>
         </filled>
      </field>
   </form>

   <form id="call_number">
      <transfer name="result" destexpr="'tel:+'+ mobileno" bridge="true">
         <prompt>Please wait while we transfer you.</prompt>
         <grammar xml:lang="en-US" root = "TOPLEVEL" mode="voice">
            <rule id="TOPLEVEL" scope="public">
               <one-of>
                  <item> disconnect </item>
               </one-of>
            </rule>
         </grammar>
      </transfer>
      <filled>
         <if cond="result == 'busy'">
            <prompt>Sorry, they're busy.</prompt>
            <elseif cond="result == 'noanswer'" />
            <prompt>Sorry, they didn't answer.</prompt>
            <else />
            <prompt>
               You spoke for <value expr="result$.duration" /> seconds.
            </prompt>
         </if>
         <if cond="result$.inputmode == 'voice'">
            You ended the call by saying,<value expr="result$.utterance" />.
         </if>
      </filled>
   </form>
</vxml>

Does anyone have any idea what's wrong with it?


Solution

  • On the surface, the logic seems to be correct.

    To debug this, I'll suggest running only the form call_number (without the form get_mobile_number) and putting in the actual number instead of + mobileno in the form 'call_number'. You will then know if the call is indeed going through.

    If it still does not go through, then you may have to work on the correct format as expected by the provider (it may not be a VXML error).

    Alternatively, you can just check the IVR logs and see what number is being dialled in (and if you can identify any obvious error there itself)