PSTN 中继 TDM400P 安装在 Asterisk / Trixbox 上

PSTN 中继 TDM400P 安装在 Asterisk / Trixbox 上

我正在尝试使用带有 FXO 模块的 TDM400P 卡来连接我们的 PSTN 线路。Linux 可以正确检测到该卡:

[trixbox1.localdomain asterisk]# lspci 00:09.0 通信控制器:Tiger Jet Network Inc. Tiger3XX 调制解调器/ISDN 接口

我运行了 setup-pstn,它产生了以下输出

trixbox1.localdomain ~]# setup-pstn
--------------------------------------------------------------
Detecting PSTN cards and USB PSTN Devices
-------------------------------------------------------------- 
Hardware present!

STOPPING ASTERISK
Asterisk Stopped

STOPPING FOP SERVER
FOP Server Stopped
Unloading DAHDI hardware modules: done
Loading DAHDI hardware modules:
  wct4xxp:                                                 [  OK  ]
  wcte12xp:                                                [  OK  ]
  wct1xxp:                                                 [  OK  ]
  wcte11xp:                                                [  OK  ]
  wctdm24xxp:                                              [  OK  ]
  opvxa1200:                                               [  OK  ]
  wcfxo:                                                   [  OK  ]
  wctdm:                                                   [  OK  ]
  wcb4xxp:                                                 [  OK  ]
  wctc4xxp:                                                [  OK  ]
  xpp_usb:                                                 [  OK  ]

Running dahdi_cfg:                                         [  OK  ]

SETTING FILE PERMISSIONS
Permissions OK

STARTING ASTERISK
Asterisk Started

STARTING FOP SERVER
FOP Server Started
   Chan Extension  Context         Language   MOH Interpret        Blocked    State     
 pseudo            default         en         default                         In Service
      1            from-pstn       en         default                         In Service

dahdi_scan 返回:

dahdi_scan [1] 
active=yes 
alarms=OK 
description=Wildcard TDM400P REV I Board 5 
name=WCTDM/4 
manufacturer=Digium 
devicetype=Wildcard TDM400P REV I 
location=PCI Bus 00 Slot 10 
basechan=1 
totchans=4 
irq=209 
type=analog 
port=1,FXO 
port=2,none 
port=3,none 
port=4,none

并且星号可以看到频道:

> trixbox1*CLI> dahdi show channel 1
> Channel: 1LI>  File Descriptor: 14
> Span: 11*CLI>  Extension: I>  Dialing:
> noI>  Context: from-pstn Caller ID: I>
> Calling TON: 0 Caller ID name: 
> Mailbox: none  Destroy: 0LI>  InAlarm:
> 1LI>  Signalling Type: FXS Kewlstart
> Radio: 0*CLI>  Owner: <None>  Real:
> <None>>  Callwait: <None> Threeway:
> <None> Confno: -1LI>  Propagated
> Conference: -1 Real in conference: 0
> DSP: no1*CLI>  Busy Detection: no TDD:
> no1*CLI>  Relax DTMF: no
> Dialing/CallwaitCAS: 0/0 Default law:
> ulaw Fax Handled: no Pulse phone: no
> DND: no1*CLI>  Echo Cancellation:
> trixbox1128 taps trixbox1(unless TDM
> bridged) currently OFF Actual
> Confinfo: Num/0, Mode/0x0000 Actual
> Confmute: No
> Hookstate (FXS only): Onhook

/etc/asterisk/dahdi.conf 的 cat 显示:

[trixbox1.localdomain ~]# cat /etc/asterisk/dahdi-channels.conf
; Autogenerated by /usr/sbin/dahdi_genconf on Tue May 25 17:45:13 2010
; 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  (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
channel => 1
callerid=
group=
context=default

我已经配置了“ZAP 中继(DAHDI 兼容模式)”,其 ZAP 标识符为 1,并带有出站路由,但每当我尝试通过它拨打外部电话时,都会收到“所有电路现在忙,请稍后重试”的消息。

我有一条使用拨号模式 9| 的出站路由和 Trunk Zap/1,以及一个使用 Zap 标识符(中继名称):1 且没有拨号规则的 Zap Trunk。

FXO 模块通过 BT->RJ11 电缆直接从 BT 连接到我们的电话线。

当运行 tail -f /var/log/asterisk/full 并拨打电话时,我得到以下输出:

[May 26 11:10:52] VERBOSE[2723] logger.c:   == Using SIP RTP TOS bits 184
[May 26 11:10:52] VERBOSE[2723] logger.c:   == Using SIP RTP CoS mark 5
[May 26 11:10:52] VERBOSE[2723] logger.c:   == Using SIP VRTP TOS bits 136
[May 26 11:10:52] VERBOSE[2723] logger.c:   == Using SIP VRTP CoS mark 6
[May 26 11:10:52] WARNING[2661] pbx.c: FONALITY: This thread has already held the conlock, skip locking
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [901483890915@from-internal:1] Macro("SIP/801-b7ce8c28", "user-callerid,SKIPTTL,") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-user-callerid:1] Set("SIP/801-b7ce8c28", "AMPUSER=801") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-user-callerid:2] GotoIf("SIP/801-b7ce8c28", "0?report") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-user-callerid:3] ExecIf("SIP/801-b7ce8c28", "1?Set(REALCALLERIDNUM=801)") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-user-callerid:4] Set("SIP/801-b7ce8c28", "AMPUSER=801") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-user-callerid:5] Set("SIP/801-b7ce8c28", "AMPUSERCIDNAME=Jona") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-user-callerid:6] GotoIf("SIP/801-b7ce8c28", "0?report") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-user-callerid:7] Set("SIP/801-b7ce8c28", "AMPUSERCID=801") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-user-callerid:8] Set("SIP/801-b7ce8c28", "CALLERID(all)="Jona" <801>") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-user-callerid:9] Set("SIP/801-b7ce8c28", "REALCALLERIDNUM=801") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-user-callerid:10] ExecIf("SIP/801-b7ce8c28", "0?Set(CHANNEL(language)=)") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-user-callerid:11] GotoIf("SIP/801-b7ce8c28", "1?continue") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Goto (macro-user-callerid,s,20)
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-user-callerid:20] NoOp("SIP/801-b7ce8c28", "Using CallerID "Jona" <801>") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [901483890915@from-internal:2] Set("SIP/801-b7ce8c28", "_NODEST=") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [901483890915@from-internal:3] Macro("SIP/801-b7ce8c28", "record-enable,801,OUT,") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-record-enable:1] GotoIf("SIP/801-b7ce8c28", "1?check") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Goto (macro-record-enable,s,4)
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-record-enable:4] AGI("SIP/801-b7ce8c28", "recordingcheck,20100526-111052,1274868652.1") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
[May 26 11:10:52] VERBOSE[2858] logger.c:  recordingcheck,20100526-111052,1274868652.1: Outbound recording not enabled
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- <SIP/801-b7ce8c28>AGI Script recordingcheck completed, returning 0
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-record-enable:5] MacroExit("SIP/801-b7ce8c28", "") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [901483890915@from-internal:4] Macro("SIP/801-b7ce8c28", "dialout-trunk,1,01483890915,") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-dialout-trunk:1] Set("SIP/801-b7ce8c28", "DIAL_TRUNK=1") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-dialout-trunk:2] GosubIf("SIP/801-b7ce8c28", "0?sub-pincheck,s,1") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-dialout-trunk:3] GotoIf("SIP/801-b7ce8c28", "0?disabletrunk,1") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-dialout-trunk:4] Set("SIP/801-b7ce8c28", "DIAL_NUMBER=01483890915") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-dialout-trunk:5] Set("SIP/801-b7ce8c28", "DIAL_TRUNK_OPTIONS=tr") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-dialout-trunk:6] Set("SIP/801-b7ce8c28", "OUTBOUND_GROUP=OUT_1") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-dialout-trunk:7] GotoIf("SIP/801-b7ce8c28", "1?nomax") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Goto (macro-dialout-trunk,s,9)
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-dialout-trunk:9] GotoIf("SIP/801-b7ce8c28", "0?skipoutcid") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-dialout-trunk:10] Set("SIP/801-b7ce8c28", "DIAL_TRUNK_OPTIONS=") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-dialout-trunk:11] Macro("SIP/801-b7ce8c28", "outbound-callerid,1") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-outbound-callerid:1] ExecIf("SIP/801-b7ce8c28", "0?Set(CALLERPRES()=)") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-outbound-callerid:2] ExecIf("SIP/801-b7ce8c28", "0?Set(REALCALLERIDNUM=801)") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-outbound-callerid:3] GotoIf("SIP/801-b7ce8c28", "1?normcid") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Goto (macro-outbound-callerid,s,6)
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-outbound-callerid:6] Set("SIP/801-b7ce8c28", "USEROUTCID=") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-outbound-callerid:7] Set("SIP/801-b7ce8c28", "EMERGENCYCID=") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-outbound-callerid:8] Set("SIP/801-b7ce8c28", "TRUNKOUTCID=") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-outbound-callerid:9] GotoIf("SIP/801-b7ce8c28", "1?trunkcid") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Goto (macro-outbound-callerid,s,12)
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-outbound-callerid:12] ExecIf("SIP/801-b7ce8c28", "0?Set(CALLERID(all)=)") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-outbound-callerid:13] ExecIf("SIP/801-b7ce8c28", "0?Set(CALLERID(all)=)") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-outbound-callerid:14] ExecIf("SIP/801-b7ce8c28", "0?Set(CALLERPRES()=prohib_passed_screen)") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-dialout-trunk:12] ExecIf("SIP/801-b7ce8c28", "0?AGI(fixlocalprefix)") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-dialout-trunk:13] Set("SIP/801-b7ce8c28", "OUTNUM=01483890915") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-dialout-trunk:14] Set("SIP/801-b7ce8c28", "custom=DAHDI/1") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-dialout-trunk:15] ExecIf("SIP/801-b7ce8c28", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^))") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-dialout-trunk:16] Macro("SIP/801-b7ce8c28", "dialout-trunk-predial-hook,") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("SIP/801-b7ce8c28", "") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-dialout-trunk:17] GotoIf("SIP/801-b7ce8c28", "0?bypass,1") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-dialout-trunk:18] GotoIf("SIP/801-b7ce8c28", "0?customtrunk") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-dialout-trunk:19] Dial("SIP/801-b7ce8c28", "DAHDI/1/01483890915,300,") in new stack
[May 26 11:10:52] WARNING[2858] app_dial.c: Unable to create channel of type 'DAHDI' (cause 0 - Unknown)
[May 26 11:10:52] VERBOSE[2858] logger.c:   == Everyone is busy/congested at this time (1:0/0/1)
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-dialout-trunk:20] Goto("SIP/801-b7ce8c28", "s-CHANUNAVAIL,1") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] GotoIf("SIP/801-b7ce8c28", "1?noreport") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Goto (macro-dialout-trunk,s-CHANUNAVAIL,3)
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s-CHANUNAVAIL@macro-dialout-trunk:3] NoOp("SIP/801-b7ce8c28", "TRUNK Dial failed due to CHANUNAVAIL (hangupcause: 0) - failing through to other trunks") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [901483890915@from-internal:5] Macro("SIP/801-b7ce8c28", "outisbusy,") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- Executing [s@macro-outisbusy:1] Playback("SIP/801-b7ce8c28", "all-circuits-busy-now,noanswer") in new stack
[May 26 11:10:52] VERBOSE[2858] logger.c:     -- <SIP/801-b7ce8c28> Playing 'all-circuits-busy-now.ulaw' (language 'en')
[May 26 11:10:54] VERBOSE[2858] logger.c:     -- Executing [s@macro-outisbusy:2] Playback("SIP/801-b7ce8c28", "pls-try-call-later,noanswer") in new stack
[May 26 11:10:54] VERBOSE[2858] logger.c:     -- <SIP/801-b7ce8c28> Playing 'pls-try-call-later.ulaw' (language 'en')
[May 26 11:10:54] WARNING[2661] pbx.c: FONALITY: This thread has already held the conlock, skip locking
[May 26 11:10:54] VERBOSE[2858] logger.c:   == Spawn extension (macro-outisbusy, s, 2) exited non-zero on 'SIP/801-b7ce8c28' in macro 'outisbusy'
[May 26 11:10:54] VERBOSE[2858] logger.c:   == Spawn extension (from-internal, 901483890915, 5) exited non-zero on 'SIP/801-b7ce8c28'
[May 26 11:10:54] VERBOSE[2858] logger.c:     -- Executing [h@from-internal:1] Macro("SIP/801-b7ce8c28", "hangupcall") in new stack
[May 26 11:10:54] VERBOSE[2858] logger.c:     -- Executing [s@macro-hangupcall:1] ResetCDR("SIP/801-b7ce8c28", "vw") in new stack
[May 26 11:10:54] VERBOSE[2858] logger.c:     -- Executing [s@macro-hangupcall:2] NoCDR("SIP/801-b7ce8c28", "") in new stack
[May 26 11:10:54] VERBOSE[2858] logger.c:     -- Executing [s@macro-hangupcall:3] GotoIf("SIP/801-b7ce8c28", "1?skiprg") in new stack
[May 26 11:10:54] VERBOSE[2858] logger.c:     -- Goto (macro-hangupcall,s,6)
[May 26 11:10:55] VERBOSE[2858] logger.c:     -- Executing [s@macro-hangupcall:6] GotoIf("SIP/801-b7ce8c28", "1?skipblkvm") in new stack
[May 26 11:10:55] VERBOSE[2858] logger.c:     -- Goto (macro-hangupcall,s,9)
[May 26 11:10:55] VERBOSE[2858] logger.c:     -- Executing [s@macro-hangupcall:9] GotoIf("SIP/801-b7ce8c28", "1?theend") in new stack
[May 26 11:10:55] VERBOSE[2858] logger.c:     -- Goto (macro-hangupcall,s,11)
[May 26 11:10:55] VERBOSE[2858] logger.c:     -- Executing [s@macro-hangupcall:11] Hangup("SIP/801-b7ce8c28", "") in new stack
[May 26 11:10:55] VERBOSE[2858] logger.c:   == Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/801-b7ce8c28' in macro 'hangupcall'
[May 26 11:10:55] VERBOSE[2858] logger.c:   == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/801-b7ce8c28'

我猜我错过了某个地方的配置步骤,但不知道在哪里,非常感谢任何帮助。

答案1

我已经有一段时间没有在 Aterisk 和 BT 中使用 FXO 模块了,所以我不能确认这是否仍然有必要(或者 trixbox 不能自行完成此操作),但您是否遵循了“TDM 400 FXS 和 BT POTS 线路“本页上的部分:

http://www.voip-info.org/wiki/view/UK+Asterisk+Details

具体来说:

通过添加将卡设置为英国线路规格

选项 wctdm opermode=UK fwringdetect=1 battthresh=4

到 /etc/modprobe.conf(或者可能是 /etc/modprobe.d/zaptel 或 /etc/modules.conf,取决于发行版?)

如果这没有帮助,您可以从 asterisk CLI 发布“dahdi show status”和“dahdi show channels”的输出。

答案2

从命令行运行:

setup-pstn

完成后,编辑配置文件: vi /etc/asterisk/dahdi-channels.conf

信号将与您实际使用的信号相反!所以fxs_ks是正确的。

您可能需要改变上下文:

默认情况下是:context=from-zaptel

您可能需要将其更改为:context=from-pstn

相关内容