Remotely Upgrading RHEL to Ubuntu

We were given a server to play with to do whatever we wanted, hosted in a US data centre. It was running RHEL 4.x, I could have worked with that, but it didn’t look like it was on a support contract, I wasn’t able to update it, anyway.

I thought about trying to convert it to centos, but realised it would be more fun to upgrade it to ubuntu gutsy.

Quick steps from memory

  1. swapoff -a
  2. mkfs.ext3 /dev/VolGroup00/LogVol01 (old swap)
  3. mount /dev/VolGroup00/LogVol01 /mnt
  4. wget debootstrap.deb (from gutsy)
  5. ar x debootstrap.deb
  6. tar -C / -xzf data.tar.gz
  7. debootstrap –arch=i386 gutsy /mnt
  8. chroot /mnt
  9. mount proc, edit /etc/fstab and /etc/network/interfaces
  10. apt-get install ubuntu-minimal ubuntu-standard linux-image postfix openssh-server plus a few other packages, some that were recommends.
  11. copied gutsy /boot/* to the real /boot and created a new entry in menu.lst
  12. created an account and uploaded some ssh keys
  13. probably some steps I’ve forgotten
  14. reboot

Easy peasy, just waiting for it to come up, it’s been 5 hours now, still waiting. Must be the slowest booting server ever.

Guess I’ll be calling the states now. :’(

FreeSWITCH – Google Talk – Dingaling – Jingle All The Way

I got freeswitch working with google talk. There were a few bugs in mod_dingaling that were causing segfaults, they’re fixed in the latest update.

I called from gtalk on my XP vm to my e65 via SIP, audio is working. I commented out the line <param name=”ext-rtp-ip” value=”$${external_rtp_ip}”/> from conf/jingle_profiles/client.xml .

To make calls from the SIP e65 to google talk users, I added to the dialplan conf/dialplan/default.xml

<extension name=”sip2jingle”>
  <condition field=”source” expression=”mod_sofia”/>
  <condition field=”destination_number” expression=”^gmail\+([^\@]+)\@?(.*)$”>
    <action application=”bridge” data=”dingaling/gmail.com/$1@gmail.com”/>
  </condition>
</extension>

Then from the e65 I dial gmail+user@switch.gruntnet .

See FreeSWITCH and Google Talk for the rest of the setup.

I still need to do more testing, and understand how it traverses through the NAT firewall before I give out my google talk address to people. Did I mention the I love freeswitch?

Train Spotting

After high school, I landed a job in the railways as an apprentice telecommunications technician where I worked with rob for 10 years or so. It was a fairly rich environment to work in, with pretty much every telecommunications technology accounted for, with training on the lot. Opportunities to move around, and stay fresh.

Perhaps it’s no surprise, but there are a lot of train nuts in the railways, and rob was one of them. Growing up watching freight trains go past his front yard in Queensland planted the seed, getting a job in the railways didn’t help. On his wedding day, he got up early and with his best man, went photographing trains.

He has started a train site http://www.robertstrains.net. It’s not complete, but if you’re into trains or photography, you’ll find something of interest there.

Be warned, although rob has a good eye for photography, being published in multiple magazines, his web designing skills are interesting. I think rob has used every feature and widget available in the software he’s using. ;)

Oh, it’s 01/01/08, so Merry Easter.

FreeSWITCH and Google Talk

One of the reasons I chose to spend time with freeswitch over yate was google talk integration. Was a good choice, I think, for more than just gtalk.

The endpoint that talks to gtalk is mod_dingaling, and it’s not compiled by default. So to enable it, uncomment #endpoints/mod_dingaling from modules.conf in your source tree and recompile.

I had to install gnutls-devel to get gtalk working, but check freeswitch.spec for other build packages you might need.

The configuration is pretty straight forward. Make sure in conf/autoload_configs/modules.conf.xml mod_dingaling is loaded.

I set it up as a client, I think later I might play around with it as a server. My conf/jingle_profiles/client.xml looks like this:

<include>
  <!– Client Profile (Original mode) –>
  <profile type=”client”>
    <param name=”name” value=”gmail.com”/>
    <param name=”login” value=”michael.chesterton@gmail.com/gtalk”/>
    <param name=”password” value=”bellybutton”/>
    <param name=”server” value=”talk.google.com”/>
    <param name=”dialplan” value=”XML”/>
    <param name=”context” value=”public”/>
    <param name=”message” value=”Press Belly Button to Begin”/>
    <param name=”rtp-ip” value=”$${bind_server_ip}”/>
    <param name=”ext-rtp-ip” value=”$${external_rtp_ip}”/>
    <param name=”auto-login” value=”true”/>
    <!– SASL “plain” or “md5″ –>
    <param name=”sasl” value=”plain”/>
    <!– if the server where the jabber is hosted is not the same as the one in the jid –>
    <!–<param name=”server” value=”alternate.server.com”/>–>
    <!– Enable TLS or not –>
    <param name=”tls” value=”true”/>
    <!– disable to trade async for more calls –>
    <param name=”use-rtp-timer” value=”true”/>
    <!– default extension (if one cannot be determined) –>
    <param name=”exten” value=”5551212″/>
    <!– VAD choose one –>
    <!– <param name=”vad” value=”in”/> –>
    <!– <param name=”vad” value=”out”/> –>
    <param name=”vad” value=”both”/>
    <!–<param name=”avatar” value=”/path/to/tiny.jpg”/>–>
  </profile>
</include>

When editing conf/jingle_profiles/client.xml, pay attention to the line   <profile type=”client”> make sure it’s profile , and not x-profile. It comes as x-profile out of the box to stop it from loading. 5551212 is the phone gtalk calls will go to as defined by exten

One other thing is do is add a vcard to your directory entry, I added it to conf/directory/default/1000.xml and directory/default/5551212.xml, mine looks like:

<include>
  <user id=”1000″ mailbox=”1000″>
    <params>
      <param name=”password” value=”1234″/>
      <param name=”vm-password” value=”1234″/>
       <param name=”vm-mailto” value=”chesty@chesterton.id.au”/>
<!–
       <param name=”vm-email-all-messages” value=”true”/>
–>
    </params>
    <variables>
      <variable name=”user_context” value=”default”/>
      <variable name=”ruleset” value=”internal” />
      <variable name=”effective_caller_id_name” value=”Michael Chesterton”/>
      <variable name=”effective_caller_id_number” value=”1000″/>
    </variables>
    <vcard xmlns=’vcard-temp’>
      <FN>Michael Chesterton</FN>
      <N>
        <FAMILY>Chesterton</FAMILY>
        <GIVEN>Michael</GIVEN>
        <MIDDLE/>
      </N>
      <NICKNAME>Michael</NICKNAME>
      <URL>http://barrang.com.au/</URL>
      <BDAY>1974-11-21</BDAY>
      <ORG>
        <ORGNAME>Barrang</ORGNAME>
        <ORGUNIT>Barrang</ORGUNIT>
      </ORG>
      <TITLE>Owner</TITLE>
      <ROLE>Engineer</ROLE>
      <TEL><WORK/><VOICE/><NUMBER>5551212</NUMBER></TEL>
      <TEL><WORK/><CELL/><NUMBER>614205555</NUMBER></TEL>
      <TEL><WORK/><FAX/><NUMBER/></TEL>
      <TEL><WORK/><MSG/><NUMBER/></TEL>
      <ADR>
        <WORK/>
        <EXTADD/>
        <STREET/>
        <LOCALITY>Panania</LOCALITY>
        <REGION>NSW</REGION>
        <PCODE>2213</PCODE>
        <CTRY>Australia</CTRY>
      </ADR>
      <TEL><HOME/><VOICE/><NUMBER/></TEL>
      <TEL><HOME/><FAX/><NUMBER/></TEL>
      <TEL><HOME/><MSG/><NUMBER/></TEL>
      <ADR>
        <HOME/>
        <EXTADD/>
        <STREET/>
        <LOCALITY/>
        <REGION/>
        <PCODE/>
        <CTRY/>
      </ADR>
      <EMAIL><INTERNET/><PREF/><USERID>michael.chesterton@barrang.com.au</USERID></EMAIL>
      <JABBERID>michael.chesterton@gmail.com</JABBERID>
      <DESC>
        More information about me is located on my
        personal website: http://barrang.com.au/
      </DESC>
    </vcard>
  </user>
</include>

That will get you signed in to gtalk ready to receive and make calls. Now we need a dialplan to direct gtalk calls to a SIP phone. Part of my conf/dialplan/public.xml looks like:

<extension name=”public_did”>
  <condition field=”caller_id_number” expression=”^([^@]+)” break=”never”>
    <action application=”set” data=”effective_caller_id_number=$1″/>
  </condition>
  <condition field=”destination_number” expression=”^(5551212)$”>
    <action application=”set” data=”call_timeout=18″/>
    <action application=”set” data=”continue_on_fail=true”/>
    <action application=”set” data=”hangup_after_bridge=true”/>
    <action application=”bridge” data=”sofia/switch.gruntnet/1000,sofia/switch.gruntnet/1001″/>
    <action application=”answer”/>
    <action application=”voicemail” data=”default $${domain} 1000″/>
  </condition>
</extension>

The first condition field strips out the @ character from the caller id number, my e65 doesn’t like the @ character and rejects the call. Gtalk sets the caller id number as something like barrang.com@gmail.com/Talk.v1047F0FC7A5. The rest I’ve already talked about here

I’ve only tested setting up a call from an XP vm to my SIP enabled mobile phone, I haven’t tested audio yet. But I’m getting there, I’m waiting for a friend to install gtalk so they can test with me. Then I just need a dialplan entry so I can make gtalk calls from SIP clients.

FreeSWITCH and Voicemail

I updated my FreeSWITCH svn tree the other day and was surprised how much had changed. The configuration structure was completely rearranged. I had to start from scratch. Lots of new goodies, though.

My VoIP provider has their own voicemail system that kicks in after 20 seconds, there doesn’t appear to be a way to turn it off. I want to use my own voicemail using FreeSWITCH, so I’ve got to answer the call before 20 seconds are up.

First thing I needed was some sounds. There’s some prerecorded sounds available via make sounds-install, except it doesn’t work in trunk at the moment. They are easily downloaded manually, though. I chose http://files.freeswitch.org/freeswitch-sounds-en-us-callie-8000-1.0.pre3.tar.gz and http://files.freeswitch.org/freeswitch-sounds-music-8000-1.0.pre3.tar.gz

Unpack the files in /usr/local/freeswitch/sounds/. I found that FreeSwitch was looking for the sounds in (for example) /usr/local/freeswitch/sounds/en/us/callie/voicemail/ but the sounds unpacked to en/us/callie/voicemail/8000/. So I went through every 8000/ directory and moved the sound files to the parent.

Check in conf/autoload_configs/modules.conf.xml that mod_voicemail is being loaded. There’s a few things to edit in conf/autoload_configs/voicemail.conf.xml, the main one being the storage-dir. I created a directory /usr/local/freeswitch/vm and set <param name=”storage-dir” value=”/usr/local/freeswitch/vm”/>. The only other thing that really needs setting is email-from. I haven’t setup email yet.

Now we just need a dialplan to send unanswered calls to voicemail

<extension name=”public_did”>
  <condition field=”destination_number” expression=”^(5551212)$”>
    <action application=”set” data=”call_timeout=18″/>
    <action application=”set” data=”continue_on_fail=true”/>
    <action application=”set” data=”hangup_after_bridge=true”/>
    <action application=”bridge” data=”sofia/switch.gruntnet/1000,sofia/switch.gruntnet/1001″/>
    <action application=”answer”/>
    <action application=”voicemail” data=”default $${domain} 1000″/>
  </condition>
</extension>

In this plan, when someone calls 5551212 (that’s the number my VoIP provider sends calls to) we set the timeout to 18 seconds, so if it’s not answered before then, it goes to voicemail.

continue_on_fail means if the bridge fails for whatever reason, one being no one answered it, continue processing the rest of the plan so the call goes to voicemail.

hangup_after_bridge means if someone answered the phone within the 18 seconds, then stop processing the rest of the plan when the call terminates, ie, don’t send it to voicemail.

I’m sending the call to two phones in parallel, 1000 and 1001. If neither of them pickup the call, FreeSWITCH answers the call, and launches the voicemail application, sending the call to voicemail box 1000

I commented out <param name=”vm-email-all-messages” value=”true”/> in conf/directory/default/1000.xml because I haven’t setup email yet. Plus if you do enable that option, the messages aren’t saved on FreeSWITCH, they get emailed and deleted.

The only other thing left to do is call 1000 from 1000 to access voicemail, and setup a greeting

Annoyingly my Nokia E65 doesn’t appear to subscribe to new message notification. So I’m going to have to setup some sort of email/sms solution later to alert me of new messages

Flashback

I just had a flashback.

When I was in primary school, we had this cross country race with other schools in the area. The pace was full on, and a friend and I decided we’d walk. It was all bush, no one could see us and the teachers started to worry, we were taking so long.

By the time we appeared from the bush onto the home straight, my friend started jogging ahead of me, so I jogged past him, no one wanted to finish last. Then the sprint was on for second last place. As we reach the finish line everyone was cheering us on, pumped up by the cheering we ran faster and faster. I started falling behind and hurting, so I stopped running and walked over the line in last place.

People seemed angry at me, why did you give up so close to the line, they were saying. Our teacher caught up to us, she was furious, where were you, she said. You took so long, everyone thought you were the leaders of the race that started after you, that’s why they were cheering.

Happy Days.

Freeswitch – Softswitch, Softphone, PBX

I’ve somewhat been following the development of FreeSWITCH, described as a softswitch, although I see they’ve added PBX to the description now.

It’s still in beta, about to be released any day now(tm). It doesn’t have the features of asterisks out of the box, however, it’s extendable with javascript, perl, python, java, C of cause, and more. Its main advantage for me is its efficiency and stability, it’s able to handle 6000 simultaneous calls. 6000 calls isn’t that useful to me, but being able to use a lower powered box is

It’s a well run project, with lots of activity on IRC and the lists. I’ll attach a working PBX config below with a few softphones and a SIP gateway

Read More »

Facebook

This really blew me away, follow the money…

facebook

Be careful kids.

Amazing Grace

One of my all time favourite songs (and bands).

I remember first hearing this on the abc on some sports panel show, can’t remember the name, but they moved to a commercial channel and died soon after, grrr. I was hypnotised, it’s very deep and I’m not even a little religious.

I can’t even remember how the original tune of amazing grace goes, I’ve listened to this version so many times.

Blue Tongue Harmonica Talk CD

I got Blue Tongues Harmonica Talk CD recently. It sounds great and it’s nice and easy to listen to. It’s described as blues and country harmonica fundamentals, and I was surprised how easy it was to pick up blues techniques when they are broken down into their individual parts. It’s a bit more difficult stringing them together, but practice, practice, practice ;)

A few weeks of practicing along with the cd and I’ll get some lessons I think. Might have to dig out the guitar, too.