Solved

Telephony regular expression question

Posted on 2011-09-23
11
278 Views
Last Modified: 2012-06-27
In the voice translation-rule below - what is the difference between rule 1 and rule 2?
Is it that rule 1 will match 1919678 and rule 2 would not?  And a related question - would 919678 (with no leading digit) also match rule 1 (making rule 2 superfluous?)  This is on a Cisco 3845 voice gateway and I'm trying to free up some space in the translation rule.  Thanks!

voice translation-rule 10
 rule 1 /^\+919678/ //
 rule 2 /^919678/ //
0
Comment
Question by:amigan_99
  • 4
  • 3
  • 3
  • +1
11 Comments
 
LVL 15

Expert Comment

by:sr75
ID: 36592645
You can teat your translation rules.  

Test voice translation rule 10 (any number)


But to answer you question.  the  ^ means begins with so rule 2 would not match as it begins with 9.
0
 
LVL 1

Author Comment

by:amigan_99
ID: 36592734
What does the \+ mean?  I understand the \ escapes the following character to it means literally "+".  But there is no "+" key on a telephone.  So when would that ever be found in a dial string?
0
 
LVL 15

Expert Comment

by:deepdraw
ID: 36592739
Well i would say test it to make sure. But i think your are right.
so remove it from the config and test using.

test voice translation-rule 10 919678


Use the link below for reference on translation rules.
http://www.cisco.com/en/US/tech/tk652/tk90/technologies_tech_note09186a0080325e8e.shtml

Greg
0
 
LVL 15

Accepted Solution

by:
deepdraw earned 500 total points
ID: 36592751
Sorry was in the kitchen and did not see any of the above comments
From the link above.

. Any single digit
0 to 9,*,# Any specific character
[0-9] Any range or sequence of characters
* Modifier—match none or more occurrences
+ Modifier—match one or more occurrences
? Modifier—match none or one occurrence


Greg
0
 
LVL 1

Author Closing Comment

by:amigan_99
ID: 36592805
Thanks much!
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 19

Expert Comment

by:feptias
ID: 36592815
Telephone keypads may not have a + key (although some do on the zero button), but SIP gateways and equipment used by telephone service providers may insert the + character as a prefix because it is defined in the ITU's E.164 standard for international numbering plans and is a valid prefix in the North American Numbering Plan.
http://en.wikipedia.org/wiki/E.164
http://en.wikipedia.org/wiki/North_American_Numbering_Plan

(How did we all manage before Wikipedia?)

In your regular expression it is a literal + and is not being used to mean "match one or more occurences"
0
 
LVL 1

Author Comment

by:amigan_99
ID: 36592830
Thank you feptias.  I was thinking that likely the \ was stripping the + of its magic powers.  Appreciate the confirmation.  I need to check with my carriers if they are every likely to pass me a +.
0
 
LVL 15

Expert Comment

by:deepdraw
ID: 36592956
E.164 numbers can have a maximum of fifteen digits and are usually written with a + prefix. To actually dial such numbers from a normal fixed line phone, the appropriate international call prefix must be used.


from the website http://en.wikipedia.org/wiki/E.164.

It says you dont ever dial a +
and if you could it would not be recognised by the cisco equipement or any other AFAIK.
Greg
0
 
LVL 19

Expert Comment

by:feptias
ID: 36595721
> "It says you don't ever dial a +"
I could not see that quoted anywhere in the wiki article.

A google search on "plus dialing" returns various results discussing the benefits of dialing + as a prefix for international calls. For example:
http://www.messagingnews.com/onmessage/ben-gross/using-plus-simplify-international-dialing
http://www.howtocallabroad.com/qa/plus-sign.html
Also, as I mentioned earlier, the + symbol is printed on the zero key of some mobile phones.

> "...if you could it would not be recognised by the cisco equipment"
But isn't that why the Cisco 3845 mentioned in the question already had a regular expression specifically to recognise the prefix?
0
 
LVL 15

Expert Comment

by:deepdraw
ID: 36595777
rule 1 /^\+919678/ //
 rule 2 /^919678/ //


the + is to include numbers like 1919678 or 11919678 in fact any number infront of 919678

Greg
0
 
LVL 19

Expert Comment

by:feptias
ID: 36595956
I don't pretend to be an expert on regular expressions, but I thought \+ would be interpreted as a literal plus sign. However, it does seem an extremely unlikely dial string in this particular context and your interpretation would make more sense.

Please see the section "Escaped" characters literals in the following link (approx two thirds of the way down the the whole article):
http://gnosis.cx/publish/programming/regular_expressions.html
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
NBX V3000 Flashing Red Lights - What does this mean 5 60
Skype for Business 2015 2 69
Is this QoS Correct on this  CISCO 3825 Router 1 36
Using TAPI 2 61
How To Create Custom / Distinctive Ring Tones on Polycom Phones Purpose and Overview When creating a custom ring tone, you have simple aspirations: to make your phone cooler than everyone else's. Perhaps you need a louder ringer. Perhaps you w…
In my office we had 10 Cisco 7940G IP phones that were useless as they were showing PROTOCOL APPLICATION INVALID when started. I searched through Google and worked for a week continuously on those phones, and finally got them working. This is a di…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now