Asterisk 1.6.2.24 PRI E1 back to back with monitoring

Hi Guys,

I am setting up an asterisk box to record conversations.
I have a digium TE210P dual span.
30 channel E1 PRI from carrier on span 1 context [telco]
30 channel E1 PRI to the PABX on span 2 context [pabx]
Everything is working sweet except one thing.
Incoming calls from the exchange on span 1 passed to pabx on span 2, the caller gets no ring tone. (no tone at all)
The dialed pabx extension rings and call is connected through OK once answered, speech OK both ways.
Calling to a sip phone on the Asterisk system from span 1 ring tone OK.
Calling a pabx extension from a sip phone on the Asterisk system OK.
Outgoing calls from pabx span 2 to outside number via span 1 ring tone OK.

Any help would be greatly appreciated.
Here are my config files Asterisk CLI output and a PRI Debug

===========================================/etc/dahdi/system.conf======================================

Zones

loadzone=au
defaultzone=au

Span 1 ISDN 30 From Telco Provider

span=1,1,0,ccs,hdb3,crc4
bchan=1-15,17-31
dchan=16

Span 2 ISDN 30 To PABX

span=2,0,0,ccs,hdb3,crc4
bchan=32-46,48-62
dchan=47

============================================/etc/asterisk/chan_dahdi.conf================================

[channels]

language=en

; ISDN 30 From Telco Provider
context=telco
signalling=pri_cpe
switchtype=euroisdn
group=1
echocancel=yes
echocancelwhenbridged=yes
echotraining=400
usecallerid=yes
callerid=asreceived
callprogress=yes
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
cancallforward=yes
callreturn=yes
overlapdial=yes
pridialplan=unknown
prilocaldialplan=unknown
priindication=outofband
;usedistinctiveringdetection=yes
;distinctiveringaftercid=yes
immediate=no
rxgain=0.0
txgain=0.0
channel => 1-15
channel => 17-31

; ISDN 30 To PABX
context=pabx
signalling=pri_net
switchtype=euroisdn
group=2
echocancel=yes
echocancelwhenbridged=yes
echotraining=400
usecallerid=yes
callerid=asreceived
callprogress=yes
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
cancallforward=yes
callreturn=yes
overlapdial=yes
pridialplan=unknown
prilocaldialplan=unknown
priindication=outofband
;usedistinctiveringdetection=yes
;distinctiveringaftercid=yes
immediate=no
channel => 32-46
channel => 48-62

Have tried with and without all the options none of them seem to help

====================================/etc/asterisk/extensions.conf========================================

[telco]
exten => X!,1,Set(CALLFILENAME=incoming${STRFTIME(%a %b %c %y %H:%M)}${CALLERID(num)}${EXTEN})
exten => _X!,n,Monitor(wav,${CALLFILENAME},m)
exten => _X!,n,Dial(Dahdi/g2/617${EXTEN})

[pabx]
exten => X!,1,Set(CALLFILENAME=outgoing${STRFTIME(%a %b %c %y %H:%M)}${EXTEN}${CALLERID(num)})
exten => _X!,n,Monitor(wav,${CALLFILENAME},m)
exten => _X!,n,Dial(Dahdi/g1/${EXTEN})

Have tried with the ,r trigger with no luck.

==================================================Asterisk CLI Output======================================

– Accepting call from ‘04xxxxxxxx’ to ‘3xxxxxxx’ on channel 0/1, span 1
– Executing [3xxxxxxx@telco:1] Set(“DAHDI/1-1”, “CALLFILENAME=incoming_Wed Aug 1 15:34:56 2012_04xxxxxxxx_3xxxxxxx”) in new stack
– Executing [3xxxxxxx@telco:2] Monitor(“DAHDI/1-1”, “wav,incoming_Wed Aug 1 15:34:56 2012_04xxxxxxxx_3xxxxxxx,m”) in new stack
– Executing [3xxxxxxx@telco:3] Dial(“DAHDI/1-1”, “Dahdi/g2/6173xxxxxxx”) in new stack
– Requested transfer capability: 0x00 - SPEECH
– Called g2/6173xxxxxxx
– DAHDI/32-1 is proceeding passing it to DAHDI/1-1
– DAHDI/32-1 is ringing
– Span 1: Channel 0/1 got hangup request, cause 16
– Hungup ‘DAHDI/32-1’
== Spawn extension (telco, 3xxxxxxx, 3) exited non-zero on ‘DAHDI/1-1’
– Hungup ‘DAHDI/1-1’

This call was from a mobile but no ring on mobile or PSTN

====================================================PRI Debug========================================

< [ 02 01 01 51 ]

< Supervisory frame:
< SAPI: 00 C/R: 1 EA: 0
< TEI: 000 EA: 1
< Zero: 0 S: 0 01: 1 [ RR (receive ready) ]
< N®: 040 P/F: 1
< 0 bytes of data
Handling message for SAPI/TEI=0/0
– ACKing all packets from 39 to (but not including) 40
– Since there was nothing left, stopping T200 counter
– Stopping T203 counter since we got an ACK
– Nothing left, starting T203 counter
– Unsolicited RR with P/F bit, responding
Sending Receiver Ready (39)

