04-25-2006 03:15 PM
In a vxml app running on a router I am trying to use a variable length in the telephone number entered by the caller / user.
This works just fine with the router dial-peers if the telephone number is 11 digits...
<form id="get_number">
<field name="phone_number" type="digits?minlength=7;maxlength=11">
<grammar type="application/grammar+regex">...........</grammar>
<prompt>
<audio>etc...
</prompt>
</field>
<transfer name="theCall" destexpr="'phone://'+phone_number" connecttimeout="30s" bridge="false">
etc...
This works just fine if the user enters 11 digits (i.e. US long distance call) but just hangs with 7 digits (a local call) waiting for the other 4 digits. Is there a way to make the grammar a variable length so the person can call single digit ("0"), or 3 digit ("411"), or 7 or 10 digit local calls, or 11 digit long distance calls? I would settle for calls between 7 and 11 digits.
Thanks,
Bud
04-26-2006 03:13 AM
Your regexp only matches 11 characters, ie 11 dots. To match between 7 and 11 char you could do
.{7,11}
Note this would also match 8,9,10, and . matches ANY character including # or a-z.
Also, make sure you have dial-peers that will match the shorter number. There are more complicated ways to do it that would do 3,7,11, but this should get you started. Read up on regular expressions.
John Spade
webVoIP
06-27-2006 08:28 AM
The answer to this question can be found at Cisco bug ID # CSCea15106.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide