ASA Phone Proxy 配置 (Non-secure Mode)

ASA Phone Proxy 配置 (Non-secure Mode)。之前的老文,发出来记录一下。
Non-Secure Mode如下图所述,ASA对外网Signaling是加密的(TLS),语音也是加密的(SRTP);对内网Signaling是非加密的(TCP+SIP),语音也是非加密的(RTP)。

Phone Proxy Secure Deployment

ASA Phone Proxy ( None-Secure)

asa-pp-non# show run
asa-pp-non# show running-config
: Saved
:
ASA Version 8.2(1)4
!
hostname asa-pp-non
domain-name crdc.cisco.com
enable password 2KFQnbNIdI.2KYOU encrypted
passwd YuEtEaxrQQPO/oUA encrypted
names
!
interface Vlan1
nameif inside
security-level 100
ip address 100.100.8.19 255.255.255.240
!
interface Vlan888
nameif outside
security-level 0
ip address 8.8.8.251 255.255.255.240
!
interface Ethernet0/0
switchport access vlan 888
!
interface Ethernet0/1
!
interface Ethernet0/2
!
interface Ethernet0/3
!
interface Ethernet0/4
!
interface Ethernet0/5
!
interface Ethernet0/6
!
interface Ethernet0/7
!
ftp mode passive
dns domain-lookup inside
dns server-group DefaultDNS
name-server 10.74.53.182
domain-name crdc.cisco.com
same-security-traffic permit intra-interface
access-list inside_access_in extended permit ip any any
access-list outside_access_in extended permit ip any any
pager lines 24
mtu inside 1500
mtu outside 1500
no failover
icmp unreachable rate-limit 1 burst-size 1
no asdm history enable
arp timeout 14400
access-group inside_access_in in interface inside
access-group outside_access_in in interface outside
route inside 0.0.0.0 0.0.0.0 100.100.8.17 1
route outside 100.100.8.0 255.255.255.192 8.8.8.254 1
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
timeout tcp-proxy-reassembly 0:01:00
dynamic-access-policy-record DfltAccessPolicy
http server enable
http 100.100.8.0 255.255.255.0 inside
http 10.74.32.0 255.255.224.0 inside
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart
crypto ipsec security-association lifetime seconds 28800
crypto ipsec security-association lifetime kilobytes 4608000
crypto ca trustpoint Cisco_Manufacturing_CA
enrollment terminal
crl configure
crypto ca trustpoint CAP-RTP-001
enrollment terminal
crl configure
crypto ca trustpoint CAP-RTP-002
enrollment terminal
crl configure
crypto ca trustpoint Pubcucm_tftp_server
enrollment self
serial-number
keypair Pubcucmtftp_kp
crl configure
crypto ca trustpoint _internal_myctl_SAST_1
enrollment self
keypair _internal_myctl_SAST_1
crl configure
crypto ca trustpoint _internal_myctl_SAST_0
enrollment self
keypair _internal_myctl_SAST_0
crl configure
crypto ca trustpoint _internal_PP_myctl
enrollment self
keypair _internal_PP_myct
crl configure
crypto ca certificate chain Cisco_Manufacturing_CA
certificate ca 6a6967b3000000000003
308204d9 308203c1 a0030201 02020a6a 6967b300 00000000 03300d06 092a8648
86f70d01 01050500 30353116 30140603 55040a13 0d436973 636f2053 79737465
6d73311b 30190603 55040313 12436973 636f2052 6f6f7420 43412032 30343830
1e170d30 35303631 30323231 3630315a 170d3239 30353134 32303235 34325a30
39311630 14060355 040a130d 43697363 6f205379 7374656d 73311f30 1d060355
04031316 43697363 6f204d61 6e756661 63747572 696e6720 43413082 0120300d
06092a86 4886f70d 01010105 00038201 0d003082 01080282 010100a0 c5f7dc96
943515f1 f4994ebb 9b41e17d db791691 bbf354f2 414a9432 6262c923 f79ae7bb
9b79e807 294e30f5 ae1bc521 5646b0f8 f4e68e81 b816cca8 9b85d242 81db7ccb
94a91161 121c5cea 33201c9a 16a77ddb 99066ae2 36afecf8 0aff9867 07f430ee
a5f8881a aae8c73c 1cceee48 fdcd5c37 f186939e 3d71757d 34ee4b14 a9c0297b
0510ef87 9e693130 f548363f d8abce15 e2e8589f 3e627104 8726a415 620125aa
d5dfc9c9 5bb8c9a1 077bbe68 92939320 a86cbd15 75d3445d 454beca8 da60c7d8
c8d5c8ed 41e1f55f 578e5332 9349d5d9 0ff836aa 07c43241 c5a7af1d 19fff673
99395a73 67621334 0d1f5e95 70526417 06ec535c 5cdb6aea 35004102 0103a382
01e73082 01e33012 0603551d 130101ff 04083006 0101ff02 0100301d 0603551d
0e041604 14d0c522 26ab4f46 60ecae05 91c7dc5a d1b047f7 6c300b06 03551d0f
04040302 01863010 06092b06 01040182 37150104 03020100 30190609 2b060104
01823714 02040c1e 0a005300 75006200 43004130 1f060355 1d230418 30168014
27f3c815 1e6e9a02 0916ad2b a089605f da7b2faa 30430603 551d1f04 3c303a30
38a036a0 34863268 7474703a 2f2f7777 772e6369 73636f2e 636f6d2f 73656375
72697479 2f706b69 2f63726c 2f637263 61323034 382e6372 6c305006 082b0601
05050701 01044430 42304006 082b0601 05050730 02863468 7474703a 2f2f7777
772e6369 73636f2e 636f6d2f 73656375 72697479 2f706b69 2f636572 74732f63
72636132 3034382e 63657230 5c060355 1d200455 30533051 060a2b06 01040109
15010200 30433041 06082b06 01050507 02011635 68747470 3a2f2f77 77772e63
6973636f 2e636f6d 2f736563 75726974 792f706b 692f706f 6c696369 65732f69
6e646578 2e68746d 6c305e06 03551d25 04573055 06082b06 01050507 03010608
2b060105 05070302 06082b06 01050507 03050608 2b060105 05070306 06082b06
01050507 0307060a 2b060104 0182370a 0301060a 2b060104 01823714 02010609
2b060104 01823715 06300d06 092a8648 86f70d01 01050500 03820101 0030f330
2d8cf2ca 374a6499 24290af2 86aa42d5 23e8a2ea 2b6f6923 7a828e1c 4c09cfa4
4fab842f 37e96560 d19ac6d8 f30bf5de d027005c 6f1d91bd d14e5851 1dc9e3f7
38e7d30b d168be8e 22a54b06 e1e6a4aa 337d1a75 ba26f370 c66100a5 c379265b
a719d193 8dab9b10 11291fa1 82fdfd3c 4b6e65dc 934505e9 af336b67 23070686
22daebdc 87cf5921 421ae9cf 707588e0 243d5d7d 4e963880 97d56ff0 9b71d8ba
6019a5b0 6186addd 6566f6b9 27a2ee2f 619bbaa1 3061fdbe ac3514f9 b82d9706
afc3ef6d cc3d3ceb 95e981d3 8a5eb6ce fa79a46b d7a25764 c43f4cc9 dbe882ec
0166d410 88a256e5 3c57ede9 02a84891 6307ab61 264b1a13 9fe4dcda 5f
quit
crypto ca certificate chain CAP-RTP-001
certificate ca 7612f960153d6f9f4e42202032b72356
308203a8 30820290 a0030201 02021076 12f96015 3d6f9f4e 42202032 b7235630
0d06092a 864886f7 0d010105 0500302e 31163014 06035504 0a130d43 6973636f
20537973 74656d73 31143012 06035504 03130b43 41502d52 54502d30 3031301e
170d3033 30323036 32333237 31335a17 0d323330 32303632 33333633 345a302e
31163014 06035504 0a130d43 6973636f 20537973 74656d73 31143012 06035504
03130b43 41502d52 54502d30 30313082 0120300d 06092a86 4886f70d 01010105
00038201 0d003082 01080282 010100ac 55bbed18 de9b8709 ffbc8f2d 509ab83a
21c1967f dea7f4b0 969694b7 80cc196a 463da516 54a28f47 5d903b5f 104a3d54
a981389b 2fc7ac49 956262b8 1c143038 5345bb2e 273fa7a6 46860573 ce5c998d
55de78aa 5a5cfe14 037d695b ac816409 c6211f0b 3bbf09cf b0bbb2d4 ac362f67
0fd145f1 620852b3 1f07e2f1 aa74f150 367632ed a289e374 af0c5b78 ce7dfb9f
c8ebbe54 6ecf4c77 99d6dc04 47476c0f 36e58a3b 6bcb24d7 6b6c84c2 7f61d326
be7cb4a6 60cd6579 9e1e3a84 8153b750 5527e865 423be2b5 cb575453 5aa96093
58b6a2e4 aa3ef081 c7068ec1 dd1ebdda 53e6f0d6 e2e0486b 109f1316 78c696a3
cfba84cc 7094034f c1eb9f81 931acb02 0103a381 c33081c0 300b0603 551d0f04
04030201 86300f06 03551d13 0101ff04 05300301 01ff301d 0603551d 0e041604
14e917b1 82c71fcf aca91b6e f4a9269c 70ae05a0 9a306f06 03551d1f 04683066
3064a062 a060862d 68747470 3a2f2f63 61702d72 74702d30 30312f43 65727445
6e726f6c 6c2f4341 502d5254 502d3030 312e6372 6c862f66 696c653a 2f2f5c5c
6361702d 7274702d 3030315c 43657274 456e726f 6c6c5c43 41502d52 54502d30
30312e63 726c3010 06092b06 01040182 37150104 03020100 300d0609 2a864886
f70d0101 05050003 82010100 ab64fdeb f60c32dc 360f0e10 5fe175fa 0d574ab5
02acdca3 c7bbed15 a4431f20 7e9286f0 770929a2 17e4cdf4 f2629244 2f3575af
e90c468c ae67ba08 aaa71c12 ba0c0e79 e6780a5c f814466c 326a4b56 73938380
73a11aed f9b9de74 1195c48f 99454b8c 30732980 cd6e7123 8b3a6d68 80b97e00
7f4bd4ba 0b5ab462 94d9167e 6d8d48f2 597cde61 25cfadcc 5bd141fb 210275a2
0a4e3400 1428ba0f 69953bb5 50d21f78 43e3e563 98bcb2b1 a2d4864b 0616bacd
a61cd9ae c5558a52 b5eeaa6a 08f96528 b1804b87 d26e4aee ab7affe9 2fd2a574
bafe0028 96304a8b 13fb656d 8fc60094 d5a53d71 444b3cef 79343385 3778c193
74a2a6ce dc56275c a20a303d
quit
crypto ca certificate chain CAP-RTP-002
certificate ca 353fb24bd70f14a346c1f3a9ac725675
308203a8 30820290 a0030201 02021035 3fb24bd7 0f14a346 c1f3a9ac 72567530
0d06092a 864886f7 0d010105 0500302e 31163014 06035504 0a130d43 6973636f
20537973 74656d73 31143012 06035504 03130b43 41502d52 54502d30 3032301e
170d3033 31303130 32303138 34395a17 0d323331 30313032 30323733 375a302e
31163014 06035504 0a130d43 6973636f 20537973 74656d73 31143012 06035504
03130b43 41502d52 54502d30 30323082 0120300d 06092a86 4886f70d 01010105
00038201 0d003082 01080282 010100c4 266504ad 7dc3fd8d 65556fa6 308fae95
b570263b 575abd96 1cc8f394 5965d9d0 d8ce02b9 f808ccd6 b7cd8c46 24801878
57dc4440 a7301ddf e40fb1ef 136212ec c4f3b50f bcafbb4b cd2e5826 34521b65
01555fe4 d4206776 03368357 83932638 d6fc953f 3a179e44 67255a73 45c69dee
fb4d221b 21d7a3ad 38184171 8fd8c271 42183e65 09461434 736c77cc f380eebf
632c7b3f a5f92aa6 a8ef3490 8724a84f 4daf7fd7 0928f585 764d3558 3c0fe9af
1ed8763f a299a802 970004ad 1912d265 7de335b4 bcb6f789 dc68b9fa c8fdf85e
8a28ad8f 0f4883c0 77112a47 141dbee0 948fbe53 fe67b308 d40c8029 87bd790e
cdab9fd7 a190c1a2 a462c5f2 4a6e0b02 0103a381 c33081c0 300b0603 551d0f04
04030201 86300f06 03551d13 0101ff04 05300301 01ff301d 0603551d 0e041604
1452922b e288ee2e 098a4e7e 702c56a5 9ab4d49b 96306f06 03551d1f 04683066
3064a062 a060862d 68747470 3a2f2f63 61702d72 74702d30 30322f43 65727445
6e726f6c 6c2f4341 502d5254 502d3030 322e6372 6c862f66 696c653a 2f2f5c5c
6361702d 7274702d 3030325c 43657274 456e726f 6c6c5c43 41502d52 54502d30
30322e63 726c3010 06092b06 01040182 37150104 03020100 300d0609 2a864886
f70d0101 05050003 82010100 56838cef c4da3ad1 ea8fbb15 2ffe6ee5 50a1972b
d4d7af1f d298892c d5a2a76b c3462866 13e0e55d dc0c4b92 5aa94b6e 69277f9b
fc73c697 11266e19 451c0fab a55e6a28 901a48c5 b9911ee6 348a8920 0aede1e0
b6ea781c ffd97ca4 b03c0e34 0e5b0649 8b0a34c9 b73a654e 09050c1f 4da53e44
bf78443d b08c3a41 2eeeb873 78cb8089 34f9d16e 91512f0d 3a8674ad 0991ed1a
92841e76 36d7740e cb787f11 685b9e9d 0c67e85d af6d05ba 3488e86d 7e2f7f65
6918de0f bd3c7f67 d8a33f70 9c4a596e d9f62b3b 1edee854 d5882ad4 3d71f72b
8fab7f3c 0b5f0759 d9828f83 954d7bb1 57a638ec 7d72bff1 8933c16f 760bca94
4c5b1931 67947a4f 89a1bdb5
quit
crypto ca certificate chain Pubcucm_tftp_server
certificate 24a5b649
308201f3 3082015c a0030201 02020424 a5b64930 0d06092a 864886f7 0d010104
0500303e 313c3012 06035504 05130b4a 4d583131 31375a31 42423026 06092a86
4886f70d 01090216 19617361 2d70702d 6e6f6e2e 63726463 2e636973 636f2e63
6f6d301e 170d3039 30333130 31373336 33365a17 0d313930 33303831 37333633
365a303e 313c3012 06035504 05130b4a 4d583131 31375a31 42423026 06092a86
4886f70d 01090216 19617361 2d70702d 6e6f6e2e 63726463 2e636973 636f2e63
6f6d3081 9f300d06 092a8648 86f70d01 01010500 03818d00 30818902 818100b1
86797193 9857a801 69a09b1b 10c8c7c1 82177a3f 2960abe3 0ccf1b91 09b4313c
7eb7be71 247e9613 ee525415 d06ea780 61806776 02cbcf5d fdb26b45 19032d14
6caf5377 0561515d 35835304 9ae29fe0 3adba7b8 4310fc54 67cf55d1 e8b19205
da83329e d25553df 970978d7 e9d5abdd d85e525a ab531ee0 cac31a39 1766eb02
03010001 300d0609 2a864886 f70d0101 04050003 818100a8 fc8a375a da45dc71
2be31558 0237eaf8 154c496c 7f415953 9ab75310 b82c727b 80c28a74 de5e9359
e92f97e7 3e9bc28b 56d93d0c a34c308a dc95daf4 63c99e08 baf3d18d a3d98f93
7970dc9f 0c61a7e9 4b3eb8fb a2310870 f36fbae3 e9cd2ffc 0c74c13b ff7b6b95
2e6a7bee 6ce8a2cc 3a79c4f2 376960ce be23d65c 873d4a
quit
crypto ca certificate chain _internal_myctl_SAST_1
certificate 4614284b
308201fd 30820166 a0030201 02020446 14284b30 0d06092a 864886f7 0d010104
05003043 31123010 06035504 0a130943 6973636f 20496e63 310c300a 06035504
0b130353 5447311f 301d0603 55040314 165f696e 7465726e 616c5f6d 7963746c
5f534153 545f3130 1e170d30 39313231 35323235 3731305a 170d3139 31323133
32323537 31305a30 43311230 10060355 040a1309 43697363 6f20496e 63310c30
0a060355 040b1303 53544731 1f301d06 03550403 14165f69 6e746572 6e616c5f
6d796374 6c5f5341 53545f31 30819f30 0d06092a 864886f7 0d010101 05000381
8d003081 89028181 00c79482 a1874081 a454cbd1 4dfaf5f3 2338d123 d5cf25e4
8aa352d2 edb56c0c a5456e00 4620beaf bc129d7e f4ad266b 6bdd4509 68313524
ad479e00 d4fbdf8d 505248b8 555b11f1 469157d0 303a4e32 4b5d6864 8806fb74
e67ae364 9ea9a92b 83a5a3fd b214cea3 46bed2f1 dc4f26fa fef382f9 541182ab
d0708d23 d6add1b7 7d020301 0001300d 06092a86 4886f70d 01010405 00038181
00611f4a 2483388a cd6b25ad d9553d95 28a5c03b ab21ca7e 0792dd95 1b6904ea
cfbd1ce8 abcf776a a60e2dca 3a29c5ab ea6d05ce cac14ce7 9d19b366 5619897f
98958f89 ebfc1411 4377bc66 915c2614 956bbab0 01199d1b 9763e4a0 421acf15
1f6c74ad c942c5e2 4a3915b7 4926e12f 93841dcf bcf1a03e 02d3923f ccf9c1fb 40
quit
crypto ca certificate chain _internal_myctl_SAST_0
certificate 4214284b
308201fd 30820166 a0030201 02020442 14284b30 0d06092a 864886f7 0d010104
05003043 31123010 06035504 0a130943 6973636f 20496e63 310c300a 06035504
0b130353 5447311f 301d0603 55040314 165f696e 7465726e 616c5f6d 7963746c
5f534153 545f3030 1e170d30 39313231 35323235 3730365a 170d3139 31323133
32323537 30365a30 43311230 10060355 040a1309 43697363 6f20496e 63310c30
0a060355 040b1303 53544731 1f301d06 03550403 14165f69 6e746572 6e616c5f
6d796374 6c5f5341 53545f30 30819f30 0d06092a 864886f7 0d010101 05000381
8d003081 89028181 009923e3 0fe633ea 1d6bb81e 5548b020 662a85c7 341b16ef
8c717adc f53dd5d5 805e4cc1 0de07216 ad57e1d6 292b1f6c a8721abf 02f96191
2c6274c7 8384ab50 38a6173b baa57f20 4c395880 38266645 7811a666 a36a0676
a0f4c82f a5c389a7 fe0d620c d3621b5c bf0aaf7f 081781d6 85c2f699 f11af8d4
bbf08443 d7fb255d 9d020301 0001300d 06092a86 4886f70d 01010405 00038181
0039aeff 5c3a5866 b1f9b5f4 01838e68 a7dbf5a6 fffda11f 3040767a b60d839f
d81a3b01 6bd079a3 7a446aa9 826ab8a4 e12ab2e0 45ea8a92 e0524e42 87bdc4cb
30198001 4c24c601 5d12a418 1f68806f bd250838 21723156 79276b68 449557e0
405de059 91a45e02 5ed6f96c 62d376ca 3480fa63 c17b3d20 5edfe380 882f73cc 77
quit
crypto ca certificate chain _internal_PP_myctl
certificate 4a14284b
308201f5 3082015e a0030201 0202044a 14284b30 0d06092a 864886f7 0d010104
0500303f 31123010 06035504 0a130943 6973636f 20496e63 310c300a 06035504
0b130353 5447311b 30190603 55040314 125f696e 7465726e 616c5f50 505f6d79
63746c30 1e170d30 39313231 35323235 3731345a 170d3139 31323133 32323537
31345a30 3f311230 10060355 040a1309 43697363 6f20496e 63310c30 0a060355
040b1303 53544731 1b301906 03550403 14125f69 6e746572 6e616c5f 50505f6d
7963746c 30819f30 0d06092a 864886f7 0d010101 05000381 8d003081 89028181
00e04e0a bba67d66 515c3ac8 0eea9e81 f1707049 123e9379 a750cc40 d0bc782e
7a41c1a6 e31e12df ee2f2122 adc04f47 541facc6 0abc1b91 b739fc45 2e6f7938
45a33010 3dc7ed31 41f0e5d6 a702cef9 a3404246 fbc3fdbd fce49764 cc639b6e
8a7d618a 57f1f63b ca4d2049 68d6ee3a fd993b0f 5b8dfef6 24a0b214 d94cce43
65020301 0001300d 06092a86 4886f70d 01010405 00038181 009f8e8a 476d5880
8648ee24 61ca25ab 9ddb375b 56ec16e1 fca53b6c 79d2a336 24e98ebb 48ba9e7a
bf063123 0b22101a e34039b5 e3717561 dc4a65eb 35345fa3 e55b5597 ce861648
d8cf7b5a 785a689e 3c69dc35 c45a29c6 c8b4c488 047687b2 101bae3d c6bda2c7
a1f16afb 95409a37 607ca103 3f97bffc fa34dbc3 8f709c53 f8
quit
telnet 10.74.32.0 255.255.224.0 inside
telnet 100.100.0.0 255.255.0.0 inside
telnet 8.8.8.240 255.255.255.240 outside
telnet timeout 1440
ssh timeout 5
console timeout 0
dhcpd address 100.100.8.20-100.100.8.29 inside
dhcpd option 15 ascii crdc.cisco.com interface inside
dhcpd option 6 ip 10.74.53.182 interface inside
dhcpd option 150 ip 100.100.8.14 interface inside
dhcpd option 3 ip 100.100.8.19 interface inside
dhcpd enable inside
!

!
tls-proxy mytls
server trust-point _internal_PP_myctl
ctl-file myctl
record-entry cucm-tftp trustpoint Pubcucm_tftp_server address 100.100.8.14
no shutdown
!
media-termination mediaterm1
address 100.100.8.30

!
phone-proxy myphoneproxyasa
media-termination mediaterm1
tftp-server address 100.100.8.14 interface outside
tls-proxy mytls
ctl-file myctl
threat-detection basic-threat
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
ssl encryption null-sha1 rc4-sha1 aes128-sha1 aes256-sha1 3des-sha1
webvpn
!
class-map sec_sip
match port tcp eq 5061
class-map sec_sccp
match port tcp eq 2443
class-map inspection_default
match default-inspection-traffic
!
!
policy-map type inspect dns preset_dns_map
parameters
message-length maximum 512
policy-map Augustone
class inspection_default
inspect rsh
inspect rtsp
inspect esmtp
inspect sqlnet
inspect sunrpc
inspect xdmcp
inspect netbios
inspect icmp
inspect ftp
inspect h323 h225
inspect h323 ras
inspect skinny
inspect sip
policy-map pp_policy
class sec_sccp
inspect skinny phone-proxy myphoneproxyasa
class sec_sip
inspect sip phone-proxy myphoneproxyasa
!
service-policy pp_policy interface inside
prompt hostname context
Cryptochecksum:4572e35dd20b9193b8940c23f82f5b07
: end
asa-pp-non#
asa-pp-non#
asa-pp-non#
asa-pp-non#

参考链接

Cisco ASA Phone Proxy Configuration
7 Easy Steps to setup Cisco ASA Phone
ASA Phone Proxy sample configuration in 8.0

 

在Asterisk 1.6 上安装TE110P

所谓五分钟热度或者热情澎湃大概描述的就是我.在Asterisk1.6上安装X100P的成功,让我领略到了VoIP-PSTN的美妙,也促使我想进一步尝试更加企业级的T1/E1-VoIP的念头.说做就做,马上去淘宝上买了一块TE110P,装上电脑,马上安装起来.
注意,本文是在在Asterisk1.6上安装X100P的基础上进行的,所以没有完整的安装过程,只有每个步骤的结果和错误的总结.有问题的可以参考前文.


Step 1 硬件安装
这次学乖了.先从底层硬件驱动开始安装.开机以后直接运行dahdi_cfg,结果如下.

$ dahdi_cfg -vv
DAHDI Tools Version - 2.2.0
Notice: Configuration file is /etc/dahdi/system.conf
line 0: Unable to open master device '/dev/dahdi/ctl'
1 error(s) detected

运行asterisk,察看dahdi的status和channels情况,结果如下.

*CLI> dahdi show status
Description Alarms IRQ bpviol CRC4 Fra Codi Options LBO
Digium Wildcard TE110P T1/E1 Card 0 UNCONFI 0 0 0 CAS Unk YEL 0 db (CSU)/0-133 feet (DSX-1)
*CLI> dahdi show channels
Chan Extension Context Language MOH Interpret Blocked State
pseudo default default In Service

基本情况完全一样,除了dahdi show status显示的板卡名称变成了Digium Wildcard TE110P T1/E1 Card(娃哈哈,企业级啊-,-b).
需要注意的是这台机器我成功的安装了DAHDI Complete,所以/etc/dahdi/modules的内容略有不同,所有的板卡代号都有,具体如下.

bash$ cat /etc/dahdi/modules
# Contains the list of modules to be loaded / unloaded by /etc/init.d/dahdi.
#
# NOTE: Please add/edit /etc/modprobe.d/dahdi or /etc/modprobe.conf if you
# would like to add any module parameters.
#
# Format of this file: list of modules, each in its own line.
# Anything after a '#' is ignore, likewise trailing and leading
# whitespaces and empty lines.
# Digium TE205P/TE207P/TE210P/TE212P: PCI dual-port T1/E1/J1
# Digium TE405P/TE407P/TE410P/TE412P: PCI quad-port T1/E1/J1
# Digium TE220: PCI-Express dual-port T1/E1/J1
# Digium TE420: PCI-Express quad-port T1/E1/J1
wct4xxp
# Digium TE120P: PCI single-port T1/E1/J1
# Digium TE121: PCI-Express single-port T1/E1/J1
# Digium TE122: PCI single-port T1/E1/J1
wcte12xp
# Digium T100P: PCI single-port T1
# Digium E100P: PCI single-port E1
wct1xxp
# Digium TE110P: PCI single-port T1/E1/J1
wcte11xp
# Digium TDM2400P/AEX2400: up to 24 analog ports
# Digium TDM800P/AEX800: up to 8 analog ports
# Digium TDM410P/AEX410: up to 4 analog ports
wctdm24xxp
# X100P - Single port FXO interface
# X101P - Single port FXO interface
wcfxo
# Digium TDM400P: up to 4 analog ports
wctdm
# Digium B410P: 4 NT/TE BRI ports
wcb4xxp
# Digium TC400B: G729 / G723 Transcoding Engine
wctc4xxp
# Xorcom Astribank Devices
xpp_usb

修复Error的方法照旧,将/etc/modprobe.d/dahdi.blacklist中wcte11xp那行去掉,重新运行/etc/init.d/dahdi,结果如下.

