Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Regular Expressions in num-exp

Hello All,

I had a problem on my SRST gateway with num-exp insterting a repeating pattern into my 7-digit dialing when in fallback mode.

For a brief example, the 7digit internal dialing is 21621.. or 21622..

The num-exp statement of 'num-exp 2... 2162...' was not allowing me to 7-digit dial directly from one IP phone to another while in fallback mode.

When I dialed 2162154 the 2162 would hit the num-exp and be expended to 2162162.

I have a work around that uses a voice translation-rule, applied to the call-manager-fallback config that will translate a 7-digit dialed string to the 4 digit dialed string which then hits the 4-digit to 7-digit num-exp and it is working fine.

However, I was wondering if there is a way to  use regular expressions in num-exp so that perhaps I can skip the intermediate step of using the translation-rule. Based off my existing translation-rules that are working properly, I figured something like this might work for num-exp:

'num-exp /^2\([12]..$\)/ /2162\1/'

But when I try to issue a num-exp with a regular expression I get the following message.

Incorrect format for Number macro pattern

        regular expression must be of the form  ^((\+)?([0-9#*A-F.]|(\\\*))+(\$)?)$

I have tried a number of different combinations with no success.  I always get the same message.  The regular expression that I tried first was:

'num-exp ^2... 2162...'

This is when I first saw the "Incorrect format..." message and figured that is must be possible.  Is this just a generic warning similar to when you try to use complex regular expressions with the 'translation-rule' command vs. the 'voice translation-rule' command and in reality you cannot use regular expressions in the num-exp command?

Thank you,

Leo

Everyone's tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Hall of Fame Super Silver

Regular Expressions in num-exp

Translation rules or dialplan-pattern is what you want to use, I am not aware of any regular expression support with num-exp, why do you insist on using num-exp?

Chris

3 REPLIES
Hall of Fame Super Silver

Regular Expressions in num-exp

Translation rules or dialplan-pattern is what you want to use, I am not aware of any regular expression support with num-exp, why do you insist on using num-exp?

Chris

New Member

Re: Regular Expressions in num-exp

Hi Chris,

Thank you for taking the time to answer my question.  It looks like the answer is no, num-exp does not support regular expressions.

I don't insist on using num-exp for this I was just hoping to kill two birds with one stone and possibly skip the intermediate step of translating the 7-digits dial to 4-digits using a translation-rule just to expand from 4-digit to 7 again.  This is only an issue while in SRST if a user tries to dial using 7-digits.  We have a 7-digit internal dialing scheme and normally my num-exp is just to expand the 4 digits sent from the telco to our 7-digit internal dialing.  The problem is that both our prefix and part of our DID range start with 21 so while in SRST if a user tried to dial a 7-digit DN, say 2162154, after they dialed the 4th digit (2162) that pattern would hit the num-exp and get expanded to 2162162.  I was hoping to create a num-exp using a regular expression that would only expand a four digit string that begins with a 2 to seven digits and not any string that begins with a 2.  This would 1) expand the four digits sent from the telco and 2) not match a seven digit string that begins with a 2 such as 2162154 which may be dialed by a user.

Again, this is only an issue while in SRST and I have a pretty good work around so I'm fine with not being able to use a regular expression as part of my num-exp config.  I just thought it would be a cool application of a regular expression if it was possible.

Thanks again for answering my question.

Leo

Hall of Fame Super Silver

Re: Regular Expressions in num-exp

Leo,

Translation rules are the way to handle this type of scenario, so if that is what you used you've picked the right solution.

HTH,

Chris

1007
Views
0
Helpful
3
Replies
CreatePlease login to create content