Showing posts with label ISDN. Show all posts
Showing posts with label ISDN. Show all posts

Thursday, 9 May 2013

German (Overlap Receiving) ISDN With CME

In Germany they use overlap sending & receiving on ISDN circuits, meaning that call setup messages don't contain the entire dialled number (i.e. en bloc dialling), instead the dialled digits will be split across several call setup messages. This is complicated by the fact that this isn't done for all calls - calls from international numbers & mobiles use en bloc dialling.
The Cisco configuration guide for overlap receiving says to enable it on the ISDN interface, disable direct-inward-dial & use T in your dial-peers to force a T302 timeout. However all the documentation I've seen covers a voice gateway with inbound & outbound dial-peers with timeout, not CME. This causes a problem as having just an inbound dial-peer with timeout doesn't result in digits after the first call setup message being captured, as the virtual dial-peers for the phones registered with CME don't have a timeout. The solution is to use a voip dial-peer pointing to the CME router to loop back the call, then translate the dialled number so that the phone's virtual dial-peer is matched.
Below is example configuration using a BRI interface, where the direct dial range is 8693920X & internal numbers are 920X. After experimentation I found the 6000ms value for the overlap receiving T302 timeout to work the best (the default is 10000ms).

interface BRI0/1/0
 no ip address
 isdn switch-type basic-net3
 isdn overlap-receiving T302 6000
 isdn point-to-point-setup
 isdn incoming-voice voice
 isdn send-alerting
 isdn sending-complete
 isdn static-tei 0
!
voice translation-rule 1
 rule 1 /^8693\(920.\)/ /\1/
voice translation-profile BRI_Called
 translate called 1
!
dial-peer voice 3000 pots
 description BRI0 inbound
 incoming called-number 869392T
 port 0/1/0
dial-peer voice 3001 voip
 description Loopback for overlap receive T302 timeout
 translation-profile outgoing BRI_Called
 destination-pattern 869392T
 session target ipv4:172.23.12.130
 incoming called-number 92..
 dtmf-relay h245-alphanumeric
 codec g711ulaw
 no vad


Looking at the debug isdn q931 output, we can see the first call setup message arrive, followed by the 2nd containing the last digit & then the call connects correctly:

001218: May  3 11:49:04.136: ISDN BR0/1/1 Q931: TX -> RELEASE pd = 8  callref = 0x2B
001219: May  3 11:49:04.188: ISDN BR0/1/1 Q931: RX <- RELEASE pd = 8  callref = 0xAB
001220: May  3 11:49:20.569: ISDN BR0/1/0 Q931: RX <- SETUP pd = 8  callref = 0x01
        Bearer Capability i = 0x9090A3
                Standard = CCITT
                Transfer Capability = 3.1kHz Audio
                Transfer Mode = Circuit
                Transfer Rate = 64 kbit/s
        Channel ID i = 0x89
                Exclusive, B1
        Progress Ind i = 0x8283 - Origination address is non-ISDN 
        Calling Party Number i = 0x00A3, N/A
                Plan:Unknown, Type:Unknown
        Called Party Number i = 0xC1, '8693920'
                Plan:ISDN, Type:Subscriber(local)
001221: May  3 11:49:20.573: ISDN BR0/1/0 Q931: TX -> SETUP_ACK pd = 8  callref = 0x81
        Channel ID i = 0x89
                Exclusive, B1
001222: May  3 11:49:21.125: ISDN BR0/1/0 Q931: RX <- INFORMATION pd = 8  callref = 0x01
        Called Party Number i = 0xC1, '0'
                Plan:ISDN, Type:Subscriber(local)
001223: May  3 11:49:27.149: ISDN BR0/1/0 Q931: TX -> CALL_PROC pd = 8  callref = 0x81
001224: May  3 11:49:27.193: ISDN BR0/1/0 Q931: TX -> ALERTING pd = 8  callref = 0x81
        Progress Ind i = 0x8188 - In-band info or appropriate now available
001225: May  3 11:49:29.297: ISDN BR0/1/0 Q931: TX -> CONNECT pd = 8  callref = 0x81
        Channel ID i = 0x89
                Exclusive, B1
001226: May  3 11:49:29.377: ISDN BR0/1/0 Q931: RX <- CONNECT_ACK pd = 8  callref = 0x01
001227: May  3 11:49:29.381: %ISDN-6-CONNECT: Interface BRI0/1/0:1 is now connected

Wednesday, 3 October 2012

ISDN Circuit Simulator

