UPC vs. SilverServer

After some troubles with UPC I have recommended a customer to switch to SilverServer now that the new SilverServer line is online I did a short ping test:

UPC:
64 bytes from 212.186.221.xxx: icmp_seq=0 ttl=42 time=93.281 ms
64 bytes from 212.186.221.xxx: icmp_seq=1 ttl=42 time=94.791 ms
64 bytes from 212.186.221.xxx: icmp_seq=2 ttl=42 time=96.175 ms

Silverserver:
64 bytes from 188.118.220.xxx: icmp_seq=0 ttl=52 time=4.737 ms
64 bytes from 188.118.220.xxx: icmp_seq=1 ttl=52 time=4.438 ms
64 bytes from 188.118.220.xxx: icmp_seq=2 ttl=52 time=4.192 ms

I think I’ve made my point …

… did I mention that the UPC line is a Business Line which costs about 200 Euros/Month ?

Coincidence ?

Kind of sounds similar doesn’t it

well … I love both :)

Getting started with adhearsion

If you want to give adhearsion a try, here is a quick introduction in how to set it up and do your first tests.
This little howto was made on a Mac but it should be usable for linux without any problems, except for the Asterisk paths.
So, let’s get started. First we need asterisk for Mac OS, we can get this here: http://mezzo.net/asterisk/ after installing asterisk, let’s get the adhearsion gem

$ sudo gem install adhearsion
Successfully installed adhearsion-0.8.4
1 gem installed

after adhearsion was installed, you should install some softphone for testing. I recommend using blink on Mac OS.

Now let’s create a first project to play around.

$ ahn create test
      create  
      create  components/simon_game
      create  components/disabled/stomp_gateway
      create  components/disabled/sandbox
      create  components/ami_remote
      create  components/disabled/restful_rpc/spec
      create  config
      create  .ahnrc
      create  components/simon_game/simon_game.rb
      create  components/ami_remote/ami_remote.rb
      create  components/disabled/stomp_gateway/stomp_gateway.rb
      create  components/disabled/stomp_gateway/stomp_gateway.yml
      create  components/disabled/stomp_gateway/README.markdown
      create  components/disabled/restful_rpc/restful_rpc.rb
      create  components/disabled/restful_rpc/restful_rpc.yml
      create  components/disabled/restful_rpc/README.markdown
      create  components/disabled/restful_rpc/example-client.rb
      create  components/disabled/restful_rpc/spec/restful_rpc_spec.rb
      create  components/disabled/sandbox/sandbox.yml
      create  components/disabled/sandbox/sandbox.rb
      create  config/startup.rb
      create  dialplan.rb
      create  events.rb
      create  README
      create  Rakefile

