使用FXO卡配合asterisk及freepbx将固定电话信号转为VoIP

在本篇文章中,笔者尝试使用TDM410p FXO卡和freepbx,将固定电话的信号转换为了VoIP(SIP)协议,并使用SIP话机接打电话。

所需硬件

  • FXO卡一块,比较便宜的解决方案是TDM410p,红色的是FXO卡(接墙上的电话线),绿色的是FXS卡(接电话机终端),我们所需的是FXO卡,购买前需要注意有些卡是PCI接口的,可能需要另外买PCI转PCIe的转接卡。淘宝上的单口FXO卡大约200元一块。笔者买了某淘宝店的单口FXO组合板(一张PCI接口的单口FXO卡,和一张PCI转PCIe转接卡组合在了一起)
  • 主机一台,由于TDM410p的硬件规格太老,似乎无法在PVE上进行pcie直通,因此笔者用了一台旧电脑直接安装了FreePBX发行版。(根据网上的讨论,fxo及freepbx对机器的性能要求很低,甚至十多年前的酷睿2+2G内存都能正常运行)
  • (可选)若干台IP电话,可在闲鱼上以「思科/Cisco IP电话」之类的关键词搜索。大概能搜到60-100元一台的CP7900CP8900系列的电话机,价格甚至比某些接RJ11的传统电话机还便宜。

配置

FXO卡

FXO卡的硬件是通过dahdi进行驱动的,freepbx已经自带了这些驱动,理论上插上fxo卡之后,dahdi就能识别出来了。同时,我们也可以通过dahdi_scan来验证一下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[root@freepbx]# dahdi_scan 
[1]
active=yes
alarms=OK
description=Wildcard TDM410P
name=WCTDM/0
manufacturer=Digium
devicetype=Wildcard TDM410P
location=PCI Bus 03 Slot 01
basechan=1
totchans=4
irq=0
type=analog
port=1,FXO
port=2,none
port=3,none
port=4,none

在freepbx网页界面的Connectivity-DAHDI Configuration,在弹出的提示里点enable,然后重载asterisk和dahdi。

如果确认卡能识别出来的话,随后运行dahdi_genconf -vv,dahdi会生成asterisk需要的一些channel配置文件(如/etc/asterisk/dahdi-channels.conf),我们还需要在/etc/asterisk/chan_dahdi_channels_custom.conf里添加一行#include dahdi-channels.conf(这行很可能在freepbx重载的时候被删掉,如果遇到了打出电话的时候提示no channel available之类的错误的话,可以检查一下)。

1
#include dahdi-channels.conf 

此时我们可以在命令行界面进入asterisk的命令行(asterisk -rvvv),检查一下dahdi的channel运行状态:

1
2
3
4
freepbx*CLI> dahdi show channels
Chan Extension Context Language MOH Interpret Blocked In Service Description
pseudo default default Yes
1 from-analog cn default Yes

修改callerid的识别方式

这一步主要是为了让asterisk能识别出打进来电话的callerid(呼叫方的电话号码),一般中国大陆使用的callerid广播方法主要是FSK和DTMF两种。如果不清楚运营商用的是哪种callerid的话,可以用dahdi_monitor 1 -v -r rx.wav -t tx.wav的命令对FXO口录音,随后给FXO口对应的电话打一个电话,并用软件观察录制的波形。具体的波形例子可以在这个链接里找到。由于笔者这边的运营商使用的是FSK(特征是先有若干个小峰,0.5秒左右后跟着一个一个听起来很像宽带拨号声音的音频),因此我们需要在DAHDI Configuration的页面右边的Global Settings里添加(或修改)以下项目:

1
2
3
cidsignalling=bell
cidstart=ring
opermode=CHINA

随后在System Settings里面把tone reigon改成China,添加:

1
2
defaultzone=cn
loadzone=cn

保存并重启asterisk和dahdi,如果不放心也可以在命令行运行fwconsole restart重启整个freepbx服务。

随后的配置和笔者的上一篇文章类似,添加extension(分机),trunk(选dahdi trunk),inbound route和outbound route即可。

连接Cisco IP电话(可选)

为cisco ip电话建立的extension(分机)需要用chan_sip(而不是pjsp)建立才能正常拨打和接听电话。chan_sipe可以在freepbx的Settings-Advanced settings-SIP Channel Driver里启用(设置成both即可)。

升级电话为SIP固件

先去Cisco的支持网站下载固件(需要注册一个免费的账号,下载固件选择SIP固件,zip结尾的)。

下载后解压为如下形式:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
.
├── BOOT894x.0-0-2-0.bin.sgn
├── SIP894x.9-4-2SR3-1.bin1.sgn
├── SIP894x.9-4-2SR3-1.bin10.sgn
├── SIP894x.9-4-2SR3-1.bin11.sgn
├── SIP894x.9-4-2SR3-1.bin2.sgn
├── SIP894x.9-4-2SR3-1.bin3.sgn
├── SIP894x.9-4-2SR3-1.bin4.sgn
├── SIP894x.9-4-2SR3-1.bin5.sgn
├── SIP894x.9-4-2SR3-1.bin6.sgn
├── SIP894x.9-4-2SR3-1.bin7.sgn
├── SIP894x.9-4-2SR3-1.bin8.sgn
├── SIP894x.9-4-2SR3-1.bin9.sgn
├── SIP894x.9-4-2SR3-1.loads

随后在此文件夹里新建一个名为XMLDefault.cnf.xml的文件,内容如下,并把需要升级的电话机型号那一行的内容改成上面固件的前缀(比如笔者需要用上面的固件升级CP 8945,那就修改<loadInformation585 model="Cisco 8945">SIP894x.9-4-2SR3-1</loadInformation585>这一行,并把内容改成SIP894x.9-4-2SR3-1):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<Default>
<autoRegistrationName>AUTO-REG</autoRegistrationName>
<autoRegistration>disabled</autoRegistration>
<selfProvisioningSecureMode>true</selfProvisioningSecureMode>
<adminProvisionMode>false</adminProvisionMode>
<ipAddressMode>0</ipAddressMode>
<ipPreferenceModeControl>0</ipPreferenceModeControl>
<ipMediaAddressFamilyPreference>0</ipMediaAddressFamilyPreference>
<callManagerGroup>
<name>Default</name>
<tftpDefault>true</tftpDefault>
<members>
<member priority="0">
<callManager>
<name>cucmpub1</name>
<description>cucmpub1</description>
<ports>
<ethernetPhonePort>2000</ethernetPhonePort>
<sipPort>5060</sipPort>
<securedSipPort>5061</securedSipPort>
<mgcpPorts>
<listen>2427</listen>
<keepAlive>2428</keepAlive>
</mgcpPorts>
</ports>
<processNodeName>cucmpub1</processNodeName>
</callManager>
</member>
</members>
</callManagerGroup>
<TVS>
<members>
<member priority="0">
<port>2445</port>
<address>cucmpub1</address>
</member>
</members>
</TVS>
<loadInformation548 model="Cisco 6911">SCCP6911.9-3-1-SR2-3</loadInformation548>
<loadInformation497 model="Cisco 6961">SCCP69xx.9-4-1-3SR2</loadInformation497>
<loadInformation614 model="Cisco TelePresence Profile 52 Dual (C60)"></loadInformation614>
<loadInformation616 model="Cisco TelePresence Profile 65 Dual (C90)"></loadInformation616>
<loadInformation558 model="Cisco TelePresence 400"></loadInformation558>
<loadInformation557 model="Cisco TelePresence 200"></loadInformation557>
<loadInformation628 model="IMS-integrated Mobile (Basic)"></loadInformation628>
<loadInformation30006 model="Cisco 7970">SCCP70.9-4-2SR1-1S</loadInformation30006>
<loadInformation684 model="Cisco 8851">sip88xx.11-5-1-18</loadInformation684>
<loadInformation593 model="Cisco Cius"></loadInformation593>
<loadInformation520 model="Cisco TelePresence 1100"></loadInformation520>
<loadInformation592 model="Cisco 3905">CP3905.9-4-1SR2-2</loadInformation592>
<loadInformation36217 model="Cisco 8811">sip88xx.11-5-1-18</loadInformation36217>
<loadInformation36225 model="Cisco 8865">sip8845_65.11-5-1-18</loadInformation36225>
<loadInformation36213 model="Cisco 7811">sip78xx.11-5-1-18</loadInformation36213>
<loadInformation645 model="Universal Device Template"></loadInformation645>
<loadInformation36207 model="Cisco TelePresence MX700"></loadInformation36207>
<loadInformation115 model="Cisco 7941">SCCP41.9-4-2SR1-1S</loadInformation115>
<loadInformation480 model="Cisco TelePresence 3200"></loadInformation480>
<loadInformation648 model="Cisco Unified Communications for RTX"></loadInformation648>
<loadInformation30016 model="Cisco IP Communicator"></loadInformation30016>
<loadInformation36043 model="Cisco DX70"></loadInformation36043>
<loadInformation30032 model="SCCP gateway virtual phone"></loadInformation30032>
<loadInformation496 model="Cisco 6941">SCCP69xx.9-4-1-3SR2</loadInformation496>
<loadInformation610 model="Cisco TelePresence Profile 42 (C20)"></loadInformation610>
<loadInformation36227 model="Cisco TelePresence MX800 Dual"></loadInformation36227>
<loadInformation478 model="Cisco TelePresence 1000"></loadInformation478>
<loadInformation308 model="Cisco 7961G-GE">SCCP41.9-4-2SR1-1S</loadInformation308>
<loadInformation540 model="Cisco 8961">sip8961.9-4-2SR2-2</loadInformation540>
<loadInformation309 model="Cisco 7941G-GE">SCCP41.9-4-2SR1-1S</loadInformation309>
<loadInformation613 model="Cisco TelePresence Profile 52 (C60)"></loadInformation613>
<loadInformation30019 model="Cisco 7936">cmterm_7936.3-3-21-0</loadInformation30019>
<loadInformation481 model="Cisco TelePresence 500-37"></loadInformation481>
<loadInformation12 model="Cisco ATA 186">ATA030204SCCP090202A</loadInformation12>
<loadInformation36216 model="Cisco 8821"></loadInformation36216>
<loadInformation412 model="Cisco 3951">SIP3951.8-1-4a</loadInformation412>
<loadInformation690 model="Cisco TelePresence MX300 G2"></loadInformation690>
<loadInformation583 model="Generic Multiple Screen Room System"></loadInformation583>
<loadInformation365 model="Cisco 7921">CP7921G-1.4.6.3</loadInformation365>
<loadInformation30035 model="IP-STE"></loadInformation30035>
<loadInformation586 model="Cisco 8941">SCCP894x.9-4-2SR2-2</loadInformation586>
<loadInformation369 model="Cisco 7906">SCCP11.9-4-2SR1-1S</loadInformation369>
<loadInformation582 model="Generic Single Screen Room System"></loadInformation582>
<loadInformation30018 model="Cisco 7961">SCCP41.9-4-2SR1-1S</loadInformation30018>
<loadInformation550 model="Cisco ATA 187">ATA187.9-2-3-1</loadInformation550>
<loadInformation608 model="Cisco TelePresence Codec C40"></loadInformation608>
<loadInformation36210 model="Cisco TelePresence IX5000"></loadInformation36210>
<loadInformation681 model="Cisco ATA 190">ATA190.1-2-2-003</loadInformation681>
<loadInformation495 model="Cisco 6921">SCCP69xx.9-4-1-3SR2</loadInformation495>
<loadInformation633 model="Cisco TelePresence Profile 42 (C40)"></loadInformation633>
<loadInformation585 model="Cisco 8945">SIP894x.9-4-2SR3-1</loadInformation585>
<loadInformation689 model="Cisco TelePresence MX200 G2"></loadInformation689>
<loadInformation446 model="Cisco 3911">SIP3951.8-1-4a</loadInformation446>
<loadInformation682 model="Cisco TelePresence SX10"></loadInformation682>
<loadInformation606 model="Cisco TelePresence Codec C90"></loadInformation606>
<loadInformation521 model="Transnova S3"></loadInformation521>
<loadInformation36241 model="Cisco TelePresence DX70"></loadInformation36241>
<loadInformation307 model="Cisco 7911">SCCP11.9-4-2SR1-1S</loadInformation307>
<loadInformation659 model="Cisco 8831">sip8831.10-3-1SR2-2</loadInformation659>
<loadInformation30 model="Analog Access">A001C030</loadInformation30>
<loadInformation47 model="Analog Access WS-X6624">A00204000013</loadInformation47>
<loadInformation51 model="Conference Bridge WS-X6608">C00104000003</loadInformation51>
<loadInformation40 model="Digital Access">D001M022</loadInformation40>
<loadInformation43 model="Digital Access WS-X6608">D00404000032</loadInformation43>
<loadInformation42 model="Digital Access+">D00303010033</loadInformation42>
<loadInformation61 model="H.323 Phone"></loadInformation61>
<loadInformation7 model="Cisco 7960">P0030801SR02</loadInformation7>
<loadInformation100 model="Load Simulator"></loadInformation100>
<loadInformation111 model="Media Termination Point Hardware">M00104000006</loadInformation111>
<loadInformation120 model="MGCP Station"></loadInformation120>
<loadInformation121 model="MGCP Trunk"></loadInformation121>
<loadInformation588 model="Generic Desktop Video Endpoint"></loadInformation588>
<loadInformation632 model="Cisco Cius SP"></loadInformation632>
<loadInformation647 model="Cisco DX650"></loadInformation647>
<loadInformation348 model="Cisco 7931">SCCP31.9-4-2SR1-1S</loadInformation348>
<loadInformation627 model="Cisco TelePresence MX300"></loadInformation627>
<loadInformation635 model="CTI Remote Device"></loadInformation635>
<loadInformation36235 model="Cisco Spark Remote Device"></loadInformation36235>
<loadInformation607 model="Cisco TelePresence Codec C60"></loadInformation607>
<loadInformation537 model="Cisco 9951">sip9951.9-4-2SR2-2</loadInformation537>
<loadInformation621 model="Cisco 7821">sip78xx.11-5-1-18</loadInformation621>
<loadInformation431 model="Cisco 7937">apps37sccp.1-4-5-7</loadInformation431>
<loadInformation376 model="Nokia S60"></loadInformation376>
<loadInformation375 model="Cisco TelePresence"></loadInformation375>
<loadInformation609 model="Cisco TelePresence Quick Set C20"></loadInformation609>
<loadInformation685 model="Cisco 8861">sip88xx.11-5-1-18</loadInformation685>
<loadInformation688 model="Cisco TelePresence SX80"></loadInformation688>
<loadInformation11 model="Cisco VGC Virtual Phone"></loadInformation11>
<loadInformation591 model="Cisco TelePresence 1300-47"></loadInformation591>
<loadInformation620 model="Cisco TelePresence TX9200"></loadInformation620>
<loadInformation10 model="Cisco VGC Phone"></loadInformation10>
<loadInformation484 model="Cisco 7925">CP7925G-1.4.8.4</loadInformation484>
<loadInformation617 model="Cisco TelePresence MX200"></loadInformation617>
<loadInformation562 model="Cisco Dual Mode for iPhone"></loadInformation562>
<loadInformation36239 model="Cisco TelePresence DX80"></loadInformation36239>
<loadInformation8 model="Cisco 7940">P0030801SR02</loadInformation8>
<loadInformation479 model="Cisco TelePresence 3000"></loadInformation479>
<loadInformation30027 model="Analog Phone"></loadInformation30027>
<loadInformation622 model="Cisco 7841">sip78xx.11-5-1-18</loadInformation622>
<loadInformation119 model="Cisco 7971">SCCP70.9-4-2SR1-1S</loadInformation119>
<loadInformation626 model="Cisco TelePresence SX20"></loadInformation626>
<loadInformation596 model="Cisco TelePresence TX1310-65"></loadInformation596>
<loadInformation577 model="Cisco 7926">CP7926G-1.4.8.4</loadInformation577>
<loadInformation564 model="Cisco 6945">SCCP6945.9-4-1-3SR2</loadInformation564>
<loadInformation604 model="Cisco TelePresence EX60"></loadInformation604>
<loadInformation36042 model="Cisco DX80"></loadInformation36042>
<loadInformation437 model="Cisco 7975">SCCP75.9-4-2SR1-1S</loadInformation437>
<loadInformation36232 model="Cisco 8851NR">sip88xx.11-5-1-18</loadInformation36232>
<loadInformation547 model="Cisco 6901">SCCP6901.9-3-1-SR2-2</loadInformation547>
<loadInformation404 model="Cisco 7962">SCCP42.9-4-2SR1-1S</loadInformation404>
<loadInformation435 model="Cisco 7945">SCCP45.9-3-1SR4-1S</loadInformation435>
<loadInformation302 model="Cisco 7985">cmterm_7985.4-1-7-0</loadInformation302>
<loadInformation612 model="Cisco TelePresence Profile 52 (C40)"></loadInformation612>
<loadInformation580 model="Cisco E20"></loadInformation580>
<loadInformation619 model="Cisco TelePresence TX9000"></loadInformation619>
<loadInformation575 model="Cisco Dual Mode for Android"></loadInformation575>
<loadInformation434 model="Cisco 7942">SCCP42.9-4-2SR1-1S</loadInformation434>
<loadInformation36224 model="Cisco 8845">sip8845_65.11-5-1SR1-1</loadInformation36224>
<loadInformation623 model="Cisco 7861">sip78xx.11-5-1-18</loadInformation623>
<loadInformation30028 model="ISDN BRI Phone"></loadInformation30028>
<loadInformation358 model="Cisco Unified Personal Communicator"></loadInformation358>
<loadInformation642 model="Carrier-integrated Mobile"></loadInformation642>
<loadInformation503 model="Cisco Unified Client Services Framework"></loadInformation503>
<loadInformation590 model="Cisco TelePresence 500-32"></loadInformation590>
<loadInformation493 model="Cisco 9971">sip9971.9-4-2SR2-2</loadInformation493>
<loadInformation652 model="Cisco Jabber for Tablet"></loadInformation652>
<loadInformation335 model="Motorola CN622"></loadInformation335>
<loadInformation436 model="Cisco 7965">SCCP45.9-4-2SR1-1S</loadInformation436>
<loadInformation683 model="Cisco 8841">sip88xx.11-5-1-18</loadInformation683>
<loadInformation505 model="Cisco TelePresence 1300-65"></loadInformation505>
<loadInformation584 model="Cisco TelePresence EX90"></loadInformation584>
<loadInformation36208 model="Cisco TelePresence MX800"></loadInformation36208>
<loadInformation611 model="Cisco TelePresence Profile 42 (C60)"></loadInformation611>
<loadInformation634 model="Cisco VXC 6215"></loadInformation634>
<loadInformation615 model="Cisco TelePresence Profile 65 (C60)"></loadInformation615>
</Default>