With a bit of ingenuity & an T1/E1 crossover cable it's possible to build your own ISDN PRI circuit simulator using spare parts. For this you'll need:
  1. T1/E1 crossover cable (pinouts here)
  2. 2x ISDN VIC/VWIC cards
  3. Enough PVDMs to handle the ISDN card
  4. Cisco routers with appropriate feature set
Using the isdn protocol-emulate command, one ISDN card is set to act as the network side & the other the user side. They're then cabled together using the crossover cable & suitable dial-peers configured to allow calls.
My test rig was a 3845 equipped with a PVDM2-64 & 2x VWIC-1MFT-E1, using my nifty Universal Network Cable for crossover. Config snippets below:

isdn switch-type primary-net5
!       
controller E1 0/0/0
 clock source internal
 pri-group timeslots 1-31
 description Network E1
!
controller E1 0/1/0
 pri-group timeslots 1-31
 description User E1
!
interface Serial0/0/0:15
 no ip address
 encapsulation hdlc
 isdn switch-type primary-net5
 isdn protocol-emulate network
 isdn incoming-voice voice
 no cdp enable
!
interface Serial0/1/0:15
 no ip address
 encapsulation hdlc
 isdn switch-type primary-net5
 isdn incoming-voice voice
 isdn negotiate-bchan
 no cdp enable
!
voice-port 0/0/0:15
 cptone GB
 bearer-cap Speech
!
voice-port 0/1/0:15
 cptone GB
 bearer-cap Speech
!
dial-peer voice 1 pots
 incoming called-number .%
 direct-inward-dial
 port 0/0/0:15
!
dial-peer voice 2 pots
 destination-pattern .T
 incoming called-number .%
 direct-inward-dial
 port 0/1/0:15



Using some test IP phones to place calls, you can see from the debug isdn q931 output that the call exits Se0/1/0 & enters Se0/0/0:

*Oct  3 14:37:22.591: ISDN Se0/1/0:15 Q931: Applying typeplan for sw-type 0x12 is 0x0 0x1, Calling num 200
*Oct  3 14:37:22.591: ISDN Se0/1/0:15 Q931: Applying typeplan for sw-type 0x12 is 0x0 0x1, Called num 123
*Oct  3 14:37:22.591: ISDN Se0/1/0:15 Q931: TX -> SETUP pd = 8  callref = 0x0136
        Bearer Capability i = 0x8090A3
                Standard = CCITT
                Transfer Capability = Speech 
                Transfer Mode = Circuit
                Transfer Rate = 64 kbit/s
        Channel ID i = 0xA1839F
                Preferred, Channel 31
        Progress Ind i = 0x8183 - Origination address is non-ISDN 
        Calling Party Number i = 0x0180, '200'
                Plan:ISDN, Type:Unknown
        Called Party Number i = 0x81, '123'
                Plan:ISDN, Type:Unknown
*Oct  3 14:37:22.599: ISDN Se0/0/0:15 Q931: RX <- SETUP pd = 8  callref = 0x0136
        Bearer Capability i = 0x8090A3
                Standard = CCITT
                Transfer Capability = Speech 
                Transfer Mode = Circuit
                Transfer Rate = 64 kbit/s
        Channel ID i = 0xA1839F
                Preferred, Channel 31
        Progress Ind i = 0x8183 - Origination address is non-ISDN 
        Calling Party Number i = 0x0180, '200'
                Plan:ISDN, Type:Unknown
        Called Party Number i = 0x81, '123'
                Plan:ISDN, Type:Unknown
*Oct  3 14:37:22.603: ISDN Se0/0/0:15 Q931: TX -> CALL_PROC pd = 8  callref = 0x8136
        Channel ID i = 0xA9839F
                Exclusive, Channel 31
*Oct  3 14:37:22.607: ISDN Se0/0/0:15 Q931: TX -> ALERTING pd = 8  callref = 0x8136
        Progress Ind i = 0x8188 - In-band info or appropriate now available
*Oct  3 14:37:22.607: ISDN Se0/1/0:15 Q931: RX <- CALL_PROC pd = 8  callref = 0x8136
        Channel ID i = 0xA9839F
                Exclusive, Channel 31
*Oct  3 14:37:22.611: ISDN Se0/1/0:15 Q931: RX <- ALERTING pd = 8  callref = 0x8136
        Progress Ind i = 0x8188 - In-band info or appropriate now available