xiuxiu@sh-c2-pc:/etc/dahdi$ sudo /etc/init.d/dahdi start
Loading DAHDI hardware modules:
WARNING: All config files need .conf: /etc/modprobe.d/dahdi.blacklist, it will be ignored in a future release.
WARNING: All config files need .conf: /etc/modprobe.d/dahdi, it will be ignored in a future release.
wct4xxp: done wcte12xp: done wct1xxp: done wcte11xp: done wctdm24xxp: done wcfxo: done wctdm: done wcb4xxp: done wctc4xxp: done xpp_usb: done
Running dahdi_cfg: done.
xiuxiu@sh-c2-pc:/etc/dahdi$ sudo dahdi_cfg -vv
DAHDI Tools Version - 2.2.0
DAHDI Version: 2.2.0.2
Echo Canceller(s): MG2
Configuration
======================
SPAN 1: CCS/HDB3 Build-out: 0 db (CSU)/0-133 feet (DSX-1)
Channel map:
Channel 01: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 01)
Channel 02: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 02)
Channel 03: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 03)
Channel 04: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 04)
Channel 05: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 05)
Channel 06: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 06)
Channel 07: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 07)
Channel 08: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 08)
Channel 09: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 09)
Channel 10: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 10)
Channel 11: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 11)
Channel 12: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 12)
Channel 13: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 13)
Channel 14: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 14)
Channel 15: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 15)
Channel 16: D-channel (Default) (Echo Canceler: none) (Slaves: 16)
Channel 17: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 17)
Channel 18: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 18)
Channel 19: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 19)
Channel 20: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 20)
Channel 21: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 21)
Channel 22: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 22)
Channel 23: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 23)
Channel 24: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 24)
Channel 25: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 25)
Channel 26: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 26)
Channel 27: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 27)
Channel 28: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 28)
Channel 29: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 29)
Channel 30: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 30)
Channel 31: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 31)
31 channels to configure.
Setting echocan for channel 1 to mg2
Setting echocan for channel 2 to mg2
Setting echocan for channel 3 to mg2
Setting echocan for channel 4 to mg2
Setting echocan for channel 5 to mg2
Setting echocan for channel 6 to mg2
Setting echocan for channel 7 to mg2
Setting echocan for channel 8 to mg2
Setting echocan for channel 9 to mg2
Setting echocan for channel 10 to mg2
Setting echocan for channel 11 to mg2
Setting echocan for channel 12 to mg2
Setting echocan for channel 13 to mg2
Setting echocan for channel 14 to mg2
Setting echocan for channel 15 to mg2
Setting echocan for channel 16 to none
Setting echocan for channel 17 to mg2
Setting echocan for channel 18 to mg2
Setting echocan for channel 19 to mg2
Setting echocan for channel 20 to mg2
Setting echocan for channel 21 to mg2
Setting echocan for channel 22 to mg2
Setting echocan for channel 23 to mg2
Setting echocan for channel 24 to mg2
Setting echocan for channel 25 to mg2
Setting echocan for channel 26 to mg2
Setting echocan for channel 27 to mg2
Setting echocan for channel 28 to mg2
Setting echocan for channel 29 to mg2
Setting echocan for channel 30 to mg2
Setting echocan for channel 31 to mg2

OK.到了这里硬件驱动安装部分就应该没问题了.

Step 2 配置Asterisk
因为换了一台机器,所以需要在chan_dahdi.conf中加入如下语句.

#include dahdi-channels.conf

重新运行asterisk,察看结果.

*CLI> dahdi show status
Description Alarms IRQ bpviol CRC4 Fra Codi Options LBO
Digium Wildcard TE110P T1/E1 Card 0 RED 1 0 0 CCS HDB3 CRC4 0 db (CSU)/0-133 feet (DSX-1)
*CLI> 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-pstn default In Service
4 from-pstn default In Service
5 from-pstn default In Service
6 from-pstn default In Service
7 from-pstn default In Service
8 from-pstn default In Service
9 from-pstn default In Service
10 from-pstn default In Service
11 from-pstn default In Service
12 from-pstn default In Service
13 from-pstn default In Service
14 from-pstn default In Service
15 from-pstn default In Service
17 from-pstn default In Service
18 from-pstn default In Service
19 from-pstn default In Service
20 from-pstn default In Service
21 from-pstn default In Service
22 from-pstn default In Service
23 from-pstn default In Service
24 from-pstn default In Service
25 from-pstn default In Service
26 from-pstn default In Service
27 from-pstn default In Service
28 from-pstn default In Service
29 from-pstn default In Service
30 from-pstn default In Service
31 from-pstn default In Service
*CLI>

OK了.到了这里Te110P的E1 PRI线路就通了.你可以配置自己的dial plan,然后修改dahdi-channels.conf中的配置来导入E1线路.Oh yeah~
问题总结
1.无法拨通,Asterisk本身没有debug信息.察看log,发现

ERROR[2077] chan_dahdi.c: Unknown signalling method 'pri_cpe' at line 14.

解决方案:主要原因是你的libpri没有安装好.重新下一个最新的libpri版本重新编译安装,应该就会好.


2.Asterisk有debug信息.但是无法默认接入Default Dialplan,听到”Welcome…”的语音.
主要是被X100P宠坏了,认为就应该直接可以拨入default的dialplan. 修改/etc/asterisk/dahdi-channels.conf,将context从from-pstn修改成default就可以了.

 

在Asterisk1.6上安装X100P

玩Asterisk有一段时间了,于是想在ethernet的基础上接触一下Analog, T1/E1方面的内容,也算是对本身工作的一种补充.
X100P是Asterisk入门级的FXO卡(其实就是最便宜板型中最便宜的一款-,-),热血沸腾了一把就在淘宝上花了100元买了一块.
网上X100P安装配置的文章很多,不过大多数都是基于Asterisk1.4之前的版本,使用Zaptel.而Asterisk之后使用的是DAHDI,所以配置上有一些差异,这让我着实费了一些功夫,也让我决心把我的安装过程写下来.
DAHDI与Zaptel配置文件的对应关系

/etc/zaptel.conf <-> /etc/dahdi/system.conf
/etc/asterisk/zapata.conf <-> /etc/asterisk/chan_dahdi.conf

Step 0 前提
软件要求:

sudo apt-get install cvs make gcc g++ libncurses5-dev libssl-dev zlib1g-dev make build-essential libxml2-dev

硬件要求:当然是把X100P插好咯.-,-


Step 1 安装libpri

wget http://downloads.asterisk.org/pub/telephony/libpri/releases/libpri-1.4.10.2.tar.gz
tar zxvf libpri-1.4.10.2.tar.gz
cd libpri-1.4.10.2
sudo make; sudo make install

Step 2 安装DAHDI Linux 和 DAHDI Tools

wget http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases/dahdi-linux-2.2.1.tar.gz
tar zxvf dahdi-linux-2.2.1.tar.gz
cd dahdi-linux-2.2.1
sudo make;sudo make install


wget http://downloads.asterisk.org/pub/telephony/dahdi-tools/releases/dahdi-tools-2.2.1.tar.gz
tar zxvf dahdi-tools-2.2.1.tar.gz
cd dahdi-tools-2.2.1
sudo make;sudo make install
sudo make config

这步作完系统会提示发现DAHDI设备

install -D dahdi.init /etc/init.d/dahdi
/usr/sbin/update-rc.d dahdi defaults 15 30
System start/stop links for /etc/init.d/dahdi already exist.
DAHDI has been configured.
List of detected DAHDI devices:
pci:0000:01:02.0 wcfxo+ 1057:5608 Wildcard X100P
run 'dahdi_genconf modules' to load support for only
the DAHDI hardware installed in this system. By
default support for all DAHDI hardware is loaded at
DAHDI start.

Step 3 运行dahdi_genconf
上一步作完以后提示你运行这个命令.这也是dahdi和zaptel的一个比较大的不同.在dahdi中,dahdi_genconf会根据侦测到的dahdi设备自动为你进行配置.涉及到的配置文件包括以下几个.


/etc/dahdi/modules

# Autogenerated by /usr/sbin/dahdi_genconf (Dahdi::Config::Gen::Modules) on Fri Jan 22 06:45:44 2010
# If you edit this file and execute /usr/sbin/dahdi_genconf again,
# your manual changes will be LOST.
wcfxo

/etc/dahdi/system.conf

