06.12.2012 Views

Using the Dial Plan on the snom phones

Using the Dial Plan on the snom phones

Using the Dial Plan on the snom phones

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

F REQUENTLY<br />

A SKED<br />

Q UESTION<br />

<str<strong>on</strong>g>Using</str<strong>on</strong>g> <str<strong>on</strong>g>the</str<strong>on</strong>g> <str<strong>on</strong>g>Dial</str<strong>on</strong>g> <str<strong>on</strong>g>Plan</str<strong>on</strong>g> <strong>on</strong> <str<strong>on</strong>g>the</str<strong>on</strong>g><br />

Date: Mar-27-2004<br />

Author: Christian Stredicke<br />

Document: faq-04-03-27-cs<br />

<strong>snom</strong> ph<strong>on</strong>es


On <str<strong>on</strong>g>the</str<strong>on</strong>g> ph<strong>on</strong>e, a dial plan may have <str<strong>on</strong>g>the</str<strong>on</strong>g><br />

following functi<strong>on</strong>s:<br />

• Determine when a number is complete<br />

(e.g. ten-digit number in USA)<br />

• Automatically c<strong>on</strong>vert local numbers into<br />

global numbers (e.g. dialing 398330<br />

in Berlin, Germany gets c<strong>on</strong>verted into<br />

+4930398330)<br />

• Automatically append <str<strong>on</strong>g>the</str<strong>on</strong>g> local domain<br />

(e.g. dialing 398330 gets c<strong>on</strong>verted into<br />

sip:398330@company.com;user=ph<strong>on</strong>e)<br />

The ph<strong>on</strong>e is able to generate predefined<br />

dial plans from <str<strong>on</strong>g>the</str<strong>on</strong>g> user interface (see <str<strong>on</strong>g>the</str<strong>on</strong>g><br />

descripti<strong>on</strong> of <str<strong>on</strong>g>the</str<strong>on</strong>g> ph<strong>on</strong>e user interface).<br />

The dial plan depends <strong>on</strong> <str<strong>on</strong>g>the</str<strong>on</strong>g> outgoing<br />

line identity; <str<strong>on</strong>g>the</str<strong>on</strong>g>refore <str<strong>on</strong>g>the</str<strong>on</strong>g> <strong>snom</strong> ph<strong>on</strong>e<br />

supports seven dial plan entries. Those entries<br />

are available in <str<strong>on</strong>g>the</str<strong>on</strong>g> SIP/Stack settings.<br />

From a requirement point of view, dial<br />

plans are similar to <str<strong>on</strong>g>the</str<strong>on</strong>g> replacements known<br />

from ENUM or NAPTR. Therefore, <strong>snom</strong> built<br />

up<strong>on</strong> <str<strong>on</strong>g>the</str<strong>on</strong>g>se mechanisms and added some<br />

more features that make <str<strong>on</strong>g>the</str<strong>on</strong>g>m suitable for <str<strong>on</strong>g>the</str<strong>on</strong>g><br />

above scenarios.<br />

The first additi<strong>on</strong>al feature is that <str<strong>on</strong>g>the</str<strong>on</strong>g>re<br />

can be more than <strong>on</strong>e pattern. The patterns<br />

are separated by spaces. The first pattern<br />

which yields a match is taken.<br />

<str<strong>on</strong>g>Dial</str<strong>on</strong>g> <str<strong>on</strong>g>Plan</str<strong>on</strong>g> Entries<br />

<str<strong>on</strong>g>Dial</str<strong>on</strong>g> plan entries have three parts. The<br />

parts may be seperated by any character;<br />

typically <str<strong>on</strong>g>the</str<strong>on</strong>g> characters “!” or “|” are used for<br />

seperati<strong>on</strong>.<br />

The first part c<strong>on</strong>tains a pattern which<br />

is used for matching <str<strong>on</strong>g>the</str<strong>on</strong>g> dialled number. The<br />

sec<strong>on</strong>d part c<strong>on</strong>tains <str<strong>on</strong>g>the</str<strong>on</strong>g> result or <str<strong>on</strong>g>the</str<strong>on</strong>g> dial plan<br />

step and <str<strong>on</strong>g>the</str<strong>on</strong>g> third (opti<strong>on</strong>al) part c<strong>on</strong>tains<br />

flags that set additi<strong>on</strong>al processing attributes.<br />

The following flags are available:<br />

• The “d” flag means that <str<strong>on</strong>g>the</str<strong>on</strong>g> number is<br />

complete and can be dialed. Example:<br />

“|[0-9]{5}|sip:\1@test.com|d” means<br />

that a number with five digits will be dialed<br />

automatically.<br />

• The “i” flag means that <str<strong>on</strong>g>the</str<strong>on</strong>g> comparis<strong>on</strong>s<br />

should be d<strong>on</strong>e case-insensitive.<br />

[ F R E Q U E N T L Y A S K E D Q U E S T I O N ]<br />

Substituti<strong>on</strong>s<br />

Substituti<strong>on</strong>s are found in <str<strong>on</strong>g>the</str<strong>on</strong>g> sec<strong>on</strong>d<br />

part of <str<strong>on</strong>g>the</str<strong>on</strong>g> dial plan entry. The following<br />

substituti<strong>on</strong>s are available:<br />

• The “d” replacement inserts <str<strong>on</strong>g>the</str<strong>on</strong>g> name of<br />

<str<strong>on</strong>g>the</str<strong>on</strong>g> registrar. For example, „!*!sip:\1@\d!“<br />

inserts <str<strong>on</strong>g>the</str<strong>on</strong>g> domain name behind <str<strong>on</strong>g>the</str<strong>on</strong>g> „@“<br />

symbol.<br />

• The 1-9 replacements insert matches 1-<br />

9 according to RFC2915. For example,<br />

“!(.+)!sip:\1!” inserts a “sip:” before <str<strong>on</strong>g>the</str<strong>on</strong>g><br />

string (which is <str<strong>on</strong>g>the</str<strong>on</strong>g> first match).<br />

Triggering ENUM<br />

The ph<strong>on</strong>e supports ENUM lookup. In<br />

order to trigger <str<strong>on</strong>g>the</str<strong>on</strong>g> steps described in <str<strong>on</strong>g>the</str<strong>on</strong>g><br />

ENUM RFC2916, <str<strong>on</strong>g>the</str<strong>on</strong>g> SIP URI must c<strong>on</strong>tain <str<strong>on</strong>g>the</str<strong>on</strong>g><br />

parameter ph<strong>on</strong>e set to yes (“;ph<strong>on</strong>e=yes”).<br />

The ENUM handling of <str<strong>on</strong>g>the</str<strong>on</strong>g> ph<strong>on</strong>e is described<br />

in a separate document.<br />

Summary of extended regular<br />

expressi<strong>on</strong>s<br />

See also <str<strong>on</strong>g>the</str<strong>on</strong>g> Internet for detail descripti<strong>on</strong><br />

of extended regular expressi<strong>on</strong>s.<br />

• To match a character, just use that character.<br />

If a character has a special meaning, it has<br />

to be escaped by <str<strong>on</strong>g>the</str<strong>on</strong>g> backslash character.<br />

• ^ matches <str<strong>on</strong>g>the</str<strong>on</strong>g> beginning of a string, $<br />

matches <str<strong>on</strong>g>the</str<strong>on</strong>g> end of a string<br />

• dot („.“) matches every character.<br />

• To match a range of characters, use [<br />

and ] and list <str<strong>on</strong>g>the</str<strong>on</strong>g> characters between <str<strong>on</strong>g>the</str<strong>on</strong>g><br />

brackets. Ranges can be defined by <str<strong>on</strong>g>the</str<strong>on</strong>g><br />

dash symbol. Ranges can be negated by<br />

<str<strong>on</strong>g>the</str<strong>on</strong>g> ^ symbol (for example [^0-9] matches<br />

all characters but numbers).<br />

• „+“, „*“, „?“ are multipliers which match<br />

at least <strong>on</strong>ce („+“), a unlimited number<br />

of times („*“) and at most <strong>on</strong>ce („?“).<br />

Multipliers can also be explicitly stated in<br />

curly brackets, for example {5,9} means at<br />

least 5 times, at most 9 times. {5,} means<br />

at least five times, {5} means exactly<br />

five times. Without multiplier, exactly <strong>on</strong>e<br />

match is expected.<br />

• Brackets can be used to group matches<br />

(like in „(abc)?“ which matches „abc“ or<br />

<str<strong>on</strong>g>the</str<strong>on</strong>g> empty string).<br />

• The „|“ can be used to indicate alternate<br />

matches (like in „a|b“ which matches a or<br />

2 <strong>snom</strong> technology AG


).<br />

Examples:<br />

• “(sip:)?(+?[0-9]+)@.+” matches SIP<br />

URI that c<strong>on</strong>tain a teleph<strong>on</strong>e number<br />

(like sip:+4930432343@isp.de or<br />

30432343@isp.de).<br />

• “^sip:([^@]*)@(.*)” matches SIP URI that<br />

c<strong>on</strong>tain a user name<br />

• “http://([^/:]+)” matches typical http URL<br />

