Monday 29 August 2016

Virgin on the ridiculous

Five months ago I moved, with all the stress and buggering about I didn't check the broadband situation.

I was merrily enjoying the basic BT Infinity package and I went onto my portal and put in the details of the new place.

Minimal ADSL 2+, bad ADSL 2+...

Oh Shit...WTF BT!

Checked Virgin (NTL) they had the corner in media, connectivity and the rest of it in the area. Anything you like sir, we got it all, Promises, promises.

I'd been there before with NTL and service sucked balls, badly. More recently an old neigbour's 5 month pain of a Virgin Media clusterfuck rang in my head and made me approach with caution but I had no choice.

Fast forward and the service was installed and with a decent download speed and 6Mbs up (a little pants), but it ran merrily.

Until late August, three months after install. Came back after a few days away, had been hot and I discovered no internet. Stupid looking white router thing is flashing green not white, Had a look on the router's web GUI and I'm seeing a download link issue. Not locked.

Called Virgin, repeated the same troubleshooting stuff I'd already done, declared there was nothing they could do and an engineer will be dispatched.

What's the issue? Sorry sir cannot say, could be anything... Like what? Router, cabling, exchange, act of God, narrow this down dude... He basically had no idea. Service desk scripts, 3rd party in India, basic triage and fuck off.

Engineer came. I wasn't about. The bloke faffed with the cables, went outside, swapped the router and it was all back. Great, was a one off.

Less then 30 days later, came back from Scotland with the kids and no internet, same thing, upstream is dead. Not locked.

Called Virgin. 1hr and 10 miutes of getting the runaround. None of the department hopping one used to get with NTL but no better.

So whats the issue? Sorry sir cannot say, could be anything... Booked an engineer for the 5th of Sepetember, 2016. Say what? Thats 9 days away buddy. Sorry Sir all we can do, fuck off.

But this time I'm told that there is a postcode wide outage and the service may be restored in 24hrs. Really? So what are you doing about this?

Nothing.

Come again. Nothing?

If no-one calls up then nothing gets done even if they know there is an issue. I told the guy that in my operations life if I did that I'd lose my job.

Virgin man in Indian Sub-continent: DILIGAF

I escalated to this guy's manger and went though it all over again, told him that if there was a postcode wise outage then my neighbours should the be down. He didn't seem to give a shit. No budging on the 5th visit at my expense. Sorry sir we have no information but some information, there may be a problem but there's not a problem, we're booking an engineer but it might be back in 24hrs.

Huh?

I would subscribe to the flat earth society's monthly newsletter before believing this shite.

Prior to Virgin and after NTL I had:
  • Tiscali: Up to 8MB
  • BE: ADSL2+
  • ZEN: Infinity 2
  • BT: Infinity 1
This covered about 10 years and I has one problem when I changed packages with BE from dynamic to static IP addressing and they had allocated the same IP to someone else. Proper ballache but they sorted it out... Eventualllyyyy. Admin error.

Aside from that, no issues. That's pretty good when you think about it?

Now dear Virgin, and with your black magic, phat white coax and extended engineer visits and shit that doesn't work very well,,, Why do you expect your user base will put up with this substandard nonsense? 

Because we're British and we put up with substandard shit. We'll to be clear we did, we now expect a little more and for you incompetent twats, this spells bad news.

The man on the phone seemd to be pretty fucked off with middle class toffs phoning up and giving him shit over stuff he couldn't fix despite knowing full well that the parent company was oversibscribing users and the whole cable modem thing didn't work so well. People don't want to be fucked about, life is too short, we have shit to do, important shit like CT600 tax returns and keeping kids amused with Scooby Doo.

Virgin, you're going to have to sort this fucked up situation out... Why? Because BT will bring Infinity into your areas but worse still, your user base can access 4G (or really LTE which is pretty shagging fast).

See when I got off the phone with with your clueless support bloke and his manager, neither of whome was ultimately any use and who had bald faced lied to me (yes I checked, two neighbours had Virgin and were working so no outage) I sat down, and then ran a speed test on my phone.

112MBs down and 40 up. No fucking way.... That got my small brain thinking. Why wired? I don't mean Ethernet (although I do) I mean, Infinity, ADSL, Cable. 

My issue is that I need wired internally, desktop, firewall, Cisco switch, control of everything. I just do.

This was a Saturday, kids were lured into the car with a promise of a Subway or a KFC and we hit PC World, Argos and Maplin. Only Maplin had a 4G wired router as the other two are worthless for anything beyond robbing you.

The router Maplin was peddling got mixed reviews online and I wasn't perepared to commit... Yes I'm a bloke and this is normal behavior when presented with minimal confidence in a result.

With the kids in the car and the phone running out of juice I 'Zoned (Prime) a TP-Link TR-MR3420 for £30 and a ZTE MF823 LTE dongle thing for £50 (just checked, though it was £40, fuck). And obviously a next day delivery, yes fuck you high street and hopefully we'll have drones dropping usefult shit instead of JDAMS in the near future.

Dragging the kids to the nearby shopping centre I ploughed into the 3 shop and demanded the finest 1 month rolling 4G contract they had. £26/month for 20GB and 1 New Pence per MB thereafter (£10/GB).

Back in the Batcave I placed the new SIM in an old HTC M7 and enabled the wifi sharing to placate the kids who were baying for my blood. With 'sillybilly' locked into their devices the children retreated to various hidden locations and went suspiciouly quiet with the little people watching cued-up My Little Pony.

With some breathing space, I sorted out some telnet access to a Cisco 2900G switch and allocated another VLAN/Added this to a trunked port and allocated an access port for the new router.

I use a Sophos UTM 9 firewall and I trunk all the VLANs into it down one wire. I created a new tagged interface as another WAN port, NATed it and set some rules.

At around lunchtime on the Sunday the Amazon man arrived bearing a box with two items.

Fired the router up, changed it's IP, connected it to the Cisco switch and transferrd the the SIM from the HTC to the ZTE modem.

Boom, the modem started flashing and the Sophos UTM prioritised the traffic over the LTE router.

Internet was back. It made me think.

Why the fuck am I paying £35 to Virgin? I get the same speed. Latency seems pretty good. I'm watching Netflix, writing this and doing everything else I would be doing on wired link.

Even running over a 3 year old HTC phone with a fucked battery I had internet where Virgin is going to take 9 days to 'resolve' their/my issue.

Luddites, dark ages, mobility is king. 

Should I carry on being hardwired? Why should I? Are the risks of disconnection any greater than this abysmal service?

Sure maybe I'll exceed £35 at 1p/MB after my default 20GB some months but you know what? 

That's my fucking choice, I'll pay a little more for something I could unplug and take on holiday or move with to a new property or not not come back from holiday and find that some clueless fucktards have cut me off from a service I fucking pay for and that I have no recourse over other than going to OFCOM.

Thinking bigger, just walk away and don't look back, make these muppets fix their issues. If users bang out and they cant get more, big decisions get made. If service is substandard with anything, vote with your feet.

Wider even still, what about LTE wireless MESH networking? Users buy nodes that participate in a resilient LTE fabric that access the internet via ADSL, Infinity, Cable and 4G-LTE making your experience completely provider agnostic and more importantly you never lose your connectivity.

We could manage our own internet access and cast the shit ones to the side, so fuck you Virgin, useless twats.






Saturday 26 March 2016

Flash Cisco IP phones with SIP firmware for non Cisco PBX

In order to make Cisco IP phones work with a non-Cisco PBX (Asterisk, 3CX for example) you need to flash them with Cisco SIP firmware.

Information regarding this process is a little thin so I thought I would share my experience of doing this successfully on a Cisco 6921 phone.

To be able to do this you'll need several things:

  1. The MAC address of the phone you're going to flash
  2. Cisco SIP Firmware files
  3. DHCP server
  4. TFTP server
  5. A custom SEP<MACof Phone>.cnf.xml file
  6. A dialplan.xml file
In this example I am using the 9.4.1.3 firmware for a 69xx (6921) phone that I'll boot to a file server that's running a Solarwinds TFTP server.

Once you have everything ready you can flash these phones very quickly and get them talking to a non-Cisco PBX, in my case Elastix.

OK, lets get started,

The process we'll use is as follows:
  1. Install a TFTP server and specify a TFTP root folder.
  2. Extract the Cisco SIP firmware into the root.
  3. Create the SEP<MACof Phone>.cnf.xml file in the TFTP root.
  4. Create the dialplan.xml file in the TFTP root.
  5. Configure DHCP to direct TFTP to the file server.
  6. Ensure that you have no firewall in the way or create an any>any rule from source to destination.
Installing the Solarwinds TFTP server is pretty straightforward, specify the root folder and start the server.

Extract the files from the Cisco SIP firmware zip file into the TFTP root:











Get the MAC of your phone and create the SEP<MACof Phone>.cnf.xml file in the TFTP root.

Paste the following into the file observing the bold/italic/large elements of where you should edit the file for your environment (Cisco Timezone strings can be found online):

<device>
  <deviceProtocol>SIP</deviceProtocol>
  <sshUserId>admin</sshUserId>
  <sshPassword>Password</sshPassword>
  <devicePool>
    <dateTimeSetting>
      <dateTemplate>D.M.Y</dateTemplate>
      <timeZone>Greenwich Standard Time</timeZone>
      <ntps>
        <ntp>
          <name>time.windows.com</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>PBX.domain.local</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>true</remotePartyID>
      <userInfo>None</userInfo>
    </sipStack>
    <autoAnswerTimer>1</autoAnswerTimer>
    <autoAnswerAltBehavior>false</autoAnswerAltBehavior>
    <autoAnswerOverride>true</autoAnswerOverride>
    <transferOnhookEnabled>false</transferOnhookEnabled>
    <enableVad>false</enableVad>
    <preferredCodec>none</preferredCodec>
    <dtmfAvtPayload>101</dtmfAvtPayload>
    <dtmfDbLevel>3</dtmfDbLevel>
    <dtmfOutofBand>avt</dtmfOutofBand>
    <alwaysUsePrimeLine>false</alwaysUsePrimeLine>
<alwaysUsePrimeLineVoiceMail>false</alwaysUsePrimeLineVoiceMail>
    <kpml>3</kpml>
    <natEnabled>false</natEnabled>
    <natAddress></natAddress>
    <phoneLabel>phoneLabel</phoneLabel>
    <stutterMsgWaiting>0</stutterMsgWaiting>
    <callStats>false</callStats>
    <silentPeriodBetweenCallWaitingBursts>10</silentPeriodBetweenCallWaitingBursts>
    <disableLocalSpeedDialConfig>false</disableLocalSpeedDialConfig>
    <startMediaPort>10000</startMediaPort>
    <stopMediaPort>20000</stopMediaPort>
    <sipLines>
      <line button="1">
        <featureID>9</featureID>
        <featureLabel>Admin</featureLabel>
        <proxy>PBX.domain.local</proxy>
        <port>5060</port>
        <name>6002</name>
        <displayName>6002</displayName>
        <autoAnswer>
          <autoAnswerEnabled>2</autoAnswerEnabled>
        </autoAnswer>
        <callWaiting>3</callWaiting>
        <authName>6002</authName>
        <authPassword>password</authPassword>
        <sharedLine>false</sharedLine>
        <messageWaitingLampPolicy>1</messageWaitingLampPolicy>
        <messagesNumber>80</messagesNumber>
        <ringSettingIdle>4</ringSettingIdle>
        <ringSettingActive>5</ringSettingActive>
        <contact>105</contact>
        <forwardCallInfoDisplay>
          <callerName>true</callerName>
          <callerNumber>true</callerNumber>
          <redirectedNumber>false</redirectedNumber>
          <dialedNumber>true</dialedNumber>
        </forwardCallInfoDisplay>
      </line>
      <line button="2">
          <featureID>21</featureID>
          <featureLabel>test</featureLabel>
          <speedDialNumber>4444</speedDialNumber>
          <featureOptionMask>1</featureOptionMask>
      </line>
    </sipLines>
    <voipControlPort>5060</voipControlPort>
    <dscpForAudio>184</dscpForAudio>
    <ringSettingBusyStationPolicy>0</ringSettingBusyStationPolicy>
    <dialTemplate>dialplan.xml</dialTemplate>
  </sipProfile>
<commonProfile>
    <phonePassword></phonePassword>
    <backgroundImageAccess>true</backgroundImageAccess>
    <callLogBlfEnabled>1</callLogBlfEnabled>
  </commonProfile>
  <loadInformation>SIP69xx.9-4-1-3</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>
    <g722CodecSupport></g722CodecSupport>