*Oct  3 14:37:27.759: %ISDN-6-CONNECT: Interface Serial0/0/0:30 is now connected to 200 N/A
*Oct  3 14:37:27.759: ISDN Se0/0/0:15 Q931: TX -> CONNECT pd = 8  callref = 0x8136
*Oct  3 14:37:27.763: ISDN Se0/1/0:15 Q931: RX <- CONNECT pd = 8  callref = 0x8136
*Oct  3 14:37:27.763: %ISDN-6-CONNECT: Interface Serial0/1/0:30 is now connected to 123 N/A
*Oct  3 14:37:27.763: ISDN Se0/1/0:15 Q931: TX -> CONNECT_ACK pd = 8  callref = 0x0136
*Oct  3 14:37:27.767: ISDN Se0/0/0:15 Q931: RX <- CONNECT_ACK pd = 8  callref = 0x0136
*Oct  3 14:37:33.759: %ISDN-6-CONNECT: Interface Serial0/0/0:30 is now connected to 200 N/A
*Oct  3 14:37:33.763: %ISDN-6-CONNECT: Interface Serial0/1/0:30 is now connected to 123 N/A
*Oct  3 14:37:34.567: %ISDN-6-DISCONNECT: Interface Serial0/0/0:30  disconnected from 200 , call lasted 6 seconds
*Oct  3 14:37:34.567: ISDN Se0/0/0:15 Q931: TX -> DISCONNECT pd = 8  callref = 0x8136
        Cause i = 0x8290 - Normal call clearing
*Oct  3 14:37:34.571: ISDN Se0/1/0:15 Q931: RX <- DISCONNECT pd = 8  callref = 0x8136
        Cause i = 0x8290 - Normal call clearing
*Oct  3 14:37:34.571: %ISDN-6-DISCONNECT: Interface Serial0/1/0:30  disconnected from 123 , call lasted 6 seconds
*Oct  3 14:37:34.571: ISDN Se0/1/0:15 Q931: TX -> RELEASE pd = 8  callref = 0x0136
*Oct  3 14:37:34.575: ISDN Se0/0/0:15 Q931: RX <- RELEASE pd = 8  callref = 0x0136
*Oct  3 14:37:34.579: ISDN Se0/0/0:15 Q931: TX -> RELEASE_COMP pd = 8  callref = 0x8136
*Oct  3 14:37:34.583: ISDN Se0/1/0:15 Q931: RX <- RELEASE_COMP pd = 8  callref = 0x8136


For a proper ISDN PRI simulator you'd want to implement a complete inbound dial plan with call routing to some IP phones or analogue phones connected to FXS ports to handle test calls. Then it'll be possible to have a proper Unified Communications lab with simulated PSTN connections.

Monday, 9 July 2012

MGCP PSTN and QSIG Gateway

Whilst it's becoming ever less common, sometimes there's a need to integrate with legacy equipment, such as PBXs & voice mail systems via a QSIG trunk. Given that a QSIG trunk requires an ISDN interface on a router with PVDMs, it's logical to stick an extra interface into your PSTN gateway & cable it to the legacy device.
Problem is that with MGCP you've now got 2 endpoints with the same IP address, which causes problems with the audio streams. If you enable debug isdn q931 you'll see calls come in a voice port & exit the other, yet there's no audio between the callers. Fortunately the solution is easy - in the CallManager service parameters enable path replacement & tweak the minimum/maximum delay timers:

Friday, 28 October 2011

MGCP Control of a Fractional PRI

Using MGCP usually makes life much easier with Communications Manager, but unfortunately it does assume that any PRI circuit is using the full amount of channels (23 for a T1 or 30 for an E1) and therefore doesn't support fractional PRIs.
Here's how to kludge MGCP into using a fractional PRI in 7 easy steps, for this example I'm using an E1 in slot 0/0/0:

1) Configure the gateway as normal in Communications Manager, then on the gateway use the ccm-manager config commands to configure it automatically:
ccm-manager config server x.x.x.x
ccm-manager config

2) Shutdown the voice-port:
voice-port 0/0/0:15
 shutdown
controller E1 0/0/0
 shutdown

3) Remove the ISDN layer 3 binding:
interface Serial 0/0/0:15
 no isdn bind-l3 ccm-manager

4) Replace the pri-group:
controller E1 0/0/0
 no pri-group
 pri-group timeslots 1-x service mgcp

5) Restore the ISDN layer 3 binding:
interface Serial 0/0/0:15
 isdn bind-l3 ccm-manager

6) Enable the voice-port:
controller E1 0/0/0
 no shutdown
voice-port 0/0/0:15
 no shutdown

7) Disable auto-configuration downloading, otherwise Communications Manager may undo your hard work:
no ccm-manager config
copy running-config startup-config