(like “http://bla.test.com/test.htm”)<br />

• “(A(B(C)DE)(F)G)” matches “ABCDEFG”<br />

• “(http://([^/:]+))|(SIP:([^@]+)@.*)”<br />

matches a http URL or a SIP URI.<br />

• “urn:cid:.+@([^\\.]+\\.)(.*)$” matches<br />

for example “urn:cid:39CB83F7.A8450130<br />

@fake.gatech.edu”.<br />

Examples for <str<strong>on</strong>g>Dial</str<strong>on</strong>g> <str<strong>on</strong>g>Plan</str<strong>on</strong>g>s<br />

One comm<strong>on</strong> usage is to c<strong>on</strong>vert an<br />

emergency number into a SIP URL. This<br />

pattern could look like this: “!^911$!sip:<br />

emergency@local!d”. Separated by <str<strong>on</strong>g>the</str<strong>on</strong>g><br />

exclamati<strong>on</strong> mark, it c<strong>on</strong>tains <str<strong>on</strong>g>the</str<strong>on</strong>g> pattern for<br />

<str<strong>on</strong>g>the</str<strong>on</strong>g> 911 and <str<strong>on</strong>g>the</str<strong>on</strong>g> resulting SIP URI. The d flag<br />

indicates that <str<strong>on</strong>g>the</str<strong>on</strong>g>re is no need to press <str<strong>on</strong>g>the</str<strong>on</strong>g> Ok<br />

key after dialing this number.<br />

Ano<str<strong>on</strong>g>the</str<strong>on</strong>g>r comm<strong>on</strong> problem is to make<br />

<str<strong>on</strong>g>the</str<strong>on</strong>g> ph<strong>on</strong>e dial a number when <str<strong>on</strong>g>the</str<strong>on</strong>g> pound<br />

key is pressed. The pattern could look like<br />

this: “!([^#]+)#!sip:\1@\d!d”. This dial plan<br />

entry will look for a pattern ending in a pound<br />

symbol and use this as <str<strong>on</strong>g>the</str<strong>on</strong>g> user name in a SIP<br />

URI (not including <str<strong>on</strong>g>the</str<strong>on</strong>g> pound symbol).<br />

Matching an internati<strong>on</strong>al number is<br />

easy. Just put <str<strong>on</strong>g>the</str<strong>on</strong>g> 011 pattern at <str<strong>on</strong>g>the</str<strong>on</strong>g> fr<strong>on</strong>t<br />

of <str<strong>on</strong>g>the</str<strong>on</strong>g> pattern, like in “|^011([0-9]*)$|sip:<br />

+\1@\d;ph<strong>on</strong>e=yes|”. This pattern requires<br />

that <str<strong>on</strong>g>the</str<strong>on</strong>g> user presses <str<strong>on</strong>g>the</str<strong>on</strong>g> Ok key in order to<br />

start <str<strong>on</strong>g>the</str<strong>on</strong>g> call.<br />

To make <str<strong>on</strong>g>the</str<strong>on</strong>g> ph<strong>on</strong>e dial a number<br />

when a certain number of digits have been<br />

reached, <str<strong>on</strong>g>the</str<strong>on</strong>g> following dial plan entry could<br />

be used: “|^1([0-9]{10})$|sip:+1\1@\<br />

d;ph<strong>on</strong>e=yes|d”. This pattern will look for a<br />

number starting with 1 and followed by ten<br />

digits. It will replace it with a URI that c<strong>on</strong>tain<br />

<str<strong>on</strong>g>the</str<strong>on</strong>g> hint to try an ENUM lookup first before<br />

sending it to <str<strong>on</strong>g>the</str<strong>on</strong>g> proxy.<br />

Calling a complete URI is a little bit<br />

more difficult because of <str<strong>on</strong>g>the</str<strong>on</strong>g> number of<br />

allowed characters in <str<strong>on</strong>g>the</str<strong>on</strong>g> user name. The<br />

following character can be base for such a<br />

[ F R E Q U E N T L Y A S K E D Q U E S T I O N ]<br />

dial plan entry: “|^([a-zA-Z0-9&=+\$,;?\-_<br />

.!~*‘()%]+@.+)|sip:\1|”. It is not necessarily<br />

<str<strong>on</strong>g>the</str<strong>on</strong>g> last word in this topic, as <str<strong>on</strong>g>the</str<strong>on</strong>g> user name<br />

part of <str<strong>on</strong>g>the</str<strong>on</strong>g> URI also may c<strong>on</strong>tain passwords.<br />

<str<strong>on</strong>g>Dial</str<strong>on</strong>g> <str<strong>on</strong>g>Plan</str<strong>on</strong>g> <strong>on</strong> <strong>snom</strong> ph<strong>on</strong>e 3


<strong>snom</strong> technology Aktiengesellschaft<br />

Pascalstr. 10B, 10587 Berlin, Germany<br />

Ph<strong>on</strong>e: +49 (30) 39833-0<br />

mailto: info@<strong>snom</strong>.com<br />

http: www.<strong>snom</strong>.com<br />

sip: info@<strong>snom</strong>.com<br />

© 2004 <strong>snom</strong> technology AG<br />

All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!