# Autogenerated by /usr/sbin/dahdi_genconf on Fri Jan 22 12:45:37 2010
# If you edit this file and execute /usr/sbin/dahdi_genconf again,
# your manual changes will be LOST.
# Dahdi Configuration File
#
# This file is parsed by the Dahdi Configurator, dahdi_cfg
#
# Span 1: WCFXO/0 "Wildcard X100P Board 1" (MASTER)
fxsks=1
echocanceller=mg2,1
# Global data
loadzone = us
defaultzone = us

如果你是在国内使用,请将上面的loadzone和 defaultzone修改成cn.


/etc/asterisk/dahdi_channels.conf

; Autogenerated by /usr/sbin/dahdi_genconf on Fri Jan 22 12:45:37 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: WCFXO/0 "Wildcard X100P Board 1" (MASTER)
;;; line="1 WCFXO/0/0 FXSKS (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
channel => 1
callerid=
group=
context=default

按照注释说明,dahdi_channels.conf是dahdi_genconf自动生成的.包含dahdi设备需要的默认信息.然后是希望用户在才chan_dahdi.conf中include这个file的.
实际情况是,网上的帖子基本都是实际在chan_dahdi.conf中修改完事的.没人理睬这个file.我一开始配置的时候也是这么做的.直到写这篇博客的时候重读注释才发现了这个问题.其实只要简单的做下面这一步就OK了.


修改/etc/asterisk/chan_dahdi.conf,在末尾加上如下语句

#include dahdi-channels.conf

Step 4 安装Asterisk

wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.6.2.1.tar.gz
tar zxvf asterisk-1.6.2.1.tar.gz
cd asterisk-1.6.2.1
sudo ./configure;

这步会帮你检查Asterisk需要的Library,理论上按照Step 0的话这便会顺利通过.如果你需要额外的Function(例如curl,postgresql)的话,可以在这边获得相应的提示.

sudo make
sudo make install
sudo make samples

运行Asterisk
好了.验收成果的时候来了.

sudo asterisk -vvvvc
.....
*CLI>

Asterisk启动成功.然后查看一下硬件状况.

dahdi show status
Description Alarms IRQ bpviol CRC4 Fra Codi Options LBO
Wildcard X100P Board 1 OK 0 0 0 CAS Unk YEL 0 db (CSU)/0-133 feet (DSX-1)
*CLI>

可以看到Asterisk已经读到了我的X100P.然后查看一下dahdi channels的情况.

*CLI> dahdi show channels
Chan Extension Context Language MOH Interpret Blocked State
pseudo default default In Service
1 from-pstn default In Service
*CLI>

其中”1″就是我们新添加的Dahdi Channel.
注意,如果你板卡检测到了但是Channel没有显示,很可能是chan_dahdi.conf的配置问题.


一切都OK了.连上电话线,给自己打一个电话吧.默认配置就可以听到美丽的”Welcome to Open Source PBX Asterisk…”.
问题一
使用DAHDI Complete Source Tarball编译失败.
解决办法:说实话这个问题很诡异,因为之前都没有问题.我的解决办法就是使用DAHDI Linux Source Tarball和DAHDI Tools Source Tarball分别编译安装,就没有这个问题了.
问题二

bash$ dahdi_cfg
Notice: Configuration file is /etc/dahdi/system.conf
line 0: Unable to open master device '/dev/dahdi/ctl'
1 error(s) detected

解决办法:修改 /etc/modprobe.d/dahdi.blacklist.去掉wcfxo这行.该文件是用于禁止加载某一类型的dahdi驱动的,默认禁止所有类型.

参考链接
配置X100P卡详细步骤
X100P安装手册 (转)
ASTERISK1.4.0+REDHAT9.0+X100P安装
Trixbox下使用x100p卡做FXO通道外呼的实现DAHDI配置文件与zaptel的差别

 

Asterisk conntected with 7962G

之前比较偷懒,通过sip trunk连接CUCM和Asterisk,实现了7962G->CUCM->Asterisk->Xlite这样一个方案. 现在直接配置7962G和Asterisk进行连接,遇到了各种各样怪异的问题,才发现这实在是不容易.写个步骤下来,不然自己都怕忘记.
Step 1 下载7962G SIP Firmware Image
如果你有CCO帐号,可以直接访问http://www.cisco.com/cgi-bin/tablebuild.pl/ip-7900ser,获取相应的Image文件,注意后缀名是cop.
cop文件其实是一个tar压缩文件,修改后缀名以后可以打开了.注意其中有一个xxxxx.loads的文件.xxxxxx代表的就是当前Firmware Image的版本号.
Step 2 下载配置文件
我已经把配置文件模板放在了我的网站上,可以通过configs下载,其中包含三个文件.

  • XMLDefault.cnf.xml:默认配置文件,其中是各个型号Phone的默认版本号.
  • dialplan.xml:顾名思义,dialplan配置文件.默认情况下不需要配置.
  • SEPXXXX.cnf.xml:Phone的配置文件,

Step 3 配置XMLDefault.cnf.xml
打开XMLDefault.cnf.xml,添加下面的语句

<loadInformation5 model="Cisco 7962">SIP42.9-0-2S</loadInformation5>

标签中的内容就是之前Firmware Image的版本号.

Step 4 添加sip帐号
如果是Trixbox应该可以自动在界面添加,我用的是纯Asterisk(-,-),修改sip.conf

[555]
type=friend
secret=555
callerid="555"
host=100.100.3.85
nat=no
qualify=yes
canreinvite=no ; Typically set to NO if behind NAT
disallow=all
allow=gsm ; GSM consumes far less bandwidth than G711-u (ulaw)
allow=ulaw
allow=alaw
context=cloud

Step 5 配置SEPXXXX.cnf.xml
这是最主要的配置部分,具体的reference可以参考
http://www.voip-info.org/wiki/index.php?page_id=3242
首先要把该文件名中的XXXX用Phone的Mac地址替换,例如修改成SEP001B2C24CC.cnf.xml.
然后打开该文件,有几个地方需要修改.

  • ipAddr1:修改成Asterisk的IP
  • sipIpAddr1:修改成Asterisk的IP
  • backupProxy:修改成Asterisk的IP
  • emergencyProxy:修改成Asterisk的IP
  • outboundProxy:修改成Asterisk的IP
  • line::proxy:修改成Asterisk的IP
  • line::featureLabel:sip帐号的显示名称
  • line::authName:sip帐号的用户名
  • line::authPassword:sip帐号的secret
  • loadInformation:Firmware Image的版本号

另外每个line都代表了一个号码,可以按照需要自己添加或者删除.
Step 5 搭建TFTP Server
我用的是Ubuntu的tftpd,简单方便,这里就不多说了.
把cop文件解药后的所有文件以及三个配置文件都放到tftp的folder下.
Step 6 运行起来
最后要做的就是让Phone通过tftp下载这些Firmware Image, Configuration File.
可以用的方法主要有两种:
1)修改DHCP,在dhcpd.conf中添加如下语句

option tftp-server-addr 100.100.3.70;

2)通过Phone->Settings->Network Configuration->IPv4 Configuration,按”**#”解除锁.修改”Alternative TFTP”设置成”Yes”,修改”TFTP Server”成你TFTP Server的IP地址.