使用tftp64或者linux上的其他tftp软件host这个文件夹,打开电话机,手动配置一下电话机下载配置的tftp服务器的ip,等待大概半分钟之后,电话机就会开始从tftp服务器下载配置文件,并开始升级(屏幕上会显示)。

下发SIP配置

给电话机下发SIP配置同样需要用到tftp服务器(笔者推荐使用freepbx发行版里centos自带的tftp服务器,修改一下/etc/xinetd.d/tftp,重启xinetd就可以使用了)。如果需要了解更多配置选项,可以查阅https://usecallmanager.nz/sepmac-cnf-xml.html,此处笔者仅提供一个自己的Cisco电话机可用的配置:

首先新建一个XMLDefault.cnf.xml在,注意修改processNodeNameloadInformation一行(数字和固件号需要跟前文的那个xml匹配)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?xml version="1.0" ?>
<Default>
<callManagerGroup>
<members>
<member priority="0">
<callManager>
<ports>
<ethernetPhonePort>2000</ethernetPhonePort>
<mgcpPorts>
<listen>2427</listen>
<keepAlive>2428</keepAlive>
</mgcpPorts>
</ports>
<!--FREEPBX SERVER IP GOES HERE-->
<processNodeName>FREEPBX_IP</processNodeName>
</callManager>
</member>
</members>
</callManagerGroup>
<!--Cisco IP Phone Firmware-->
<loadInformation585 model="Cisco 8945">SIP894x.9-4-2SR3-1</loadInformation585>
<authenticationURL></authenticationURL>
<directoryURL></directoryURL>
<idleURL></idleURL>
<informationURL></informationURL>
<messagesURL></messagesURL>
<servicesURL></servicesURL>
</Default>

随后新建一个电话的hostname.cnf.xml,电话的hostname可以在电话的网络设置里看到,hostname需要全大写,根据自己的情况修改一下SIP的端口(freepbx的chan_sip的端口默认是TCP/UDP5160,TLS5161)和用户名密码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<device> 
<deviceProtocol>SIP</deviceProtocol>
<sshUserId>cisco</sshUserId>
<sshPassword>cisco</sshPassword>
<devicePool>
<dateTimeSetting>
<dateTemplate>Y.M.D</dateTemplate>
<timeZone>China Standard/Daylight Time</timeZone>
<ntps>
<ntp>
<name>time.apple.com</name>
<ntpMode>Unicast</ntpMode>
</ntp>
</ntps>
</dateTimeSetting>
<callManagerGroup>
<members>
<member priority="0">
<callManager>
<ports>
<ethernetPhonePort>2000</ethernetPhonePort>
<sipPort>5160</sipPort>
<securedSipPort>5161</securedSipPort>
</ports>
<processNodeName>10.20.18.222</processNodeName>
</callManager>
</member>
</members>
</callManagerGroup>
</devicePool>
<sipProfile>
<sipProxies>
<backupProxy></backupProxy>
<backupProxyPort>5160</backupProxyPort>
<emergencyProxy></emergencyProxy>
<emergencyProxyPort></emergencyProxyPort>
<outboundProxy></outboundProxy>
<outboundProxyPort></outboundProxyPort>
<registerWithProxy>true</registerWithProxy>
</sipProxies>
<sipCallFeatures>
<cnfJoinEnabled>true</cnfJoinEnabled>
<callForwardURI>x-serviceuri-cfwdall</callForwardURI>
<callPickupURI>x-cisco-serviceuri-pickup</callPickupURI>
<callPickupListURI>x-cisco-serviceuri-opickup</callPickupListURI>
<callPickupGroupURI>x-cisco-serviceuri-gpickup</callPickupGroupURI>
<meetMeServiceURI>x-cisco-serviceuri-meetme</meetMeServiceURI>
<abbreviatedDialURI>x-cisco-serviceuri-abbrdial</abbreviatedDialURI>
<rfc2543Hold>false</rfc2543Hold>
<callHoldRingback>2</callHoldRingback>
<localCfwdEnable>true</localCfwdEnable>
<semiAttendedTransfer>true</semiAttendedTransfer>
<anonymousCallBlock>2</anonymousCallBlock>
<callerIdBlocking>2</callerIdBlocking>
<dndControl>0</dndControl>
<remoteCcEnable>true</remoteCcEnable>
</sipCallFeatures>
<sipStack>
<sipInviteRetx>6</sipInviteRetx>
<sipRetx>10</sipRetx>
<timerInviteExpires>180</timerInviteExpires>
<timerRegisterExpires>3600</timerRegisterExpires>
<timerRegisterDelta>5</timerRegisterDelta>
<timerKeepAliveExpires>120</timerKeepAliveExpires>
<timerSubscribeExpires>120</timerSubscribeExpires>
<timerSubscribeDelta>5</timerSubscribeDelta>
<timerT1>500</timerT1>
<timerT2>4000</timerT2>
<maxRedirects>70</maxRedirects>
<remotePartyID>false</remotePartyID>
<userInfo>None</userInfo>
</sipStack>
<autoAnswerTimer>1</autoAnswerTimer>
<autoAnswerAltBehavior>false</autoAnswerAltBehavior>
<autoAnswerOverride>true</autoAnswerOverride>
<transferOnhookEnabled>false</transferOnhookEnabled>
<enableVad>false</enableVad>
<dtmfAvtPayload>101</dtmfAvtPayload>
<dtmfDbLevel>3</dtmfDbLevel>
<dtmfOutofBand>avt</dtmfOutofBand>
<alwaysUsePrimeLine>false</alwaysUsePrimeLine>
<alwaysUsePrimeLineVoiceMail>false</alwaysUsePrimeLineVoiceMail>
<kpml>3</kpml>
<phoneLabel>Cisco 8945</phoneLabel>
<stutterMsgWaiting>1</stutterMsgWaiting>
<callStats>true</callStats>
<silentPeriodBetweenCallWaitingBursts>10</silentPeriodBetweenCallWaitingBursts>
<disableLocalSpeedDialConfig>false</disableLocalSpeedDialConfig>
<sipLines>
<line button="1">
<featureID>9</featureID>
<featureLabel>5111</featureLabel>
<proxy>USECALLMANAGER</proxy>
<port>5160</port>
<name>SIP_USERNAME</name>
<displayName>DISPLAYNAME</displayName>
<autoAnswer>
<autoAnswerEnabled>2</autoAnswerEnabled>
</autoAnswer>
<callWaiting>3</callWaiting>
<authName>SIP_USERNAME</authName>
<authPassword>SIP_PASSWORD</authPassword>
<sharedLine>false</sharedLine>
<messageWaitingLampPolicy>1</messageWaitingLampPolicy>
<messagesNumber>*97</messagesNumber>
<ringSettingIdle>4</ringSettingIdle>
<ringSettingActive>5</ringSettingActive>
<contact>SIP_USERNAME</contact>
<forwardCallInfoDisplay>
<callerName>true</callerName>
<callerNumber>true</callerNumber>
<redirectedNumber>true</redirectedNumber>
<dialedNumber>true</dialedNumber>
</forwardCallInfoDisplay>
</line>
</sipLines>
<voipControlPort>5160</voipControlPort>
<startMediaPort>10000</startMediaPort>
<stopMediaPort>11000</stopMediaPort>
<dscpForAudio>184</dscpForAudio>
<ringSettingBusyStationPolicy>0</ringSettingBusyStationPolicy>
<dialTemplate>dialplan.xml</dialTemplate>
<softKeyFile></softKeyFile>
</sipProfile>
<commonProfile>
<phonePassword></phonePassword>
<backgroundImageAccess>true</backgroundImageAccess>
<callLogBlfEnabled>2</callLogBlfEnabled>
</commonProfile>
<loadInformation>SIP894x.9-4-2SR3-1</loadInformation>
<vendorConfig>
<disableSpeaker>false</disableSpeaker>
<disableSpeakerAndHeadset>false</disableSpeakerAndHeadset>
<pcPort>1</pcPort>
<settingsAccess>1</settingsAccess>
<garp>0</garp>
<voiceVlanAccess>0</voiceVlanAccess>
<videoCapability>0</videoCapability>
<autoSelectLineEnable>0</autoSelectLineEnable>
<webAccess>1</webAccess>
<daysDisplayNotActive>1,2,3,4,5,6,7</daysDisplayNotActive>
<displayOnTime>00:01</displayOnTime>
<displayOnDuration>00:01</displayOnDuration>
<displayIdleTimeout>00:01</displayIdleTimeout>

