此檔案已移轉至自行發行工作流程。最初發佈到https://www.cisco.com/c/en/us/support/docs/voice/voice-quality/22373-1stage2stage.html。
應更新此檔案以符合目前的準則,且應在發行前移除此備註。發佈此文檔以進行預覽時,請確保「文檔ID」為22373,並且URL與此段落中的原始URL匹配。如果文檔ID或URL不匹配,請聯絡tz-writers@cisco.com。
簡介
本文檔介紹一階段和兩階段撥號的各個方面。
必要條件
需求
本文讀者應熟悉以下主題:
採用元件
本文中的資訊係根據以下軟體和硬體版本:
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路正在作用,請確保您已瞭解任何指令可能造成的影響。
慣例
請參閱思科技術提示慣例以瞭解更多有關文件慣例的資訊。
一階段撥號
在數字介面的情況下,當PBX或中心局(CO)交換機傳送一條包含完全路由呼叫所需的所有數字的設定消息時,這些數字可以對映到出站IP語音(VoIP)撥號對等體(或直接髮夾到普通舊式電話服務(POTS)撥號對等體)。路由器/網關不向呼叫方提供輔助撥號音,也不收集數字。它將呼叫直接轉發到已配置的目標。這稱為一個階段撥號。
在模擬介面的情況下,使用者只聽到一次撥號音(本地或遠端),然後撥打數字並接通目的電話。
T1/E1數字介面
當從POTS介面收到入站呼叫時,撥號對等體中的直接撥入(DID)功能使路由器/網關能夠使用被叫號碼(被叫號碼辨識服務(DNIS))來直接匹配出站撥號對等體。當在入站POTS撥號對等體上配置DID時,被叫號碼將自動用於匹配出站呼叫段的目標模式。
從全局配置模式開始輸入以下Cisco IOS命令,以便為DID配置POTS撥號對等體:
Router(config)#dial-peer voice number pots
Router(config-dial-peer)#direct-inward-dial

在本圖中,當有人拿起電話1時,使用者會聽到來自PBX的撥號音。PBX具有訪問代碼,該訪問代碼被程式設計為捕獲到路由器的通道。使用者撥打訪問代碼和目標號碼。在本示例中,假定訪問代碼為99。電話1上的使用者撥打995678。根據PBX的程式設計方式,它將所有六個數字轉發到路由器,或者刪除自己的訪問代碼並只向路由器傳送目標數字。同樣,當連線到公共交換電話網(PSTN)的使用者拿起電話時,會聽到來自PSTN的撥號音。當使用者撥打1234時,PSTN將呼叫路由到路由器。由於配置了direct-inward-dial,因此路由器會檢視撥號數字並匹配其出站VoIP撥號對等體(它將呼叫傳送到路由器A)。
以下為路由器A的配置:
dial-peer voice 99 pots
destination-pattern 1234
direct-inward-dial
!--- This command is required for one stage dialing so !--- the router routes the call based on the dialed digits.
port 1/0:0
prefix 1234
!
dial-peer voice 100 voip
destination-pattern 5678
session target ipv4:192.168.1.2
以下為路由器B的配置:
dial-peer voice 201 pots
destination-pattern 5678
direct-inward-dial
!--- This command is required for one !--- stage dialing so the router routes the call based on the dialed digits.
port 1/0:0
prefix 5678
dial-peer voice 200 voip
destination-pattern 1234
session target ipv4:192.168.1.1
您需要在遠端路由器中增加字首,因為POTS撥號對等體在預設情況下會去掉它在目的地模式中匹配的所有數字,這些數字需要傳送到終接CO。
注意:在Cisco 2600/3600平台上,預設會在通道關聯訊號(CAS)(直接、眨眼、延遲)介面上啟用DID。因此,請勿對傳入呼叫配置direct-inward-dial命令。在Cisco AS5300平台上,為E&M立即信令配置的介面不支援DID。
請確保入站呼叫與已配置direct-inward-dial的POTS撥號對等體匹配。有關撥號對等體匹配的更多資訊,請參閱語音-瞭解如何在Cisco IOS平台上匹配入站和出站撥號對等體。
模擬語音介面卡
注意:外部交換局/外部交換站/E&M (FXO/FXS/E&M)介面不支援直接撥入功能。您必須使用VIC-2DID卡為模擬埠設定DID。有關Cisco模擬DID的詳細資訊,請參閱Cisco 2600和Cisco 3600系列路由器的模擬DID。
請考慮以下情況:

