0. добавим откуда брать пакеты
1 2 3 4 5 |
Для debian squeeze echo "deb http://packages.asterisk.org/deb squeeze main" >> /etc/apt/sources.list echo "deb-src http://packages.asterisk.org/deb squeeze main" >> /etc/apt/sources.list apt-key adv --keyserver pgp.mit.edu --recv-keys 175E41DF apt-get update |
1. установим asterisk
1 |
apt-get install asterisk-1.8 asterisk-dahdi |
2. настройка астера sip.conf
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 |
cd /etc/asterisk/ cp sip.conf sip.conf.back echo 1 > sip.conf nano /etc/asterisk/sip.conf [general] transport=udp t38pt_udptl=yes,fec,maxdatagram=400 ;faxdetect=yes echocancel=yes alwaysauthreject = yes disallow=all allow=alaw allow=ulaw allow=gsm context=default qualify=yes registertimeout=300 ;srvlookup=yes session-timers=originate session-expires=120 session-minse=90 session-refresher=uac nat=yes externip=0.0.0.0:5060 localnet=192.168.3.0/24 localnet=192.168.92.0/24 localnet=10.70.70.0/24 canreinvite=no [zxc](!) type=friend host=dynamic context=zxc deny=0.0.0.0/0.0.0.0 permit=192.168.92.0/255.255.255.0 permit=10.70.70.0/255.255.255.0 permit=10.10.10.10/255.255.255.0 callgroup=1 pickupgroup=1 nat=no [900](zxc) secret=pass callerid="900" <900> [901](zxc) secret=pass callerid="901" <901> [999](zxc) secret=pass callerid="999" <999> permit=192.168.3.0/255.255.255.0 [905](zxc) secret=pass callerid="TEST" <905> permit=XXX.XXX.XXX.XXX/255.255.255.255 ;[oyster] ;host=XXX.XXX.XXX.XXX ;type=friend ;context=oyster ;dtmfmode=inband ;fromuser=pks-gw ;nat=yes |
3. правим диалплан
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 |
cd /etc/asterisk/ cp extensions.conf extensions.conf.back echo 1 > extensions.conf nano /etc/asterisk/extensions.conf [default] exten => _X.,1,Hangup [zxc] exten => _9XX,1,Dial(SIP/${EXTEN}) ;exten => _[2-8]xxxxxx,1,Set(CALLERID(ALL)=78126002597) ;exten => _[2-8]xxxxxx,n,Dial(SIP/oyster/${EXTEN}) ;exten => _[2-8]xxxxxx,n,Hangup() ;exten => _8XXXXXXXXXX,1,Set(CALLERID(ALL)=78126002597) ;exten => _8XXXXXXXXXX,n,Dial(SIP/oyster/${EXTEN}) ;exten => _8XXXXXXXXXX,n,Hangup() ;;[oyster] ;; During business hours, jump to incoming-open context. ;; We are open Monday to Friday from 9:00 to 18:00 (9 a.m. to 6 p.m.): ;;exten => 1234567,1,GotoIfTime(09:00-19:00,mon-fri,*,*?incoming-open,s,1) ;; Also Saturdays from 9 to 12: ;exten => 1234567,n,GotoIfTime(09:00-12:00,sat,*,*?incoming-open,s,1) ;; After hours go to incoming-closed: ;;exten => 1234567,n,Goto(incoming-closed,s,1) [incoming-open] ;;Both phones call - 901 and 900 ;exten => s,1,Dial(SIP/901&SIP/900,10) ;exten => s,n,Set(CALLERID(ALL)=123456789) ;exten => s,n,Dial(SIP/oyster/123456789) ;exten => s,n,Hangup() ;;OR phone call serially - timeout 30 sec ;exten => s,1,Dial(SIP/900,30) ;exten => s,n,Dial(SIP/901,30) ;exten => s,n,Hangup() [incoming-closed] ;exten => s,1,Set(CALLERID(ALL)=123456789) ;exten => s,n,Dial(SIP/oyster/123456789) ;exten => s,n,Hangup() |
4. установка tftp + dhcp
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 |
apt-get install atftpd dhcp3 mkdir /var/log/tftp/ -p mkdir /var/tftp -p touch /var/log/tftp/atftpd.log chown nobody.nogroup /var/log/tftp/ chown nobody.nogroup /var/tftp nano /etc/default/atftpd USE_INETD=false OPTIONS="--logfile /var/log/tftp/atftpd.log --user nobody --bind-address 0.0.0.0 --no-multicast /var/tftp nano /etc/default/isc-dhcp-server INTERFACES="eth1" nano /etc/dhcp/dhcpd.conf ddns-update-style none; option domain-name "d0.b14hesh.ru"; -пох option domain-name-servers 10.10.10.10, 8.8.8.8; -dns option tftp-server-name "10.10.10.10"; option routers 10.10.10.10; -gateway option broadcast-address 10.10.10.255; default-lease-time 600; max-lease-time 7200; log-facility local7; host winxp { hardware ethernet 00:0c:29:ea:72:4d; fixed-address winxp.d0.b14esh.ru; (у меня стаял bind он раздвал ip) } subnet 10.10.10.0 netmask 255.255.255.0 { range 10.10.10.100 10.10.10.200; } |
5. Файло необходимое для прошивки телефонов кладем все /var/tftp
1 2 3 4 5 6 7 8 9 10 11 12 |
http://81.176.70.54/3803422/cmterm-7911_7906-sip.8-5-2.zip?filename=cmterm-7911_7906-sip.8-5-2.zip - берем тут или ищем в инете apps11.8-5-2TH1-9.sbn cmterm-7911_7906-sip.8-5-2.zip cnu11.8-5-2TH1-9.sbn cvm11sip.8-5-2TH1-9.sbn dsp11.8-5-2TH1-9.sbn jar11sip.8-5-2TH1-9.sbn SEP002414B3095B.cnf.xml файл настройки Цыскофона с маком 002414B3095B SIP11.8-5-2S.loads тут указаны файлы для прошивки term06.default.loads тут указаны файлы для прошивки 7906 term11.default.loads тут указаны файлы для прошивки 7911 XMLDefault.cnf.xml Файл настройки для всех Цысок |
6. Пример конифига для телефона с номером 900
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 185 186 187 188 189 190 191 192 193 194 195 |
<device xsi:type="axl:XIPPhone" ctiid="1566023366"> <deviceProtocol>SIP</deviceProtocol> <sshUserId>admin</sshUserId> <sshPassword>admin</sshPassword> <devicePool> <dateTimeSetting> <dateTemplate>D.M.Y</dateTemplate> <timeTemplate>HH:MM</timeTemplate> <timeZone>Caucasus Standard/Daylight Time</timeZone> <ntps> <ntp> <name>pool.ntp.org</name> <ntpMode>Unicast</ntpMode> </ntp> </ntps> </dateTimeSetting> <callManagerGroup> <members> <member priority="0"> <callManager> <ports> <ethernetPhonePort>2000</ethernetPhonePort> <sipPort>5060</sipPort> <securedSipPort>5061</securedSipPort> </ports> <processNodeName> ип адресс сервераааа</processNodeName> </callManager> </member> </members> </callManagerGroup> </devicePool> <sipProfile> <sipProxies> <backupProxy></backupProxy> <backupProxyPort></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</phoneLabel> <stutterMsgWaiting>1</stutterMsgWaiting> <callStats>false</callStats> <silentPeriodBetweenCallWaitingBursts>10</silentPeriodBetweenCallWaitingBursts> <disableLocalSpeedDialConfig>false</disableLocalSpeedDialConfig> <startMediaPort>16384</startMediaPort> <stopMediaPort>32766</stopMediaPort> <sipLines> <line button="1"> <featureID>9</featureID> <featureLabel>900</featureLabel> <proxy> ип адресс сервера или имя днс</proxy> <port>5060</port> <name>900</name> <displayName>900</displayName> <autoAnswer> <autoAnswerEnabled>2</autoAnswerEnabled> </autoAnswer> <callWaiting>3</callWaiting> <authName>704</authName> <authPassword>pass (пароляяя) </authPassword> <sharedLine>false</sharedLine> <messageWaitingLampPolicy>1</messageWaitingLampPolicy> <messagesNumber></messagesNumber> <ringSettingIdle>4</ringSettingIdle> <ringSettingActive>5</ringSettingActive> <contact></contact> <forwardCallInfoDisplay> <callerName>true</callerName> <callerNumber>false</callerNumber> <redirectedNumber>false</redirectedNumber> <dialedNumber>true</dialedNumber> </forwardCallInfoDisplay> </line> <line button="2"> <featureID>21</featureID> <featureLabel>speed dial name goes here</featureLabel> <speedDialNumber>speed dial actual number goes in here</speedDialNumber> </line> </sipLines> <voipControlPort>5060</voipControlPort> <dscpForAudio>184</dscpForAudio> <ringSettingBusyStationPolicy>0</ringSettingBusyStationPolicy> <dialTemplate>dialplan.xml</dialTemplate> </sipProfile> <commonProfile> <phonePassword></phonePassword> <backgroundImageAccess>true</backgroundImageAccess> <callLogBlfEnabled>2</callLogBlfEnabled> </commonProfile> <loadInformation>SIP11.8-5-2SR1S</loadInformation> <vendorConfig> <disableSpeaker>false</disableSpeaker> <disableSpeakerAndHeadset>false</disableSpeakerAndHeadset> <pcPort>0</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:00</displayOnTime> <displayOnDuration>00:00</displayOnDuration> <displayIdleTimeout>00:00</displayIdleTimeout> <spanToPCPort>1</spanToPCPort> <loggingDisplay>1</loggingDisplay> <loadServer></loadServer> </vendorConfig> <userLocale> <name>Russian_Russia</name> <version></version> <langCode>ru_RU</langCode> <winCharSet>utf-8</winCharSet> </userLocale> <versionStamp>1143565489-a3cbf294-7526-4c29-8791-c4fce4ce4c37</versionStamp> <networkLocaleInfo> <name>Russian_Federation</name> <uid></uid> <version></version> </networkLocaleInfo> <deviceSecurityMode>1</deviceSecurityMode> <authenticationURL></authenticationURL> <directoryURL></directoryURL> <idleURL></idleURL> <informationURL></informationURL> <messagesURL></messagesURL> <proxyServerURL></proxyServerURL> <servicesURL></servicesURL> <dscpForSCCPPhoneConfig>96</dscpForSCCPPhoneConfig> <dscpForSCCPPhoneServices>0</dscpForSCCPPhoneServices> <dscpForCm2Dvce>96</dscpForCm2Dvce> <transportLayerProtocol>4</transportLayerProtocol> <capfAuthMode>0</capfAuthMode> <capfList> <capf> <phonePort>3804</phonePort> </capf> </capfList> <certHash></certHash> <encrConfig>false</encrConfig> </device> |