Modifying, Passing, and Recognizing CID

Hey all,

Working on getting a man-in-the-middle call recording solution working and I am having a bit of a problem. The setup is:

*box(1) w/Analog -> TDMoE -> *box(2) recording -> TDMoE -> *box(3) w/SIP.

First, I am using TDMoE because when this is all done, the 1 and 3 *boxes will be replaced with Red Fone foneBRIDGES and TDMoE is what these devices work with. Eventually it will look like this:

Telco -> T1 PRI -> foneBRIDGE1 -> *box(recording) -> foneBRIDGE2 -> T1 PRI -> Avaya Switch

Second, I can get a call from the Analog phone to the SIP phone and get a recorded message. Problem is I am not able to get the CID to show up on the SIP phone which is an important thing in this setup.

Currently this is what I am doing on *box(1) to *box(2) just to see if I can get it to report or identify correctly there first.

[b]*box(1)

/etc/asterisk/chan_dahdi.conf[/b]

[trunkgroups]
; define any trunk groups

[channels]
; hardware channels
; default
usecallerid=yes
hidecalleridname=yes
hidecallerid=no
callerid = asreceived
useincomingcalleridondahditransfer = yes
adsi=yes
callwaiting=yes
restrictcid=no
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
echotraining=yes
busydetect=yes
;immediate=yes

; Span 1: WCTDM/4 “Wildcard TDM400P REV E/F Board 5” (MASTER)
;;; line="1 WCTDM/4/0 FXOKS (EC: MG2)"
signalling=fxo_ks
callerid=“TEST 1” <1001>
mailbox=1001
group=5
context=phones
channel => 1

;;; line="2 WCTDM/4/1 FXOKS (EC: MG2)"
signalling=fxo_ks
callerid=“TEST 2” <1002>
mailbox=1002
group=5
context=phones
channel => 2

;;; line="3 WCTDM/4/2 FXSKS (EC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=incoming
channel => 3

;;; line=“4 WCTDM/4/3 FXSKS (EC: MG2)”
;signalling=fxs_ks
;callerid=asreceived
;group=0
;context=from-pstn
;channel => 4

;; TDMoE to PBX
context=from-pstn
switchtype=national
pridialplan=unknown
priindication=outofband
overlapdial=no
resetinterval=86400
signalling=em
group = 2
channel=>5-28

/etc/asterisk/extensions.conf

[globals]
TEST1=DAHDI/1
TEST2=DAHDI/2
OUTBOUNDTRUNK=DAHDI/3
TDMTRUNK=DAHDI/g2

[to-recording]
exten => _555XXXX/1001,1,Set(CALLERID(all)=Test 1 <8007771111>)
exten => _555XXXX/1002,1,Set(CALLERID(all)=Test 2 <8007772222>)
exten => _555XXXX,n,Dial(${TDMTRUNK}/${CALLERID(num)},15)
exten => _555XXXX,n,Playback(abandon-all-hope)
exten => _555XXXX,n,Playback(goodbye)
exten => _555XXXX,n,Hangup()

CLI:

– Starting simple switch on ‘DAHDI/1-1’
– Executing [5554444@phones:1] Set(“DAHDI/1-1”, “CALLERID(all)=FANSTEL 1 <8007771111>”) in new stack
– Executing [5554444@phones:3] Dial(“DAHDI/1-1”, “DAHDI/g2/8007771111,15”) in new stack
– Called g2/8007771111
– Hungup ‘DAHDI/5-1’

[b]*box(2)

/etc/asterisk/chan_dahdi.conf[/b]

[trunkgroups]
; define any trunk groups

[channels]
; hardware channels
; default
usecallerid=yes
hidecalleridname=yes
hidecallerid=no
callerid = asreceived
useincomingcalleridondahditransfer = yes
adsi=yes
callwaiting=yes
restrictcid=no
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
echotraining=yes
busydetect=yes
;immediate=yes

;; Incoming/Outgoing from Telco
;; TDMoE to Asterisk
context=incoming
switchtype=national
pridialplan=unknown
priindication=outofband
overlapdial=no
resetinterval=86400
signalling=em
group = 1
channel=>1-24

;; Incoming/Outgoing from *box(3)
;; TDMoE to/from Novo
context=from-novo
switchtype=national
pridialplan=unknown
priindication=outofband
overlapdial=no
resetinterval=86400
signalling=em
group = 2
channel=>25-48

/etc/asterisk/extensions.conf

[globals]
TELCO=DAHDI/g1
SWITCH=DAHDI/g2

[general]
static=yes
writeprotect=no
autofallthrough=yes

[incoming]
exten => _800777XXX,1,Answer()
exten => _800777XXX,n,NoOp(${CALLERID(number)})
exten => _800777XXX,n,WaitExten(3)
exten => _800777XXX,n,NoOp(${CALLERID(number)})
exten => _800777XXX,n,Hangup()

CLI:

– Starting simple switch on ‘DAHDI/1-1’
[May 29 10:31:08] WARNING[13068]: channel.c:2375 ast_waitfordigit_full: Unexpected control subclass ‘5’
– Hungup ‘DAHDI/1-1’

My question is how do I get *box(2) to recognize the entire number being passed. In various configuration tries I know that it is seeing the numbers as when I do to an ‘s’ extension it comes back with an error on no ‘8’ (8007771111) extension. Seems it is only processing one number at a time.

This has to be my lack of knowledge on Asterisk and being a newbie. Any help would be appreciated.

Thanks