本文討論一階段和兩階段撥號的各個方面。
本文檔的讀者應熟悉以下主題:
本文中的資訊係根據以下軟體和硬體版本:
所有Cisco IOS®軟體版本
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路正在作用,請確保您已瞭解任何指令可能造成的影響。
在數字介面的情況下,當PBX或中央辦公室(CO)交換機傳送包含完全路由呼叫所需的所有數字的設定消息時,這些數字可以對映到出站IP語音(VoIP)撥號對等體(或髮夾直接對映到普通舊式電話服務(POTS)撥號對等體)。 路由器/網關不向呼叫方顯示輔助撥號音,也不收集數字。它將呼叫直接轉接到已配置的目的地。這稱為一個階段撥號。
如果是模擬介面,使用者只聽到一次撥號音(本地或遠端),然後撥打數字並接通目的電話。
當從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的程式設計方式,它會將所有6位數字轉發到路由器,或者去掉自己的訪問代碼,只將目標數字傳送到路由器。同樣,當連線到公共交換電話網路(PSTN)的使用者拿起電話時,會聽到來自PSTN的撥號音。當使用者撥打1234時,PSTN將呼叫路由到路由器。由於路由器配置了直接撥入,因此它會檢視撥號數字並匹配其出站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。
確保入站呼叫與已配置直接撥入的POTS撥號對等體匹配。請參閱語音 — 瞭解在Cisco IOS平台上呼入和撥出撥號對等體的匹配方式以瞭解更多有關撥號對等體匹配的資訊。
注意:Foreign Exchange Office/Foreign Exchange Station/E&M(FXO/FXS/E&M)介面不支援直接撥入功能。您必須使用VIC-2DID卡為模擬埠設定DID。有關Cisco模擬DID的詳細資訊,請參閱Cisco 2600和Cisco 3600系列路由器的模擬DID。
請考慮以下情況:
為電話1配置一個階段撥號的方式有兩種:
使用者拿起電話時,會從路由器聽到撥號音(偵錯)。 然後使用者撥打5678或4321。路由器搜尋出站撥號對等體並將呼叫傳送到路由器B。然後路由器B獲取PBX/CO的埠,並將DNIS(被叫號碼)數字傳送到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交換機將獲取路由器上的語音埠。然後,路由器/網關向呼叫方顯示撥號音,並收集數字,直到能夠識別出站撥號對等體。無論數字是由人以不規則間隔撥號,還是由傳送預先收集的數字的電話裝置以規則方式撥號,撥號對等體匹配都是逐位完成的。這表示路由器/網關在收到每個數字後嘗試匹配撥號對等體。此過程稱為兩階段撥號。
請考慮以下情況:
可以使用以下兩種方法執行兩階段撥號:
當使用者拿起電話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上使用直接撥入。
在配置直接撥入時,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 !
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.