Configuring number substitution
Network requirements
As shown in Figure 32, a PBX to forms a local telephony network at place A and place B respectively. The following requirements must be met:
These two local telephony networks communicate through two voice gateways. Subscribers in one PBX network can make ordinary calls to remote subscribers in the other PBX network over a VoIP network.
Configure two FXO trunk lines between each router and its PBX and enable hunt group to realize trunk line backup.
There are a financial department, market department, and sales department at both place A (area code 021) and place B (area code 010). A department at place A only needs to know the telephone numbers of the local departments and the area code of place B when calling a department at place B. For example, the financial department at place B can dial 3366 to call the local market department. The financial department at place B can dial 0103366 to call the market department at place A, and the caller identification displayed on the terminal at place A is 0211234, that is, the area code of place B + telephone number of the financial department at place B.
Figure 32: Network diagram
Configuration consideration
The PBX (calling side) at place B changes the called number to an intermediate number.
The PBX (called side) at place A changes the received intermediate number to a local number before initiating the call.
Configuration procedure
The following configuration supports dial plan–based calls from place B to place A only.
Configure Router B:
# Set the IP address of the Ethernet interface to 2.2.2.2.
<RouterB> system-view [RouterB] interface ethernet 2/1 [RouterB-Ethernet2/1] ip address 2.2.2.2 255.255.255.0 [RouterB-Ethernet2/1] quit
# Configure a number substitution rule list for called numbers of outgoing calls.
<RouterB> system-view [RouterB] voice-setup [RouterB-voice] dial-program [RouterB-voice-dial] number-substitute 21101 [RouterB-voice-dial-substitute21101] rule 1 0101688 0001 [RouterB-voice-dial-substitute21101] rule 2 0103366 0002 [RouterB-voice-dial-substitute21101] rule 3 0102323 0003
# Configure a number substitution rule list for calling numbers of outgoing calls.
[RouterB-voice-dial-substitute21101] quit [RouterB-voice-dial] number-substitute 21102 [RouterB-voice-dial-substitute21102] rule 1 1688 0210001 [RouterB-voice-dial-substitute21102] rule 2 3366 0210002 [RouterB-voice-dial-substitute21102] rule 3 2323 0210003 [RouterB-voice-dial-substitute21102] quit
# Configure a VoIP voice entity to place A.
[RouterB-voice-dial] entity 10 voip [RouterB-voice-dial-entity10] match-template 010.... [RouterB-voice-dial-entity10] address sip ip 1.1.1.1 [RouterB-voice-dial-entity10] substitute called 21101 [RouterB-voice-dial-entity10] substitute calling 21102
# Configure FXO trunk line 1/0.
[RouterB-voice-dial] entity 1010 pots [RouterB-voice-dial-entity1010] match-template .... [RouterB-voice-dial-entity1010] line 1/0 [RouterB-voice-dial-entity1010] send-number all
# Configure FXO trunk line 1/1.
[RouterB-voice-dial-entity1010] quit [RouterB-voice-dial] entity 2010 pots [RouterB-voice-dial-entity2010] match-template .... [RouterB-voice-dial-entity2010] line 1/1 [RouterB-voice-dial-entity2010] send-number all
# Enable hunt group.
[RouterB] subscriber-line 1/0 [RouterB-subscriber-line1/0] hunt-group enable [RouterB-subscriber-line1/0] quit [RouterB] subscriber-line 1/1 [RouterB-subscriber-line1/1] hunt-group enable
Configure Router A:
# Set the address of an Ethernet interface to 1.1.1.1.
<RouterA> system-view [RouterA] interface ethernet 2/1 [RouterA-Ethernet2/1] ip address 1.1.1.1 255.255.255.0 [RouterA-Ethernet2/1] quit
# Configure a number substitution rule list for called numbers of incoming calls.
[RouterA] voice-setup [RouterA-voice] dial-program [RouterA-voice-dial] number-substitute 101 [RouterA-voice-dial-substitute101] rule 1 ^0001$ 1234 [RouterA-voice-dial-substitute101] rule 2 ^0002$ 6788 [RouterA-voice-dial-substitute101] rule 3 ^0003$ 6565
# Configure a number substitution rule list for calling numbers of incoming calls.
[RouterA-voice-dial-substitute101] quit [RouterA-voice-dial] number-substitute 102 [RouterA-voice-dial-substitute102] dot-match left-right [RouterA-voice-dial-substitute102] rule 1 ^...0001$ ...1234 [RouterA-voice-dial-substitute102] rule 2 ^...0002$ ...6788 [RouterA-voice-dial-substitute102] rule 3 ^...0003$ ...6565 [RouterA-voice-dial-substitute102] quit
# Configure number substitution rules.
[RouterA-voice-dial] substitute incoming-call called 101 [RouterA-voice-dial] substitute incoming-call calling 102
# Configure FXO trunk line 1/0.
[RouterA-voice-dial] entity 1010 pots [RouterA-voice-dial-entity1010] match-template .... [RouterA-voice-dial-entity1010] line 1/0 [RouterA-voice-dial-entity1010] send-number all
# Configure FXO trunk line 1/1.
[RouterA-voice-dial-entity1010] quit [RouterA-voice-dial] entity 2010 pots [RouterA-voice-dial-entity2010] match-template .... [RouterA-voice-dial-entity2010] line 1/1 [RouterA-voice-dial-entity2010] send-number all
# Enable hunt group.
[RouterB] subscriber-line 1/0 [RouterB-subscriber-line1/0] hunt-group enable [RouterB-subscriber-line1/0] quit [RouterB] subscriber-line 1/1 [RouterB-subscriber-line1/1] hunt-group enable