—Dial peers
Are essentially your rules about next leg of the data.
Phone1 —> R1 ——> R2 —–> Phone2
Here you can see there are 4 legs. dial peers are processed both incoming and outgoing.
There are 2 types of Dial peers
POTS dial peers = used for a port connecting to a to a traditional phone style connection
for example, connecting to a FXS port to an old phone, connecting a T1 line to a PSTN connection, connecting an FXO Trunk to a PSTN provider.
VOIP Dial peers = used for reaching an extension over the IP network, For example
extension 4XXX is reachable through ip address 10.1.1.2
—Configuring Dial peers
show voice port summary = see a list of all anologue phones connected to the FXS ports.
show dial-peer voice summary = see a list of dial peers.
Under the dial-peer <NAME> VOIP
You can select the codec to use.
By default when you have two anologue phones connected to a router with FXS ports
they will not be able to communicate. For them to talk we need to create a dialpeer
which says how to contact each other and reach the external PSTN line
//Setup local dialing between POTS analogue phones connected to FXS ports on a Voice Router
conf t
dial-peer voice 3301 pots //saying this is a POTS connection. 3301 is the name.using extension
destination-pattern 3301 //Set the phone number
port 1/0/0 //what port is it found. show voice port summary to find.
This would need to be done for each Analogue phone.
//Setup VOIP dial peer to say any calls to this extension go to this IP
This must be done at both ends otherwise dialing will only work one way
Conf t
dial peer voice 330 voip
destination-pattern 330. // all calls to 330x
session target ipv4:<remote ip> //Syntax does not show this command be warned.send calls here
//configure VWIC card to PSTN teleco
int controller t1 1/0
framing <Set by telco>
linecode <Set by telco>
//Set CAS connection steals bits for signalling or CCS using 1 line for dedicated signalling.
int controller t1 1/0
ds0-group <Number> timeslots <1-24lines> type <Fx0-loop-start(telco set)> //CAS
OR
pri-group <Number> timeslots <1-24lines> type <Fx0-loop-start(telco set)> //CCS
//Create Dial-peer for external dialing
conf t
dial-peer voice 9999 pots
destination-pattern 00[0-9]…….. //allows interstate dialing. 0 as external line.
destination-pattern …….. // allows within the state dialing
port 1/0/0 //set the exiting port
//Wildcard dial-peer characters
“.” = any character 0-9
11[6-7]11 = 11611 or 11711 then go here
11[16-7]11 = 11111 OR 11611 OR 11711 then go here
T = lazy mans dial-peer for exteral calling ex 9T all 9 + xxxxx numbers go externally need to wait 15 seconds timeout when using this dialing-peer.
1+ = 1 or 11 or 111
//Multiple Dial-peer’s match
When there are multiple dial peers that match the number dialed the most specific number always wins, its like in routing how the must specific subnet mask is used.
Example 5551234 is dialed
destination-pattern 5551 //used 1st because as soon as 5551 is dialed it finds a match
destination-pattern 5551… //used second as more specific than 1-3
destination-pattern 555[1-3].. //used last as not as specific.
—Incoming Dial-peers
for every outgoing dial peer there must be an incoming dial peer. The following 4 steps are used before using peer 0. Peer 0 is bad because there is no QOS being used, VAD is forced to be enabled, and DID does not work.
This is the order the Router uses to check for incoming dial peers
1. Is there a specific incoming dial-peer specified for this extension (command incomming called number xxxx)
2. Is there a answer-address (caller ID) defined in the dial peer (command anwser address xxxx)
3. Is there a destination-pattern command defined in the dial peer (command destination pattern 1…)
4. Is there a “port” command used to define the dial peer (command port x)
5. Dial Peer 0 is used if unable to map to the above. NO QOS, VAD enabled,
—POTS rule
By default the POTS dial peers will strip any explicitly defined digit in destination-pattern command, leaving only the wildcard like characters left. this can be good as it stops the PSTN company from getting your number dialed to get an outside line. But bad if dialing 911, if specifically defined in a dial peer then no information will get sent.
For example.
dial-peer voice 1111 POTS
destination-pattern 123[1-3]123
//only the [1-3] character would be sent to the PSTN courrier.
the 123’s would be stripped off before being sent.
There are some commands to manipulate the dialed digits.
//Prefix command, affixs numbers to the begining.
dial-peer voice 1111 POTS
affix <number>
//Send X digits from the right
dial-peer voice 1111 POTS
forward-digits <2> // in the example 911 last 2 digits used, (11)
//digit-strip.
This command is turned on by default, it activates the rule that if specifc numbers are dialed then they are to be stripped off when being sent. It can be turned off with the following
dial-peer voice 1 POTS
no digit-strip
//call forwarding. Say if you have an internal receptionist that you dial 0 to get the receptionist then you could set this up with the following command.
conf t
num-exp <Match> <set> //num-exp 0 5551 would send all people dialing 0 to ext 5551.
//Redundancy over POTS.
Lets say you have a senerio where you want to use the WAN link for VOIP traffic if its available, however if the WAN link goes down you want to use the PSTN POTs links as a failover if the WAN connection is down. It can be done with digit manipulation.
dialing to a site with extension 6000
dial-peer voice 6000 VOIP
destination-pattern 6… //all 6XXX extns
session target ipv4:<IP> //send to this IP
preference 0 //use this rule first
dial-peer voice 6001 POTS //strip feature will be used
destination-patter 6… //all dials to 6XXX
port 1/0:1 //exit port
no digit-strip //do not strip the 6 at the begining
prefix 035166 //put the area code to the begining
preference 1 //use this rule second if first is unavailable.
//FXO port to PSTN courier.
When you have an FX0 port that goes to a telco courrier it only know when a call is coming in,
it is not aware of its extension number. we use the PLAR command to setup automatic forwarding
to the receptionist.
voice-port 1/1
connection plar <receptionist phone number> //automatically dial this phone number on signal.
exit
conf t
num-exp 0 5000 //send people who dial 0 to extension 5000
//Emergency dialing
It is a good idea when you have a remote branch and calls are being routing through the WAN that you have at least 1 phone line used for emergency dialing.
The dial peer would look like this.
dial-peer voice 911 Pots //will strip off 911
destination-pattern 911
port <PSTN port>
no digit-strip
dial-peer voice 9911 ports //will strip off 9911
destination-pattern 9911 //including if they dial the outside line number
port <pstn port>
forward-digits 3 //use the “911” of the 9911 being dialed.