[ 02 01 01 4f ]

Supervisory frame:
SAPI: 00 C/R: 1 EA: 0
TEI: 000 EA: 1
Zero: 0 S: 0 01: 1 [ RR (receive ready) ]
N®: 039 P/F: 1
0 bytes of data
– Restarting T203 timer

< [ 02 01 4e 50 08 02 5a 01 05 04 03 80 90 a3 18 03 a1 83 82 6c 0c 21 81 30 34 31 37 36 32 37 38 32 38 70 09 c1 33 32 35 31 33 33 30 32 a1 ]

< Informational frame:
< SAPI: 00 C/R: 1 EA: 0
< TEI: 000 EA: 1
< N(S): 039 0: 0
< N®: 040 P: 0
< 41 bytes of data
Handling message for SAPI/TEI=0/0
– ACKing all packets from 39 to (but not including) 40
– Since there was nothing left, stopping T200 counter
– Stopping T203 counter since we got an ACK
– Nothing left, starting T203 counter
< Protocol Discriminator: Q.931 (8) len=41
< Call Ref: len= 2 (reference 23041/0x5A01) (Originator)
< Message type: SETUP (5)
< [04 03 80 90 a3]
< Bearer Capability (len= 5) [ Ext: 1 Q.931 Std: 0 Info transfer capability: Speech (0)
< Ext: 1 Trans mode/rate: 64kbps, circuit-mode (16)
< User information layer 1: A-Law (35)
< [18 03 a1 83 82]
< Channel ID (len= 5) [ Ext: 1 IntID: Implicit PRI Spare: 0 Preferred Dchan: 0
< ChanSel: As indicated in following octets
< Ext: 1 Coding: 0 Number Specified Channel Type: 3
< Ext: 1 Channel: 2 ]
< [6c 0c 21 81 30 34 3x 3x 3x 3x 3x 3x 3x 3x]
< Calling Number (len=14) [ Ext: 0 TON: National Number (2) NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1)
< Presentation: Presentation permitted, user number passed network screening (1) ‘04xxxxxxxx’ ]
< [70 09 c1 33 3x 3x 3x 3x 3x 3x 3x]
< Called Number (len=11) [ Ext: 1 TON: Subscriber Number (4) NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1) ‘3XXXXXXX’ ]
< [a1]
< Sending Complete (len= 1)
– Making new call for cr 23041
– Processing Q.931 Call Setup
– Processing IE 4 (cs0, Bearer Capability)
– Processing IE 24 (cs0, Channel Identification)
– Processing IE 108 (cs0, Calling Party Number)
– Processing IE 112 (cs0, Called Party Number)
– Processing IE 161 (cs0, Sending Complete)
q931.c:3551 q931_receive: call 23041 on channel 2 enters state 6 (Call Present)
Sending Receiver Ready (40)

[ 02 01 01 50 ]

Supervisory frame:
SAPI: 00 C/R: 1 EA: 0
TEI: 000 EA: 1
Zero: 0 S: 0 01: 1 [ RR (receive ready) ]
N®: 040 P/F: 0
0 bytes of data
– Restarting T203 timer
q931.c:2816 q931_call_proceeding: call 23041 on channel 2 enters state 9 (Incoming Call Proceeding)
– Finally transmitting 40, since window opened up (0)

[ 00 01 50 50 08 02 da 01 02 18 03 a9 83 82 ]

Informational frame:
SAPI: 00 C/R: 0 EA: 0
TEI: 000 EA: 1
N(S): 040 0: 0
N®: 040 P: 0
10 bytes of data
Stopping T_203 timer
Starting T_200 timer
– Restarting T200 timer
Protocol Discriminator: Q.931 (8) len=10
Call Ref: len= 2 (reference 23041/0x5A01) (Terminator)
Message type: CALL PROCEEDING (2)
[18 03 a9 83 82]
Channel ID (len= 5) [ Ext: 1 IntID: Implicit PRI Spare: 0 Exclusive Dchan: 0
ChanSel: As indicated in following octets
Ext: 1 Coding: 0 Number Specified Channel Type: 3
Ext: 1 Channel: 2 ]

< [ 00 01 01 52 ]

< Supervisory frame:
< SAPI: 00 C/R: 0 EA: 0
< TEI: 000 EA: 1
< Zero: 0 S: 0 01: 1 [ RR (receive ready) ]
< N®: 041 P/F: 0
< 0 bytes of data
Handling message for SAPI/TEI=0/0
– ACKing all packets from 39 to (but not including) 41
– ACKing packet 40, new txqueue is -1 (-1 means empty)
– Since there was nothing left, stopping T200 counter
– Nothing left, starting T203 counter
– Restarting T203 timer
q931.c:2844 q931_alerting: call 23041 on channel 2 enters state 7 (Call Received)
– Finally transmitting 41, since window opened up (0)

[ 00 01 52 50 08 02 da 01 01 1e 02 81 88 ]

Informational frame:
SAPI: 00 C/R: 0 EA: 0
TEI: 000 EA: 1
N(S): 041 0: 0
N®: 040 P: 0
9 bytes of data
Stopping T_203 timer
Starting T_200 timer
– Restarting T200 timer
Protocol Discriminator: Q.931 (8) len=9
Call Ref: len= 2 (reference 23041/0x5A01) (Terminator)
Message type: ALERTING (1)
[1e 02 81 88]
Progress Indicator (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) 0: 0 Location: Private network serving the local user (1)
Ext: 1 Progress Description: Inband information or appropriate pattern now available. (8) ]

< [ 00 01 01 54 ]

< Supervisory frame:
< SAPI: 00 C/R: 0 EA: 0
< TEI: 000 EA: 1
< Zero: 0 S: 0 01: 1 [ RR (receive ready) ]
< N®: 042 P/F: 0
< 0 bytes of data
Handling message for SAPI/TEI=0/0
– ACKing all packets from 40 to (but not including) 42
– ACKing packet 41, new txqueue is -1 (-1 means empty)
– Since there was nothing left, stopping T200 counter
– Nothing left, starting T203 counter
– Restarting T203 timer

< [ 02 01 50 54 08 02 5a 01 45 08 02 80 90 ]

< Informational frame:
< SAPI: 00 C/R: 1 EA: 0
< TEI: 000 EA: 1
< N(S): 040 0: 0
< N®: 042 P: 0
< 9 bytes of data
Handling message for SAPI/TEI=0/0
– ACKing all packets from 41 to (but not including) 42
– Since there was nothing left, stopping T200 counter
– Stopping T203 counter since we got an ACK
– Nothing left, starting T203 counter
< Protocol Discriminator: Q.931 (8) len=9
< Call Ref: len= 2 (reference 23041/0x5A01) (Originator)
< Message type: DISCONNECT (69)
< [08 02 80 90]
< Cause (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) Spare: 0 Location: User (0)
< Ext: 1 Cause: Normal Clearing (16), class = Normal Event (1) ]
– Processing IE 8 (cs0, Cause)
q931.c:3826 q931_receive: call 23041 on channel 2 enters state 12 (Disconnect Indication)
Sending Receiver Ready (41)

[ 02 01 01 52 ]

Supervisory frame:
SAPI: 00 C/R: 1 EA: 0
TEI: 000 EA: 1
Zero: 0 S: 0 01: 1 [ RR (receive ready) ]
N®: 041 P/F: 0
0 bytes of data
– Restarting T203 timer
NEW_HANGUP DEBUG: Calling q931_hangup, ourstate Disconnect Indication, peerstate Disconnect Request
q931.c:2967 q931_release: call 23041 on channel 2 enters state 19 (Release Request)
– Finally transmitting 42, since window opened up (0)

[ 00 01 54 52 08 02 da 01 4d 08 02 81 90 ]

Informational frame:
SAPI: 00 C/R: 0 EA: 0
TEI: 000 EA: 1
N(S): 042 0: 0
N®: 041 P: 0
9 bytes of data
Stopping T_203 timer
Starting T_200 timer
– Restarting T200 timer
Protocol Discriminator: Q.931 (8) len=9
Call Ref: len= 2 (reference 23041/0x5A01) (Terminator)
Message type: RELEASE (77)
[08 02 81 90]
Cause (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) Spare: 0 Location: Private network serving the local user (1)
Ext: 1 Cause: Normal Clearing (16), class = Normal Event (1) ]

< [ 00 01 01 56 ]

< Supervisory frame:
< SAPI: 00 C/R: 0 EA: 0
< TEI: 000 EA: 1
< Zero: 0 S: 0 01: 1 [ RR (receive ready) ]
< N®: 043 P/F: 0
< 0 bytes of data
Handling message for SAPI/TEI=0/0
– ACKing all packets from 41 to (but not including) 43
– ACKing packet 42, new txqueue is -1 (-1 means empty)
– Since there was nothing left, stopping T200 counter
– Nothing left, starting T203 counter
– Restarting T203 timer

< [ 02 01 52 56 08 02 5a 01 5a ]

< Informational frame:
< SAPI: 00 C/R: 1 EA: 0
< TEI: 000 EA: 1
< N(S): 041 0: 0
< N®: 043 P: 0
< 5 bytes of data
Handling message for SAPI/TEI=0/0
– ACKing all packets from 42 to (but not including) 43
– Since there was nothing left, stopping T200 counter
– Stopping T203 counter since we got an ACK
– Nothing left, starting T203 counter
< Protocol Discriminator: Q.931 (8) len=5
< Call Ref: len= 2 (reference 23041/0x5A01) (Originator)
< Message type: RELEASE COMPLETE (90)
q931.c:3766 q931_receive: call 23041 on channel 2 enters state 0 (Null)
NEW_HANGUP DEBUG: Calling q931_hangup, ourstate Null, peerstate Null
NEW_HANGUP DEBUG: Destroying the call, ourstate Null, peerstate Null
Sending Receiver Ready (42)

This call was not answered.
This call was from a mobile but no ring on mobile or PSTN

Thanks again

Aaran