<spanToPCPort>1</spanToPCPort>
<loggingDisplay>1</loggingDisplay>
<loadServer></loadServer>
<sshAccess>0</sshAccess>
</vendorConfig>
<userLocale>
<name></name>
<uid></uid>
<langCode>en_US</langCode>
<version>1.0.0.0-1</version>
<winCharSet>iso-8859-1</winCharSet>
</userLocale>
<networkLocale></networkLocale>
<networkLocaleInfo>
<name></name>
<uid></uid>
<version>1.0.0.0-1</version>
</networkLocaleInfo>
<deviceSecurityMode>1</deviceSecurityMode>
<authenticationURL></authenticationURL>
<directoryURL></directoryURL>
<servicesURL></servicesURL>
<idleURL></idleURL>
<informationURL></informationURL>
<messagesURL></messagesURL>
<proxyServerURL></proxyServerURL>
<dscpForSCCPPhoneConfig>96</dscpForSCCPPhoneConfig>
<dscpForSCCPPhoneServices>0</dscpForSCCPPhoneServices>
<dscpForCm2Dvce>96</dscpForCm2Dvce>
<transportLayerProtocol>2</transportLayerProtocol>
<capfAuthMode>0</capfAuthMode>
<capfList>
<capf>
<phonePort>3804</phonePort>
</capf>
</capfList>
<certHash></certHash>
<encrConfig>false</encrConfig>
</device>

修改完后启动tftp服务器,在电话机上设置好tftp服务器后等待电话机完成注册,即可通过网络接打电话了。

参考

  • https://groups.google.com/g/asterisk-tw/c/pfb3IlN6bbk
  • https://kb.clearlyip.com/appliances/FXO-and-FXS-Setup-Guide.html
  • https://wiki.freepbx.org/pages/viewpage.action?pageId=58097711
  • https://usecallmanager.nz/sepmac-cnf-xml.html
  • https://github.com/jefffall/Asterisk/blob/master/asterisk-version_15-config_files_july-3-2018/SEP6899CDA10587.cnf.xml