Solved

Telephony regular expression question

Posted on 2011-09-23
11
281 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: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
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 
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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Article by: user_n
How Sip Phone (User Agent) works and communicates with sip servers 1.  There is a sip server and a sip registrar.  The sip server and sip registrar can be one server or two different servers. The sip registrar is the server on which it is record…
Almost all Internet protocol telephones have built-in switches at the back that allow you to connect your personal computer to one port and use the other port to connect your phone to to a Cisco switch.   Why we need to connect the PC to the pho…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

828 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