cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
821
Views
0
Helpful
2
Replies

VXML transfer app with variable length phone number

budfox128
Level 1
Level 1

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

2 Replies 2

DaSpadeR
Level 1
Level 1

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

budfox128
Level 1
Level 1

The answer to this question can be found at Cisco bug ID # CSCea15106.