怎么样,试试看?让你的Cisco TNP Phones连接Asterisk吧.同样的办法我也把7975G连上了,打电话肯定没问题,ohyeah.

F&Q:
Q1:Phone在Registering这步就走不下去了怎么办?
A1:在sip.conf中配置”nat=never”,把SEPXXX.cnf.xml中sipProxies中各个标签的内容都设置成空,应该就没问题了.
Q2:Unable to create channel of type ‘SIP’ (cause 20 – Unknown) ?
A2:可能的问题是你把sipProxies中内容全部删除了,其实是标签留着,内容删除.或者在sip.conf中将host设置成静态IP也可以.
Q3:有噪音怎么办?
Q3:我解决的办法是删除sip.conf中”dtmfmode=rfc2833″.

参考链接:http://www.asterisktutorials.com/cisco-7970-ip-phone/
参考链接:http://www.greenwireit.com/blog/2008/12/a-guide-a-faq-how-to-unbrick-the-cisco-7970g/

 

基于Trixbox的HUDLite客户端和服务器端的安装

Trixbox的Wiki上是这么描述HUDlite的.

The new HUDlite client is a very cool piece of technology, with HUDLite you can see the status of all of the extensions on your phone system and know at a glance if someone is busy or available. The new version of HUDlite takes this further and adds instant messaging so you can text chat with everyone which adds to everyone’s productivity. HUDlite also adds new Outlook connectivity so you can dial from within Outlook and incoming calls are compared to your Outlook contacts so you know who is calling you.

个人体验下来, HUDLite作为一种新的SoftPhone Application,很好的整合了Phone,IM甚至Outlook Contact等若干通讯方式.统一通讯解决方案一直是我的研究学习方向,HUDLite正对我的胃口,二话不说,动手安装.

HUDLite服务端的安装
HUDLite安装参考:http://www.trixbox.org/hudlite-setup-guide
HUDLite与Trixbox的集成非常的方便,如果你的Trixbox能够连接互联网的话,按照上面Link中的方法通过几步设置就可以实现了.我的Trixbox放在内网,主要的区别就是需要自己下载安装用的rpm,没办法享受Trixbox的福利了.下面就是我的具体安装步骤.

HUDLite服务端的安装文件:http://yum.trixbox.org/centos/5/RPMS/repodata/repoview/
1)下载安装文件.在上面的连接中寻找hudlite-server和tbm-hudadmin两个安装包,下载到本地.
2)将安装文件上传到Trixbox上,通过rpm安装.

rpm -ivh *.rpm

3)访问http://IP/maint/(默认帐号密码:maint/password),这时候左上方Server Status中HUD Server的指示条已经变成了绿色.选择PBX->Hudlite Admin. HUDLite Server会自动为每个用户生成一个随机的密码,你可以按照自己的需求进行修改,例如用户sip200,密码sip200.

OK,服务端的设置这样就搞定了.下面就是客户端.

HUDLite客户端的安装
HUDLite客户端:http://www.hudlite.org/downloads.htm
1)客户端安装.HUDLite为各种平台都提供了相应的客户端程序.按照上面的连接下载适合你电脑的客户端,点击安装.
2)客户端配置.第一次HUDLite客户端安装好以后会提示你配置客户端,相关的参数含义如下

  • Username:用户名,例如Sip200
  • Password:密码,HUDLite Server默认自动生成,也可以在服务端修改,例如sip200
  • Server Name: Trixbox服务器IP
  • Server Password: 就是’Password’
  • Server Port: 6600

就这些了,运行HUDLite Client,很酷的界面(-,-anyway),可以看到其他Extension的状况.如果你选择安装了TAPI功能,可以直接拨打其他用户或者发送message. 期待它的后续进展.

 

Adhearsion初体验

我是偶尔在Asterisk: The Future of Telephony上看到Adhearsion的介绍的.以下是摘自Adhearsion主页http://adhearsion.com/的一段对Adhearsion的定义.

Adhearsion is a new way to write voice-enabled applications. It's not just an API or library — it's a fully-featured framework, the first of its kind, designed for maximal code reuse and intuitiveness. The name "Adhearsion" is a combination of "adhesion" and "hear" because Adhearsion shines best when integrating technologies with voice.

简单的说就是基于Asterisk AGI,一套完整的应用于Voice Application的Ruby框架.VoIP Application + Ruby,还有什么比这个更适合我呢?二话不说,马上开始试用.
Adhearsion Getting Start


Adhearsion的主页还是非常的人性化的。不仅提供了完全免费,电话测试系统,使得你建立的Adhearsion应用可以方便的进行调试运行,还提供了多种Voice客户端的选择,包括Skype, 各种SIP Phones甚至In-browser Phone。按照下面的步骤,你可以轻松的建立你的第一个Adhearsion Application.
Step 1:注册Adhearsion帐号
默认会加入Adhearsion的Mailing List,不算很热闹,偶尔会有一些邮件。Adhearsion帐号同时也是电话系统的测试帐号,有了它你就可以连接到Adhearsion提供的SandBox上了.

Step 2:安装Ruby, RubyGems, Adhearsion
Ruby和Gems的安装就不多说了.安装Adhearsion也就是一句话的事情.感谢伟大的Ubuntu和RubyGems.

sudo gem install adhearsion

Step 3:创建你的第一个Adhearsion应用
类似Rails,Adhearsion会创建一整套基础部件,解决了类似Adhearsion服务器启动,停止等工作,使得你可以专心在Adhearsion应用的开发上.

ahn create my_first_app

Step 4:启用Sandbox Component
Adhearsion中有一个Component的概念.Component类似插件的意思,代表了一组功能的集合.所有的Components都放在my_first_app/components目录下.其中Sandbox就是一个包含了连接注册Adhearsion电话测试系统的Component.

cd my_first_app
ahn enable component sandbox

修改my_first_app/components/sandbox/sandbox.yml,按照你在Ahearsion注册的帐号密码修改该文件,这样你无需编写任何代码就可以连接注册到Adhearsion电话测试系统了.

username: xxxxxxx
password: xxxxxxx

Step 5:编写你的Adhearsion应用
打开my_first_app/dialplan.rb,添加如下代码:

sandbox {
play "hello-world"
}

sandbox代表的是Asterisk中规定的context,Adhearsion测试系统默认的context就是sandbox. play “hello-world”的意思就是播放”hello-world”的音频.简单的就好像说话一样-.-


Step 6:运行你的Adhearsion应用
直接通过ahn命令就可以运行你的adhearsion应用了.由于启用了sandbox component,你的应用会先去连接adhearsion测试系统进行登录注册,然后启动后台进程监听请求.

ahn start .



OK了,这就是Adhearsion全部需要做得了.测试一下吧.选一款你觉得最酷的soft phone,按照Ahdearsion的提示拨打电话,听到一声清脆的”Hello World”,你的Adhearsion蹦出一些log信息.看这就爽,你也快来试试看吧.

 

Asterisk与Call Manager的整合

几个月前就完成了这个工作。可是因为工作的需要,一直重装不同版本的Call Manager,然后再回头配置集成。痛定思痛,决定把过程写下来,自己找起来也方便。

Asterisk上的配置
Step 1 在sip.conf中添加如下配置,简单的说就是添加一个SIP User.