<daysDisplayNotActive>1,2,3,4,5,6,7</daysDisplayNotActive>
    <displayOnTime>08:30</displayOnTime>
    <displayOnDuration>09:30</displayOnDuration>
    <displayIdleTimeout>01:00</displayIdleTimeout>
    <displayOnWhenIncomingCall>1</displayOnWhenIncomingCall>
    <spanToPCPort>1</spanToPCPort>
    <loggingDisplay>1</loggingDisplay>
    <loadServer></loadServer>
  </vendorConfig>
  <networkLocale></networkLocale>
  <networkLocaleInfo>
    <name></name>
    <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>2</transportLayerProtocol>
  <capfAuthMode>0</capfAuthMode>
  <capfList>
    <capf>
      <phonePort>3804</phonePort>
    </capf>
  </capfList>
<certHash></certHash>
  <encrConfig>false</encrConfig>
</device>

Create the dialplan.xml file in the tftp root and add something similar to the following (failing to do this will result in the phone blindly dialing as soon as you press a button):

<DIALTEMPLATE>
  <TEMPLATE MATCH="999" TIMEOUT="2"/><!-- UK emergency services. Wait 2 seconds, then dial -->
  <TEMPLATE MATCH="6..." TIMEOUT="2"/><!-- Internal extensions 6000 to 6999. Wait 2 seconds, then dial -->
  <TEMPLATE MATCH="0......" TIMEOUT="2"/><!-- 7 digits. Wait 2 seconds, then dial -->
  <TEMPLATE MATCH="0......." TIMEOUT="2"/><!-- 8 digits. Wait 2 seconds, then dial -->
  <TEMPLATE MATCH="0........" TIMEOUT="2"/><!-- 9 digits. Wait 2 seconds, then dial -->
  <TEMPLATE MATCH="0........." TIMEOUT="2"/><!-- 10 digits. Wait 2 seconds, then dial -->
  <TEMPLATE MATCH="0.........." TIMEOUT="2"/><!-- 11 digits. Wait 2 seconds, then dial -->
  <TEMPLATE MATCH="0..........." TIMEOUT="2"/><!-- 12 digits. Wait 2 seconds, then dial -->
  <TEMPLATE MATCH="0............" TIMEOUT="2"/><!-- 13 digits. Wait 2 seconds, then dial -->
  <TEMPLATE MATCH="0............." TIMEOUT="2"/><!-- 14 digits. Wait 2 seconds, then dial -->
  <TEMPLATE MATCH="*." TIMEOUT="2"/><!-- * and 1 digit for asterisk. Wait 2 seconds, then dial -->
  <TEMPLATE MATCH="*.." TIMEOUT="2"/><!-- * and 2 digits for asterisk. Wait 2 seconds, then dial-->
</DIALTEMPLATE>

Add the following DHCP options, I'm using a Sophos UTM 9 firewall and the options are as follows (in each option, specify the name/IP of the target TFTP server):


Now you should be ready to flash the phone. As a note I did not have to to configure the phone at all, I simply followed the procedure below and the phone found the firmware and flashed. There were some files not found in the TFTP root but these can be ignored.

A factory reset of the phone is the same as below but without the tftp server being available.

  1. Remove the power from the phone.
  2. Press and hold #
  3. Connect power (power cable or PoE)
  4. Wait a couple of seconds and your line lights should go solid. Mine went green other models go amber/red.
  5. Press 123456789*0# (note: as soon as the first button the previous sequence is pressed all the keypad lights go red).
  6. The phone restarts and boots to the TFTP server.
After approximately 30 seconds if all is well you'll see output in the TFTP log and a progress bar on the screen of the phone:


I had the file server on a different firewall controlled subnet to the phones and even thoughI had opened 69 UDP for TFTP I had failures to down load the files. Basically there are other dynamic ports used during the flash process, temporarily opening up everything to the TFTP server from the DHCP address range  solved TFTP boot failures...

You'll see failures for the TLV files, these are certificate lists that Cisco Call Manager uses and can be safely ignored in our non-Cisco SIP environment.

The phone will finally start and stay as 'not registered' for about 30-45 seconds after which, if you have configured the cnf.xml file correctly, it should register with the PBX.

Obviously test that everything works correctly for you, if you need to make changes to either the cnf.xml or dialplan.xml files, just edit them in the TFTP root and repeat the above process. The altered files are re-copied and the phone will reboot with the new config.