Now we need to set up asterisk extensions.conf for our first adhearsion project. So let’s open /Library/Asterisk/conf/extensions.conf and search for the [default] section and add exten => _X.,1,AGI(agi://127.0.0.1) right at the beginning.
It should now look like this:

[default]
;
; By default we include the demo.  In a production system, you
; probably don't want to have the demo there.
;
exten => _X.,1,AGI(agi://127.0.0.1)

Why the default? For the purpose of testing, this is the fastest way. You can of course use something different, but keep in mind that this MUST match what you will have in your adhearsion dialplan.rb ! But more on that later.

Now open dialplan.rb from your freshly created adhearsion project in your favorite editor.
Remove the lines from the example

adhearsion {
  simon_game
}

And replace them with our first example:

default {
  ahn_log " Extenstion #{extension} was dialed"
}

Note that the default here must match the section of your extensions.conf, so if you used [my_cool_ivr] then your dialplan.rb must look like this:

my_cool_ivr {
  ahn_log " Extenstion #{extension} was dialed"
}

So now start asterisk

$ asterisk -cvvvvv

Start your ahn project

$ ahn start test
 INFO ahn: Adhearsion initialized!
[Sat Jul 24 20:33:55 2010] Adhearsion::VoIP::Asterisk::AGI::Server::RubyServer 0.0.0.0:4573 start

And start Blink and dial 100@127.0.0.1, nothing exciting will happen, but if you check your session where you started adhearsion you will see

[Sat Jul 24 20:34:45 2010] Adhearsion::VoIP::Asterisk::AGI::Server::RubyServer 0.0.0.0:4573 client:64178 localhost<127.0.0.1> connect
 INFO ahn:  Extenstion 100 was dialed

So with very little effort you now have connected Asterisk to ruby, pretty cool. Well, let’s do something more exciting now.
Open up dialplan.rb and add some code in it.

default {
  ahn_log "Extenstion #{extension} was dialed"
  case extension
    when 100
      play "agent-pass"
      login=input 4, :timeout => 1.minute
      ahn_log "got login #{login}"
      if login=="1234"
        play "agent-loginok"
      else
        play "agent-incorrect"
      end
    else
      play "ss-noservice"
  end
}

So if you dial 100@127.0.0.1 you will be asked to enter a pin, with the line login=input 4, :timeout => 1.minute you are telling asterisk that you want 4 digits, and there should be a timeout if nothing happens in one minute.

I did intend to show off some conference features … but it turns out the binary build of asterisk for mac os is missing app_meetme so until I figure that one out I’ll just leave this as it is.

Use Adhearsion to check Asterisk

If you have a business depending on asterisk you need to be sure that everything is running. You could use Nagios or Monit to check if asterisk is running, but is it also working? What about your AGI Server? Is it doing what it’s supposed to do?

The best way to find out if this works would be to call and see if the call is accepted and if you get something back from your AGI server and you can do this with automatically with Adhearsion!

What you will need is a wav file containing a DTMF sequence. You can create one with Adobe Audition for example (aka Cooledit before Adobe took over). The Trial version is enough to create the DTMF. Use a 300ms pause at least the other settings didn’t really work for me. Also don’t forget to set your Asterisk server to dtmfmod=inband.

I created a new adhearsion project and used the Simon game as start of and modified it to look like this:

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
methods_for :dialplan do
  def check_call
    CheckCall.new(self).start
  end
end
 
class CheckCall
 
  def initialize(call)
    @call = call
    @number='12345'
  end
 
  def start
    collect_attempt
    verify_attempt
  end
 
  def collect_attempt
    @attempt = @call.input @number.length,
      :timeout => 10.seconds    
  end
 
  def verify_attempt
    if attempt_correct? 
		# do something here
    else
		# do something else
    end
  end
 
  def attempt_correct?
    @attempt == @number
  end
 
end

What this does is check if the called server sent the DTMF sequence 12345 and if not it would do something.

You cold for example use growl and/or prowl for notification or use some SMS service for notification like lcx.at (I know, shameless self promotion).

Also don’t forget to activate drb in your adhersion project, do this in startup.rb

config.enable_asterisk
config.asterisk.enable_ami :host => "localhost", :username => "amiuser", :password => "amipassowrd", :events => true
 
config.enable_drb :host => "0.0.0.0", :deny => "0.0.0.0", :allow => ["127.0.0.1", "213.123.118.123"]

Ok now all we need is the script that triggers the call. This could look like this:

require 'drb'
@adhearsion = DRbObject.new_with_uri "druby://localhost:9050"
result = @adhearsion.originate({ :channel   => "SIP/....", 
                                 :context   => "checkcall", 
                                 :exten 	=> '4000',
                                 :priority  => 1,
                                 :callerid  => "43123456789",
                                 :async => 'true',                                     
                                 :variable  => "call_launcher=true|sleep_time=3600" })

So, this is it. I know this isn’t really a copy & paste howto, some things are missing but I don’t want to repeat things that can be read in the adhearsion documentation.
Oh, what I forgot to mention, I use a separate server which runs Asterisk to do the checks, the checks are NOT done form the same server I am checking, but I think this should be obvious.
If you need a VPS with this Setup, or need someone to verify your VoIP Servers, feel free to contact me!

Long time no blog

A long time has passed since my last blog. But time is something I don’t really have right now. Actually even now I have some deadlines approaching and I should be rather working day and night then writing blogs but I thought it’s time to feed my blog a little bit.

So, my last blog I wanted to write was about our trip to Malaga, Spain. Well it didn’t start that good. As some might have heard Sky Europe is broke and disappeared completely from the market. But let me tell the whole story.

We arrived in Bratislava by bus and looked at the Delays, our flight was about 2 hours late. That was bad but it could be worse. The flight to Alicante was over 12 hours late. Anyway, even 2 hours can be terrible in Bratislava airport. It’s very small and you can’t do anything.
But finally we arrived in Malaga just to wait in a huge line to pick up our car from the Car Rental.
Here a hint for someone traveling to Malaga and Renting a car from Carjet (carjet.co.uk) or Goldcar Rental. The prices seem very cheap at the first look but keep in mind that Goldcar works with a Full/Empty policy. This means, you get the car with a full tank and have to return it empty and when you pick up the car you have to pay the full tank. A full tank for a Ford KA kosts about 35 euro (at least that was the most I paid during our holiday) and Goldcar charged 60 Euro. So in the end you are more expensive the Sixt for example. But enough about that.

So after the first two days of holiday I got a call from a friend who told me that Sky Europe isn’t flying anymore. He was Stuck in Greece and we where now stuck in Spain. Thanks to Air Berlin we did get tickets for the same day we planed to return to Vienna and they gave us the tickets a bit cheaper.
The irony is that before buying the tickets with Sky Europe we wanted to buy tickets with Air Berlin but somehow decided to Fly to Portugal and then finally changed our minds again and wanted to go to Malaga again and the Tickets with Sky Europe where a bit cheaper.

Well, we learned our lesson. The flight with Air Berlin was great, on time, you get something to drink, newspapers, food and the price is ok. The worst part of Skyeurope was always that they had delays, didn’t really care much about the fact that you had to pay for drinks or food. But sitting around in the airport for hours is a waste of time.

Holiday

Finally time for a holiday, time to relax and do some “mint rubbing” :)

Photos will be uploaded here from time to time

Outlook 2007 Error: None of the Authentication Methods Supported By This Client Are Supported By Your Server

I was testing Zimbra with several mail client. Everything worked fine (Thunderbird, Mac Mail, …) except outlook. Outlook always complained “None of the Authentication Methods Supported By This Client Are Supported By Your Server”.
I found several hints on the net about how to solve this but none of them helped.
After checking and rechecking the Account settings I noticed that encryption type for SMTP and IMAP where both set to “None” even if you tell outlook to use encryption. So here is what you have to do to get it working:

1. In the account settings click on “More Settings …”

2. On the Advanced Tab, change the encryption type from “none” to what ever works with your server, or just try “auto”

I really can’t understand why “none” is the default … but who understands Microsoft …

Summer in Austria


Intalnirea Broscutelor Timisoara 2009


Intalnirea Broscutelor Timisoara 2009
Intalnirea Broscutelor Timisoara 2009

Wörthersee 2009

photo.jpg

Next Page »