[callman01]
type=friend
context=xiuxiu
host=10.0.0.1
disallow=all
allow=ulaw
allow=alaw
nat=no
canreinvite=yes
qualify=yes


Step 2
在extensions.conf你需要用到Call Manager的Context按照如下方法使用。基本和普通的SIP User都是一样的,就是要对SIP Header稍微做一些处理。

[macro-dialout-callmanager]
exten => s,1,ChanIsAvail(SIP/callman02&SIP/callman01)
exten => s,2,Dial(${CUT(AVAILCHAN||1)}/${ARG1})
exten => s,3,Hangup
exten => s,102,Congestion
[outgoing]
exten => _XXXX,1,Macro(dialout-callmanager,${EXTEN})
exten => _9NXXXXXX,1,Macro(dialout-callmanager,${EXTEN})
exten => _91NXXNXXXXXX,1,Macro(dialout-callmanager,${EXTEN})
exten => i,1,Congestion

Call Manager上的配置
Step 1 配置 SIP Trunk
1)在菜单中选择 Device -> Trunk -> Add New
2)点”Add New”
3)选择Trunk Type: SIP Trunk, Device Protocol: SIP
4)选择Device Pool(默认的就可以), Destination Address: Asterisk服务器的地址

Step 2 修改 SIP Trunk Security Profile (我用的是CUCM 7.1,所以需要这个修改)
1)在菜单中选择System > Security Profile > SIP Trunk Security Profile
2)在列表中选择你之前填写的Security Profile
3)将Outgoing Transport Type修改成UDP

Step 3 配置Route Pattern
1)在菜单中选择Call/Routing -> Route/Hunt -> Route Pattern
2)点Add New
3)Route Pattern: 8XXX, Gateway/Route List: 之前创建的SIP Trunk(按照你的需求设置,例如这里就是8开头的四位电话号码转到Asterisk上)

OK,基本就这些了,用你的X Lite 给Call Manager打个电话吧。

参考地址:Asterisk Cisco CallManager Integration

 

Jabber与Asterisk的整合

虽然Skype风雨飘摇,但是它的成功不言而喻,一个小小的聊天软件居然还能打电话,酷阿。
 
前一段日子装了Openfire(Jabber),聊天的一套有了。
最近玩了Asterisk(PBX),能打电话了。
嗯,整整吧。
 
没办法,伟大的人总归想的都是一样的(-,-),
这方面的需求显然是非常炙热的,整合的办法也有很多种。
 
在Openfire中整合Asterisk
0Asterisk必须安装AMI
1在Openfire中安装Asterisk-IM的plugin
2配置Asterisk服务器信息。Asterisk-IM->General Settings(user/pwd为AMI帐号)
3将Openfire用户与Phone匹配。Asterisk-IM->Phone Mapping(Device的格式类似SIP/2000)
这个plugin的作用是通过AMI(Asterisk Manager API)获得Phone的状态变化信息。
具体的效果就是Spark上用户的状态会变为"On the Pone",or "Available".
不过可以把它的AMI Client偷过来自己用,娃哈哈)
 
4在Openfire中安装SIP Phone Plugin
5配置SIP Server信息.Server->Phone->Sip Settings
(没有NAT所以没有配STUN,voicemail实在不知道干啥用这里,随便写了)
6将PHONE与Openfire用户匹配.Server->Phone->Sip Phone Mapping(其实为什么不和上面那个Plugin整合呢)
7在Spark上安装SIP Phone Plugin,关闭,重启
这套Plugin要强大的多,提供了基本的SIP Softphone的功能,可以Call,Hold等等。
实现用了OpenSource的SIP包,娃哈哈可以偷过来玩)
 
OK.顺利的话,你的Spark就进化成为了SIP Softphone!
终于有了第二个SoftPhone,欢快的地给Xlite打了一个电话。
这个方案最大的问题是对客户端的依赖。
不管是Status的变化还是Sip Phone,换成其他的都不行。
 
P.S.配置之中遇到的最大问题是Spark一直没办法注册到Asterisk上。
搞了半天最后才搞定。总结下来最有可能是以下两方面问题。
1原来Openfire上Asterisk的地址配的是localhost,可能Phone直接拿了这个地址去连接。
2最后Spark卸载了重装就好了,可能是本身Configuration没有更新。
 
在Asterisk中整合Jabber
其实Asterisk本身也整合了Jabber的功能(皑皑,蛋糕就这么大,谁都想吃)
1.4以后的版本都包含了Jabber Module,可以作为Jabber Client或者Component进行实用。
1作为Jabber Client,可以通过两个Application(jabbersend,jabberstatus)
在extension.conf中发送XMPP消息
2作为Jabber Component
可以在jabber.conf中配置Jabber Server
让Asterisk作为Jabber Component与Server通讯。(还不知道具体啥样子呢-。-)
 
这部分都没有试过。因为具体的效果就是那样
而且我也不确定Jabber Server是否对这种通讯支持良好。
皑皑,毕竟有上面那种比较完善的解决方案在了。。。
 
 
 
 
 
 

 

AXL vs JTAPI

Tags: , , ,
从Call Manager Programming Guide里下了好几篇。
感觉下来AXL和JTAPI属于比较实用的两种接口。
说到底也就是后台那上百张表的事情。
不过从目前所知两者还是有一些区别。
 
AXL的精华就是ExecuteSQLQuery和ExecuteSQLUpdate。
其他都是基于这两个接口的具体应用。
通过Web Services将这些接口暴露出来。
客户端可以通过WSDL实现客户端,与Call Manager实现通讯进行查询和数据操作。
 
JTAPI是Sun推出的Call Control的API。
Call Manager实现了它,并且针对Call Manager的功能进行了扩展。
它的主要主要实现方式是Event,Observer.
通过实现JTAPI的接口,为Terminal,Address添加Observer来监控各种数据信息。
 
AXL的实现方式是目前流行的Web Services,
但是实现的比较糟糕。。。ExecuteSQLQuery,ExecuteSQLUpdate两个根本没办法直接用,骂人了。
 
JTAPI是Sun的标准,不过据说本身比较乱。
通过/plugins/jtapi.jar来实现编程调用。
 
感觉上AXL针对的是比较静态的配置信息。
JTAPI可以通过Event更好的获取动态设备信息。
 
-。-随便说说,等回去了玩玩看JTAPI的Demo.

 

CallManager和Phone的接口总结

Tags: ,
1CallManager
1.1 AXL(很烂的Web Services,看了半天其实最有用的只有两个接口,query,update…,前提要熟悉DB Schema)
1.2 Servicability,包括Ris,Perfmon,ControlCenterService,LogCollection,CDRonDemond,DimeGetFile)暂时没有时间熟悉
1.3 Extension Mobility暂时没有时间熟悉
1.4 WebDialer暂时没有时间熟悉
 
2Phone
2.1Phone Service
2.2Phone Service Push(Status和Execute,主动通过/CGI/Execute发送给phone)
2.3Phone Service Application API(用于扩展基本的Phone Service,使得Service Application更加可控)
2.4Phone Service Steam API(Push Service的扩展,使得Application更好的控制Audio
2.5URI Features(Excute的扩展,通过URI执行Phone内置的命令)
2.6SIP Messages(至今不太明朗。。。)

 

无觅相关文章插件,快速提升流量