有兩種方法可以為Phone 1配置一個階段撥號:
本地撥號音
使用者拿起電話時,路由器發出撥號音(調試)。然後使用者撥打5678或4321。路由器搜尋出站撥號對等體並將呼叫傳送到路由器B。路由器B然後捕獲PBX/CO的埠,並將DNIS(被叫號碼)數字傳送到PBX/CO,PBX/CO將呼叫傳送到電話。此情況不需要特殊配置。路由器B必須將DNIS數字傳送到PBX/CO。
以下為路由器A的配置:
dial-peer voice 99 pots
destination-pattern 1234
port 1/0/0
prefix 1234
!
dial-peer voice 100 voip
destination-pattern 5678
session target ipv4:192.168.1.2
以下為路由器B的配置:
dial-peer voice 201 pots
destination-pattern 5678
port 1/0:0
prefix 5678
!--- Send the digits to the terminating PBX/CO.
dial-peer voice 200 voip
destination-pattern 1234
session target ipv4:192.168.1.1
遠端撥號音
使用者拿起電話1時,會聽到另一端PBX/CO的撥號音。這使電話看起來像是連線到遠端端的PBX/CO。使用專用線路、自動振鈴(PLAR)配置來實現此目的。此外,請確保路由器B未向PBX/CO傳送任何數字。某些PBX可以配置為返回撥號音,即使它們確實收到任何DNIS數字。
以下為路由器A的配置:
voice-port 1/0/0
connection plar 1000
!--- Connection PLAR is configured under the voice port.
!
dial-peer voice 100 voip
destination-pattern 1000
!--- Dialed string for connection PLAR !--- which sends the call to Router B.
session target ipv4:192.168.1.2
以下為路由器B的配置:
!--- This dial matches the entire destination pattern, !--- strips it all off, and does not send any digits to the PBX/CO.
dial-peer voice 201 pots
destination-pattern 1000
!--- Dialed string for PLAR !--- that comes into this router from Router A.
port 1/0:0
!
有關可幫助您配置PLAR以及連線PLAR和連線中繼之間的區別的詳細資訊,請參閱為VoIP網關配置連線PLAR。
兩階段撥號
當語音呼叫進入Cisco IOS路由器/網關時,路由器上的語音埠會被PBX或CO交換機佔用入站。然後,路由器/網關向呼叫方顯示撥號音,並收集數字,直到能夠辨識出站撥號對等體。無論數字是由人以不規則的間隔撥號,還是由傳送預先收集數字的電話裝置以規則方式撥號,撥號對等體匹配都是逐位完成的。這意味著路由器/網關在收到每個數字後嘗試匹配撥號對等體。此過程稱為兩階段撥號。
T1/E1數字介面
請考慮以下情況:

以下兩種方法可用於使用兩階段撥號:
本地撥號音
當使用者拿起電話1時,聽到來自PBX的撥號音,使用者撥打路由器的訪問代碼(在PBX中程式設計),然後收到來自路由器的撥號音(debug)。接下來,使用者撥打5678,呼叫被路由到路由器B,然後被路由到電話2。
例如,如果PBX有另一條線路連線到另一台路由器,則在PBX中為每個路由器程式設計了一個訪問代碼。此外,根據您撥打的接入碼,您可以從不同的本地路由器提取撥號音。
以下為路由器A的配置:
!--- This dial-peer does not have !--- direct-inward-dial configured. !--- By default, when a call comes in, the router !--- provides dial tone to the user.
dial-peer voice 99 pots
destination-pattern 1234
port 1/0:0
prefix 1234
!
dial-peer voice 100 voip
destination-pattern 5678
session target ipv4:192.168.1.2
!
以下為路由器B的配置:
dial-peer voice 201 pots
destination-pattern 5678
port 1/0:0
prefix 5678
!
本地和遠端撥號音
使用者拿起電話1時,PBX會聽到撥號音。使用者輸入數字,然後聽到連線到路由器B的PBX/CO發出的另一撥號音。有兩種方法可以達到此目的:
-
在路由器A上使用direct-inward-dial。
配置direct-inward-dial後,PBX/CO會佔用路由器上的埠並傳送一條包含DNIS數字的設定消息。路由器使用這些數字匹配出站VoIP撥號對等體,並將呼叫傳送到遠端路由器。然後,路由器B將線路捕獲到其PBX/CO,並且不轉發任何數字。然後,遠端PBX/CO向電話1上的使用者提供撥號音。然後使用者看起來好像連線到該PBX/CO。
以下為路由器A的配置:
dial-peer voice 99 pots
destination-pattern 1234
direct-inward-dial
!--- This command is needed so that the router !--- routes the call based on the dialed digits.
port 1/0:0
prefix 1234
!
dial-peer voice 100 voip
destination-pattern 5678
session target ipv4:192.168.1.2
以下為路由器B的配置:
!--- This dial-peer matches the entire destination pattern, !--- strips it all off, and does not send any digits to the PBX/CO.
dial-peer voice 201 pots
destination-pattern 5678
port 1/0:0
!
-
使用連線PLAR和連線中繼。
使用連線PLAR在檢測到其語音介面上出現佔線時設定呼叫的IP段,而不是讓路由器匹配PBX/CO傳送給它的DNIS數字。路由器B收到來自路由器A的此呼叫,捕獲PBX/CO上的埠,並且不向其傳送任何數字。然後,遠端PBX/CO向電話1上的使用者提供撥號音,該使用者看起來好像連線到該PBX/CO。
以下為路由器A的配置:
voice-port 1/0:0
connection plar 6666
!--- Connection PLAR is configured under the voice port.
!
dial-peer voice 99 pots
destination-pattern 1234
port 1/0:0
prefix 1234
!
dial-peer voice 100 voip
destination-pattern 6666
!--- Dialed string for connection PLAR !--- which sends the call to Router B.
session target ipv4:192.168.1.2
!
以下為路由器B的配置:
!--- This dial matches the entire destination pattern, !--- strips it all off, and does not send any digits to the PBX/CO.
dial-peer voice 201 pots
destination-pattern 6666
!--- Dialed string for PLAR that comes !--- into this router from Router A.
port 1/0:0
!
模擬語音介面卡
請考慮以下情況:

