Восстановление IP-фона Cisco 7942G

Cisco 7942G мне подарили товарищи по работе, за что им огромное спасибо и уважение! Угораздило же меня прошивать телефон на SIP-прошивку именно в тот момент, как скакнуло напряжение в офисе.. 8(( Телефон сдох.

После различных попыток восстановления телефона, он замолчал и уже не подавал никаких признаков жизни — на экране по появлялось никаких сообщений. Ни по команде 123456789*0#, ни по 3491672850*# восстановить телефон, с помощью местного TFTP-сервера и прошивок на нем, не удалось. (((

Пришлось менять стратегию.

Был запущен отдельный TFTP-сервер на DHCP с раздачей файла по протоколу BOOTP на Debian 5.0.6. Использовалось редкое в России устройство Synertron CV860A, с процессором VIA C3:

  • CPU VIA Eden/C3 376 PIN 1GHz,
  • PLE133 chipset, PC133 SDRAM memory,
  • 3x LANs, 2x Serial ports, 3x USB ports,
  • 50-pin bootable Compact Flash Disk Socket,
  • 1x DOC,
  • 1x 44-pin IDE,
  • and 1x 40-pin IDE.

 

Крайние правые порты (по порядку): eth0 и eth2.

Решение нашел благодаря статье на официальном сайте — http://www.cisco.com/en/US/ts/fn/620/fn62949.html

Вот содержание статьи:

Workaround:

Cisco recommends that customers stage their Cisco Unified IP Phones before deploying them to users. This allows Network Administrators to ensure:

— Each phone is upgraded to appropriate firmware releases.

— Properly configure the phone prior to deploying each phone

— The phone is assembled with the appropriate cables, handsets and optional headsets.

While staging the Network Administrator can perform additional activities such as factory resets, apply Dial Numbers and spot check phone functions.

Solution:

Cisco recommends the use of Firmware release 8.2(2)SR1 or later releases. This release and later versions are free of this defect. Registered users may obtain this release from the Cisco Unified IP Phone Firmware downloads (registered customers only) page. Select the proper load for your model of IP Phone.

Recovery of the IP Phone:

  1. Make sure your phones are on a network with a valid DHCP server.
  2. Make sure the DHCP server on this network has a valid Option 150 setting pointing to a valid Cisco TFTP server.
  3. Make sure you have a valid term11.default.loads file from load 8.2(2)SR1 or higher on the TFTP server that is referenced in Option 150.
  4. Make sure you have all other needed image files present on this same TFTP server. * See note below.
  5. Change the timing on the network — the problem is related to timing. Toggle switch port settings between «Auto» and «100Mbps.» On a Cisco switch the command to toggle the switch port switch:
    interface range fastethernet
    set speed 100
    set duplex full
    

    Wait 10 minutes, or until all the phones have been updated, then issue the following command if desired to return to original configuration:

    interface range fastethernet
    set speed auto
    set duplex auto
    

    Ensure that items 1 through 5 have been completed. If performing these five steps does not resolve the issue, continue with the remaining steps.

  6. Pull power on the phone (even if power is PoE).
  7. Hold down the # key on the phone.
  8. Continue holding down the # key and re-apply power.
  9. While still holding the # key wait for the Message Waiting Indicator (MWI) light on the handset to start flashing.
  10. Once the MWI light is flashing, release the # key and enter the following sequence exactly on the keypad:3491672850*#Once this sequence has been entered on the IP Phone, if all the network criteria above have been met, it should begin its recovery process. This process can take up to 15 minutes to finish. The phone may appear to be doing nothing during this time. However, if the phone does not recover after 20 minutes then it is possible that the recovery is stuck. In this case, re-examine your network and verify that steps 1-4 are in place, then re-issue the factory reset sequence.

* Note: The factory reset sequence is a way for a phone to clear flash and still upload to a valid firmware image. This is facilitated by the termxx.default.loads file, but requires that the image files listed in the termxx.default.loads file are available in TFTP for the phone to download. Open the termxx.default.loads file in any text editor. This loads file is essentially just a packing list showing all the OS and application files the phone needs to function. The files include a cnu, cvm, dsp, app and jar files. Please make sure that these files as listed in the termxx.default.loads file are in TFTP. («xx» will be either «06» for the CP-7906G model, or «11» for the CP-7911G model.)

Additional Diagnostic Steps:

— Try a hard-coded IP address as a test to see if this resolves the upgrade failures. If it does, and the number of failing IP Phones is relatively few, this procedure may be the most expedient. After the IP Phone upgrades successfully, reconfigure the IP Phone to use DHCP.

— Try putting the phone on a hub or a different switch and see if this helps change the startup timing enough so that the upgrade completes successfully.

***

Основная проблема возникла в пунктах 1-4, — не сразу удалось подобрать подходящую конфигурацию и заставить ее работать, ниже описываю положительный опыт создания такой конфигурации.

Первоначально пытался прописать DHCP option 150 на сервере Windows 2003 Server (позже подготовлю статью по этой теме), однако сразу не завелось, потому перешел на Debian.

IP-фон с помощью порта 10/100SW был подключен к свитчу, свитч подключен к серверу в порт eth0 (192.168.100.0/24), порт eth2 сервера (192.168.0.0/24) через еще один роутер, был подключен к интернету.

Итак, после установки операционной системы, был установлен TFTP-сервер:

apt-get install tftpd-hpa tftp-hpa
mcedit /etc/inetd.conf
#:BOOT: TFTP service is provided primarily for booting.  Most sites
#       run this only on machines acting as "boot servers."
tftp           dgram   udp     wait    root  /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /var/lib/tftpboot
invoke-rc.d openbsd-inetd restart
chmod 777 /var/lib/tftpboot
echo TEST > /var/lib/tftpboot/test0
echo get test0 | tftp 127.0.0.1

Устанавливаем DHCP-сервер:

apt-get install dhcp3-server
mcedit /etc/dhcp3/dhcpd.conf

ddns-update-style none;

option option-150 code 150 = ip-address;

default-lease-time 3600;
max-lease-time 7200;

# eth2
subnet 192.168.0.0 netmask 255.255.255.0 {
}

# eth0
subnet 192.168.100.0 netmask 255.255.255.0 {
    range dynamic-bootp 192.168.100.2 192.168.100.99;
    option subnet-mask 255.255.255.0;
    option broadcast-address 192.168.100.255;
    option domain-name-servers 8.8.8.8, 8.8.4.4;
    option routers 192.168.100.1;
    option option-150 192.168.100.1;
}

host cisco7942 {
    hardware ethernet b8:be:bf:22:be:05;
#    filename "SEPB8BEBF22BE05.cnf.xml";
    filename "term42.default.loads";
}

log-facility local7;

 

Настройки DHCP-клиента:

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

send host-name "dhcp-server";
send dhcp-client-identifier 00:40:48:b1:7c:59;
send dhcp-lease-time 3600;

request subnet-mask, broadcast-address, time-offset, routers,
	domain-name, domain-name-servers, domain-search, host-name,
	netbios-name-servers, netbios-scope, interface-mtu,
	rfc3442-classless-static-routes;

timeout 360;

Файл /etc/defaults/dhcp3-server:

INTERFACES="eth0"

Настройки сети:

auto lo
iface lo inet loopback

iface eth0 inet static
	address 192.168.100.1
	netmask 255.255.255.0
	network 192.168.100.0
	broadcast 192.168.100.255
auto eth0

allow-hotplug eth2
iface eth2 inet static
	address 192.168.0.53
	netmask 255.255.255.0
	network 192.168.0.0
	broadcast 192.168.0.255
	gateway 192.168.0.1
	dns-nameservers 192.168.0.1
auto eth2

Перезапуск сетевых настроек:

/etc/init.d/networking restart

Перезапуск DHCP-сервера:

/etc/init.d/dhcp3-server restart

Для пропуска трафика из подсети 192.168.0.0 в сеть 192.168.100.0, настраиваем NAT на IPtables, делаем скрипт ~/fw.start:

#!/bin/sh

INET="eth2"
INETIP="192.168.0.53"

iptables -F INPUT
iptables -F FORWARD
iptables -F OUTPUT

iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT

iptables -t nat -A POSTROUTING -o $INET -j SNAT --to-source $INETIP

echo "1" > /proc/sys/net/ipv4/ip_forward

И запускаем его:

sh ~/fw.start

После этого трафик из сети 192.168.0.0 будет доступен и в 192.168.100.0.

Результаты работы проверяю с помощью tshark:

apt-get install tshark
tshark -i eth0

После всех манипуляций перезагружаем IP-фон, как описано в статье в пункте 10:

1. Зажимаем #.
2. Отключаем питание.
3. После того, как начинают мигать кнопки Line отжимаем #.
4. Набираем комбинацию 3491672850*# и ждем, пока с TFTP-сервера пойдет трафик в телефон.

На TFTP-сервере были размещены файлы одной из ранних прошивок:

# ls /var/lib/tftpboot/

apps42.8-5-2TH1-9.sbn
cnu42.8-5-2TH1-9.sbn
cvm42sip.8-5-2TH1-9.sbn
dsp42.8-5-2TH1-9.sbn
jar42sip.8-5-2TH1-9.sbn
SIP42.8-5-2S.loads
term42.default.loads
term62.default.loads
dialplan.xml
CTLSEPB8BEBF22BE05.tlv
SEPB8BEBF22BE05.cnf.xml
XMLDefault.cnf.xml

dialplan.xml:

<DIALTEMPLATE>
  <TEMPLATE MATCH="*" Timeout="3"/>
</DIALTEMPLATE>

SEPB8BEBF22BE05.cnf.xml (конфиг-файл от более поздней прошивки):

<device>
    <fullConfig>true</fullConfig>
    <deviceProtocol>SIP</deviceProtocol>
    <devicePool>
        <dateTimeSetting>
            <dateTemplate>D.M.Y</dateTemplate>
            <timeZone>Ekaterinburg Standard Time</timeZone>
            <ntps>
                <ntp>
                    <name>10.210.0.87</name>
                    <ntpMode>Unicast</ntpMode>
                </ntp>
            </ntps>
        </dateTimeSetting>
        <callManagerGroup>
            <tftpDefault>true</tftpDefault>
                <members>
                <member priority="0">
                <callManager>
                <name>77.243.103.107</name>
                <description>Asterisk</description>
                <ports>
                  <ethernetPhonePort>2000</ethernetPhonePort>
                  <sipPort>5060</sipPort>
                  <securedSipPort>5061</securedSipPort>
                </ports>
                <processNodeName>77.243.103.107</processNodeName>
                </callManager>
                </member>
                </members>
             </callManagerGroup>
    </devicePool>
    <commonProfile>
        <phonePassword></phonePassword>
        <backgroundImageAccess>true</backgroundImageAccess>
        <callLogBlfEnabled>0</callLogBlfEnabled>
    </commonProfile>
    <loadInformation>SIP42.8-5-4S</loadInformation>
    <loadInformation434  model="Cisco 7942">SIP42.8-5-4S</loadInformation434>
    <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>
        <daysDisplayNotActive>1,7</daysDisplayNotActive>
        <displayOnTime>10:30</displayOnTime>
        <displayOnDuration>06:05</displayOnDuration>
        <displayIdleTimeout>00:05</displayIdleTimeout>
        <webAccess>1</webAccess>
        <spanToPCPort>1</spanToPCPort>
        <loggingDisplay>1</loggingDisplay>
        <loadServer></loadServer>
    </vendorConfig>

<userLocale>
   <name>Russian_Russian_Federation</name>
   <uid></uid>
   <langCode>ru_RU</langCode>
   <version>8.4.3.1000-1</version>
   <winCharSet>utf-8</winCharSet> </userLocale>
<networkLocale>Russian_Federation</networkLocale>
 <networkLocaleInfo>
   <name>Russian_Federation</name>
   <uid></uid>
   <version>8.4.3.1000-1</version>
 </networkLocaleInfo>
    <deviceSecurityMode>1</deviceSecurityMode>
    <idleTimeout>0</idleTimeout>
    <directoryURL></directoryURL>
     <servicesURL>77.243.103.107</servicesURL>
     <idleURL></idleURL>
    <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>
    <sipProfile>
        <sipProxies>
            <backupProxy>77.243.103.107</backupProxy>
            <backupProxyPort>5060</backupProxyPort>
            <emergencyProxy>77.243.103.107</emergencyProxy>
            <emergencyProxyPort>5060</emergencyProxyPort>
            <outboundProxy>77.243.103.107</outboundProxy>
            <outboundProxyPort>5060</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>
         <preferredCodec>g711alaw</preferredCodec>
       <dtmfAvtPayload>101</dtmfAvtPayload>
       <dtmfDbLevel>3</dtmfDbLevel>
       <dtmfOutofBand>avt</dtmfOutofBand>
        <alwaysUsePrimeLine>false</alwaysUsePrimeLine>
        <alwaysUsePrimeLineVoiceMail>false</alwaysUsePrimeLineVoiceMail>
        <kpml>3</kpml>
        <stutterMsgWaiting>1</stutterMsgWaiting>
        <callStats>true</callStats>
        <silentPeriodBetweenCallWaitingBursts>10</silentPeriodBetweenCallWaitingBursts>
        <disableLocalSpeedDialConfig>true</disableLocalSpeedDialConfig>
        <startMediaPort>10100</startMediaPort>
        <stopMediaPort>10300</stopMediaPort>
        <voipControlPort>5060</voipControlPort>
        <dscpForAudio>184</dscpForAudio>
        <ringSettingBusyStationPolicy>0</ringSettingBusyStationPolicy>
        <dialTemplate>dialplan.xml</dialTemplate>
         <phoneLabel>Cisco</phoneLabel>
          <natReceivedProcessing>false</natReceivedProcessing>
          <natEnabled>false</natEnabled>
          <natAddress></natAddress>
        <sipLines>
          <line button="1">
            <featureID>9</featureID>
            <featureLabel>672 L1</featureLabel>
            <proxy>77.243.103.107</proxy>
            <port>5060</port>
            <name>672</name>
            <displayName>672</displayName>
            <autoAnswer>
              <autoAnswerEnabled>2</autoAnswerEnabled>
            </autoAnswer>
            <callWaiting>3</callWaiting>
            <authName>672</authName>
            <authPassword>************</authPassword>
            <sharedLine>false</sharedLine>
            <messageWaitingLampPolicy>3</messageWaitingLampPolicy>
            <messagesNumber></messagesNumber>
            <ringSettingIdle>4</ringSettingIdle>
            <ringSettingActive>5</ringSettingActive>
            <contact>$ACCOUNT</contact>
            <forwardCallInfoDisplay>
              <callerName>true</callerName>
              <callerNumber>false</callerNumber>
              <redirectedNumber>false</redirectedNumber>
              <dialedNumber>true</dialedNumber>
            </forwardCallInfoDisplay>
          </line>
          <line button="2">
          <featureID></featureID>
          <featureLabel></featureLabel>
          <speedDialNumber></speedDialNumber>
          </line>
        </sipLines>
    </sipProfile>
</device>

XMLDefault.cnf.xml:

<Default>
    <callManagerGroup>
        <members>
            <member  priority="0">
                <callManager>
                    <ports>
                        <ethernetPhonePort>2000</ethernetPhonePort>
                    </ports>
                    <processNodeName>192.168.100.113</processNodeName>
                </callManager>
            </member>
        </members>
    </callManagerGroup>

 <loadInformation6  model="IP Phone 7910"></loadInformation6>
    <loadInformation124  model="Addon 7914"></loadInformation124>
    <loadInformation9  model="IP Phone 7935"></loadInformation9>
    <loadInformation8  model="IP Phone 7940"></loadInformation8>
    <loadInformation7  model="IP Phone 7960"></loadInformation7>
    <loadInformation20000  model="IP Phone 7905"></loadInformation20000>
    <loadInformation30008  model="IP Phone 7902"></loadInformation30008>
    <loadInformation30007  model="IP Phone 7912"></loadInformation30007>
   <loadInformation434  model="IP Phone 7942">SIP42.8-5-4S</loadInformation434>
</Default>

и пустой файл: CTLSEPB8BEBF22BE05.tlv

 

🙂

После всего этого, телефон восстановился.

Предстоит еще обновить прошивку с 8.5.2 до минимум 8.5.4 (для благополучно работы Cisco 7942 с Asterisk 1.4.39 у нас в конторе). Но это уже другая история.

 

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *