Sunday 16 September 2012

Hotkeys

16:29 Posted by Jurgens Krause , No comments
This one is just for Windows users.

If you haven't heard of the application "Autohotkey" might I suggest you have a look. It enables you to create complex scripts to automate repetitive tasks.

Installation is quite simple, just download and run the installer.

Once you have it up and running simply right click on the icon in the taskbar, and select "Edit this script". The default script only has one shortcut:

^!n::
IfWinExist Untitled - Notepad
WinActivate
else
Run Notepad
return


Let's take a look at what it does:
First it defines the hotkey, in this case:
^ - ctrl
! - alt
n - n

When the hotkey (ctrl+alt+n) is pressed:
IfWinExist Untitled - Notepad - Checks if notepad is running
WinActivate - If true it brings it to the foreground and puts focus on it
else
 Run Notepad 
- self explanitory (though if you use an application not reference in the system %path% varable you have to give the full path)
return
- end of hotkey

as a further example, this is the shortcut I use to ping the address currently in the system clipboard

^!p::
address=%clipboard%
run, ping %address% -t
return

If you have any other cool ideas on using hotkeys, let me know.

Tuesday 11 September 2012

Asterisk Call Groups

18:31 Posted by Jurgens Krause , , 1 comment
A large part of my work centers around managing Asterisk based Virtual PBXes. Now, I know very little of Asterisk, so as I learn I will share what I learn in the home of helping out other people who struggle.

Intercepting Calls on Asterisk (or CallGroups) as the clever people call it.

Say that your client has a switchboard, and six extensions in the office. Someone calls the office, knows the extension they want to reach and by the magics of Asterisk IVRs they manage to connect themselves directly to Joe. Now, Joe is at the water cooler chatting with a colleague and is thus unable to hear his phone ring. Martha at the switchboard however does hear it ringing, and feels the urge to answer it. How would you set up the Asterisk server to allow this?

Well, it is really quite simple:

What you need to do is assign a callgroup and a pickupgroup as shown below. But first, what is a:
callgroup:
A callgroup is simply a way of grouping extensions that share some common function, ie. all the extension in the "Sales" department

pickupgroup:
The pickupgroup directive, when assigned to an extension, shows which callgroups' calls can be intercepted or picked up by the relevant extension

Practical:

Open up sip.conf (usually it can be found in /etc/asterisk/sip.conf)

Here you will find many sections, called "Contexts"

Find the context matching your Switchboard extension ie. [100]. It might look something like this:
-------
[100]
type=peer
host=dynamic
context=international
disallow=all
allow=g729
qualify=yes
secret=superawesomepassword
nat=yes
canreinvite=no
canredirect=no
----------

To the bottom of this add the pickupgroup directive:
pickupgroup=1

This tells Asterisk that extension 100 can intercept any call ringing on any phone in callgroup 1

Now, no extensions have yet been assigned to callgroup 1 so to remedy that, find  the context matching the extension that you want to place in the callgroup and simply add the callgroup directive, like so:
[101]
type=peer
.
.
.
callgroup=1

The switchboard (ext 100) will now be able to pick up a call ringing on extension 101 simply by pressing *2# on their handset (sometimes just *2)



And there you go, Asterisk callgroups in a nutshell. Of course there is much more you can do with callgroups, and we will take a look at that in the future.