當使用者拿起電話1或為FXO線路撥打PSTN號碼時,路由器向主叫方提供撥號音(調試)。然後,使用者輸入數字並從終接PBX/CO接收撥號音。然後,使用者撥打目標號碼(9876或4321),並轉到另一部電話。確保路由器B未向PBX/CO傳送任何數字。
以下為路由器A的配置:
dial-peer voice 99 pots
destination-pattern 1234
port 1/0/0
prefix 1234
!
dial-peer voice 100 voip
destination-pattern 9876
session target ipv4:192.168.1.2
!
!
dial-peer voice 101 voip
destination-pattern 4321
session target ipv4:192.168.1.2
以下為路由器B的配置:
!--- This dial matches the entire destination pattern, strips it all off, !--- and does not send any digits to the PBX/CO.
dial-peer voice 201 pots
destination-pattern 9876
port 1/0:0
!
提供撥號音的路由器的debug voip ccapi inout命令的輸出
Mar 9 06:30:26.270: cc_api_call_setup_ind (vdbPtr=0x823F6E70,
callInfo={called=,called_oct3=0x81,calling=,calling_oct3=0x0,calling_oct3a=0x0,
calling_xlated=false,subscriber_type_str=RegularLine,fdest=0,
peer_tag=700, prog_ind=3},callID=0x820704FC)
Mar 9 06:30:26.270: cc_api_call_setup_ind type 3 , prot 0
Mar 9 06:30:26.274: cc_process_call_setup_ind (event=0x823D0448)
Mar 9 06:30:26.274: >>>>CCAPI handed cid 2 with tag 700 to app "DEFAULT"
Mar 9 06:30:26.278: sess_appl: ev(24=CC_EV_CALL_SETUP_IND), cid(2), disp(0)
Mar 9 06:30:26.278: sess_appl: ev(SSA_EV_CALL_SETUP_IND), cid(2), disp(0)
Mar 9 06:30:26.278: ssaCallSetupInd
Mar 9 06:30:26.278: ccCallSetContext (callID=0x2, context=0x825A5C7C)
Mar 9 06:30:26.278: ssaCallSetupInd cid(2), st(SSA_CS_MAPPING),oldst(0),
ev(24)ev->e.evCallSetupInd.nCallInfo.finalDestFlag = 0
Mar 9 06:30:26.278: ccCallSetupAck (callID=0x2)
Mar 9 06:30:26.278: ccGenerateTone (callID=0x2 tone=8)
Mar 9 06:30:26.282: ccCallReportDigits (callID=0x2, enable=0x1)
Mar 9 06:30:26.282: cc_api_call_report_digits_done (vdbPtr=0x823F6E70, callID=0x2, disp=0)
Mar 9 06:30:26.282: sess_appl: ev(53=CC_EV_CALL_REPORT_DIGITS_DONE), cid(2), disp(0)
Mar 9 06:30:26.282: cid(2)st(SSA_CS_MAPPING)ev(SSA_EV_CALL_REPORT_DIGITS_DONE)
oldst(SSA_CS_MAPPING)cfid(-1)csize(0)in(1)fDest(0)
Mar 9 06:30:26.282: ssaReportDigitsDone cid(2) peer list: (empty)
Mar 9 06:30:26.282: ssaReportDigitsDone callid=2 Enable succeeded
Mar 9 06:30:26.282: ccGenerateTone (callID=0x2 tone=8)
!--- Router that provides dial tone.