Solved

Telephony regular expression question

Posted on 2011-09-23
11
286 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:greg ward
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Accepted Solution

by:
greg ward 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
 
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:greg ward
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:greg ward
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

The point of this post is to give you a copy/paste installation solution to setting up Asterisk 1.6 on Ubuntu 9.04 (or similar) server. # Setup the system apt-get install subversion apt-get install make apt-get install linux-source kernel-p…
Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

696 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