Digium TDM400P configuration problem


#1

Hello

I have a problem with configuration Digium TDM400P with 2 FXO and 2 FXS module.
Let me explain what I did first please.
Edit: I have installed Elastix 2.2.0 stable
I have 1 pstn line, 1 analog phone and 1 DID number from my VoIP provider here.
I have configured my SIP Trunk and outbound routes and thats are working well.
I have created 2 extension;
One of them is 2002, it is a SIP extension and I can register on this extension with my softphone and I can make SIP calls successfully.
Other one is 4004, it is a DAHDI extension and my analog phone connected to 4. port on asterisk card which port is FXS one.
and I can make SIP calls with this extension too.
Now that is the point… I want to redirect calls to 4004 extension which calls incomes from pstn line. But I cannot do that.
I can redirect calls which incomes from DID number to both extensions but pstn one doesnt work.

I put some codes here to you understand what is going on here.
chan_dahdi.conf:

[code]; Auto-generated by /usr/sbin/hardware_detector
[trunkgroups]

[channels]
context=from-pstn
signalling=fxs_ks
rxwink=300 ; Atlas seems to use long (250ms) winks
usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
canpark=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=no
faxdetect=incoming
echotraining=800
rxgain=0.0
txgain=0.0
callgroup=1
pickupgroup=1
relaxdtmf=yes

;Uncomment these lines if you have problems with the disconection of your analog lines
;busydetect=yes
;busycount=3

immediate=no

#include dahdi-channels.conf
#include chan_dahdi_additional.conf
[/code]

dahdi-channels.conf:

[code]; Autogenerated by /usr/sbin/dahdi_genconf on Mon Dec 26 16:37:29 2011
; If you edit this file and execute /usr/sbin/dahdi_genconf again,
; your manual changes will be LOST.
; Dahdi Channels Configurations (chan_dahdi.conf)
;
; This is not intended to be a complete chan_dahdi.conf. Rather, it is intended
; to be #include-d by /etc/chan_dahdi.conf that will include the global settings
;

; Span 1: WCTDM/4 “Wildcard TDM400P REV I Board 5” (MASTER)
;;; line="1 WCTDM/4/0 FXSKS"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
channel => 1
callerid=
group=
context=default

;;; line="2 WCTDM/4/1 FXSKS"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
channel => 2
callerid=
group=
context=default

;;; line="3 WCTDM/4/2 FXOKS"
signalling=fxo_ks
callerid=“Channel 3” <4003>
mailbox=4003
group=5
context=from-internal
channel => 3
callerid=
mailbox=
group=
context=default

;;; line="4 WCTDM/4/3 FXOKS"
signalling=fxo_ks
callerid=“Channel 4” <4004>
mailbox=4004
group=5
context=from-internal
channel => 4
callerid=
mailbox=
group=
context=default
[/code]

asterisk -rx “dahdi show channels” command output:

[root@localhost modules]# asterisk -rx "dahdi show channels" Chan Extension Context Language MOH Interpret Blocked State pseudo default default In Service 1 from-pstn default In Service 2 from-pstn default In Service 3 from-internal default In Service 4 from-internal default In Service

and CLI screen when I call pstn line

Verbosity was 3 and is now 54 -- Starting simple switch on 'DAHDI/1-1' -- Executing [s@from-internal:1] Macro("DAHDI/1-1", "hangupcall") in new stack -- Executing [s@macro-hangupcall:1] GotoIf("DAHDI/1-1", "1?endmixmoncheck") in new stack -- Goto (macro-hangupcall,s,9) -- Executing [s@macro-hangupcall:9] NoOp("DAHDI/1-1", "End of MIXMON check") in new stack -- Executing [s@macro-hangupcall:10] GotoIf("DAHDI/1-1", "1?nomeetmemon") in new stack -- Goto (macro-hangupcall,s,15) -- Executing [s@macro-hangupcall:15] NoOp("DAHDI/1-1", "MEETME_RECORDINGFILE=") in new stack -- Executing [s@macro-hangupcall:16] GotoIf("DAHDI/1-1", "1?noautomon") in new stack -- Goto (macro-hangupcall,s,18) -- Executing [s@macro-hangupcall:18] NoOp("DAHDI/1-1", "TOUCH_MONITOR_OUTPUT=") in new stack -- Executing [s@macro-hangupcall:19] GotoIf("DAHDI/1-1", "1?noautomon2") in new stack -- Goto (macro-hangupcall,s,25) -- Executing [s@macro-hangupcall:25] NoOp("DAHDI/1-1", "MONITOR_FILENAME=") in new stack -- Executing [s@macro-hangupcall:26] GotoIf("DAHDI/1-1", "1?skiprg") in new stack -- Goto (macro-hangupcall,s,29) -- Executing [s@macro-hangupcall:29] GotoIf("DAHDI/1-1", "1?skipblkvm") in new stack -- Goto (macro-hangupcall,s,32) -- Executing [s@macro-hangupcall:32] GotoIf("DAHDI/1-1", "1?theend") in new stack -- Goto (macro-hangupcall,s,34) -- Executing [s@macro-hangupcall:34] Hangup("DAHDI/1-1", "") in new stack == Spawn extension (macro-hangupcall, s, 34) exited non-zero on 'DAHDI/1-1' in macro 'hangupcall' == Spawn extension (from-internal, s, 1) exited non-zero on 'DAHDI/1-1' -- Executing [h@from-internal:1] Macro("DAHDI/1-1", "hangupcall") in new stack -- Executing [s@macro-hangupcall:1] GotoIf("DAHDI/1-1", "1?endmixmoncheck") in new stack -- Goto (macro-hangupcall,s,9) -- Executing [s@macro-hangupcall:9] NoOp("DAHDI/1-1", "End of MIXMON check") in new stack -- Executing [s@macro-hangupcall:10] GotoIf("DAHDI/1-1", "1?nomeetmemon") in new stack -- Goto (macro-hangupcall,s,15) -- Executing [s@macro-hangupcall:15] NoOp("DAHDI/1-1", "MEETME_RECORDINGFILE=") in new stack -- Executing [s@macro-hangupcall:16] GotoIf("DAHDI/1-1", "1?noautomon") in new stack -- Goto (macro-hangupcall,s,18) -- Executing [s@macro-hangupcall:18] NoOp("DAHDI/1-1", "TOUCH_MONITOR_OUTPUT=") in new stack -- Executing [s@macro-hangupcall:19] GotoIf("DAHDI/1-1", "1?noautomon2") in new stack -- Goto (macro-hangupcall,s,25) -- Executing [s@macro-hangupcall:25] NoOp("DAHDI/1-1", "MONITOR_FILENAME=") in new stack -- Executing [s@macro-hangupcall:26] GotoIf("DAHDI/1-1", "1?skiprg") in new stack -- Goto (macro-hangupcall,s,29) -- Executing [s@macro-hangupcall:29] GotoIf("DAHDI/1-1", "1?skipblkvm") in new stack -- Goto (macro-hangupcall,s,32) -- Executing [s@macro-hangupcall:32] GotoIf("DAHDI/1-1", "1?theend") in new stack -- Goto (macro-hangupcall,s,34) -- Executing [s@macro-hangupcall:34] Hangup("DAHDI/1-1", "") in new stack == Spawn extension (macro-hangupcall, s, 34) exited non-zero on 'DAHDI/1-1' in macro 'hangupcall' == Spawn extension (from-internal, h, 1) exited non-zero on 'DAHDI/1-1' -- Hanging up on 'DAHDI/1-1' -- Hungup 'DAHDI/1-1' localhost*CLI>


#2

All options for a channel must precede the channel => line!