Danny Tsang
image_alt_text

1

Sep/10

Kick A Linux User Who’s Logged In

Filed Under Linux at 1st September 2010 0:01 by Danny
Tags: , , ,

In command line type in who or w will list all the users who are currently logged in.

To log them off type in the following:
pkill -KILL -u danny

where danny is the username. If ‘danny’ was logged in multiple times e.g locally and via ssh then both will be logged off.

Linux logout user or logoff user commands

26

Aug/10

Change Default Crontab Editor

Filed Under Linux at 26th August 2010 8:53 by Danny
Tags:

To change the default crontab editor type in the following command:
export EDITOR=nano
Change nano for your preferred editor.

Crontab editor

19

Aug/10

FreePBX – Common Voicemail Box

Filed Under Blog at 19th August 2010 0:01 by Danny
Tags: , , ,

Overview

I have several extensions on my Asterisk / FreePBX box but currently only one landline. Ring groups solved the problem of one incoming call ringing multiple handsets but there was only one official solution to sharing voicemail.

Voicemail Blasting (VMB)

VMB is a way of disseminating incoming voicemail to multiple voicemail boxes. For example someone lease a message on voicemail for one extension. When the person has finished leaving a message, VMB copies that message and puts it into designated extension voicemail boxes for other extensions to receive. The problem with this setup is that the voicemail may be heard from one extension and deleted but it still remains on others.

Symbolic Links To The Rescue

I found a neat trick to fool FreePBX / Asterisk to get multiple voicemail boxes pointing to one. The great point about this is that each extensions keeps most of their settings separate so things like password can be different for each extension but the messages are shared. This means one person can delete the message from one phone and another user will not see the message (maybe except in the trash).

How To

I have FreePBX running on a Ubuntu 10.04 install. First thing is to create all the extensions and enable voicemail on all of them.

Identify the one extension which will be shared amongst all others e.g 200.

Go to /var/spool/asterisk/voicemail/default Check if there’s a folder with the extension number of your designated voicemail. If not leave a message on extension 200 and it should create one.

Remove all other extensions which should share the same inbox as extension 200, e.g 201 and 202 sudo rm -rf 201 and replace 201 with 202 etc.

Switch user to the Asterisk user. This is needed because the original directories were “owned” by the Asterisk user. Once created also ensure the symbolic links have at least the same or more permissions as extension 200 (or the shared voicemail box) sudo su asterisk

Create a symbolic link to 200 with the previously removed folder names ln -s 200 201ln -s 200 202

Summary

This is a cool trick which should be transparent to FreePBX / Asterisk unless they change the way voicemail works. Updates and modules should not see any difference because the symbolic links point to a real directory.

Also it is easy to revert any extension back to having their own voicemail box or even create multiple shared voicemail boxes by removing the sym link and creating a new one to point to another extension directory.

How to make multiple extensions use a common voicemail box

11

Aug/10

How To Start Oracle Enterprise Manager

Filed Under Software at 11th August 2010 21:40 by Danny
Tags: , ,

Specify the SID
export ORACLE_SID=
Start the enterprise manager
emctl start dbconsole

How to start Oracle Enterprise manager

7

Aug/10

Adding Outgoing Skype For SIP To FreePBX

Filed Under Networking, Software at 7th August 2010 0:01 by Danny
Tags: , , , , , , , ,

Overview

Skype has allowed other PBX software to connect to Skype using the standard protocol SIP. This is a good start to opening up Skype’s network to what is used around the world however it still lacks some features which Skype For Asterisk does offer such as calling Skype users.

Cost

At the time of writing it costs £4.95 per channel so for 1 incomming and 1 outgoing it will add up to approximately £9.90 + buying the phone number itself for £3.95 per month. This all soon adds up to more than a traditional PSTN landline. Also you need to add Skype credit to the account which are for call time.

Outgoing Channel

For my testing purposes I had only bought one channel for out going calls. I have a landline so people would call that number and the outgoing channel can be used for calls going out to people at a cheaper rate. This means the costs per month is £4.95 + Skype credits.

Setup – Skype

Create a business account on Skype and log into Business Manager for Skype.

Create a new profile in Skype Connect giving it a meaningful name. Once created the important details to note are the SIP User, Password, Skype for SIP address and UDP Port.

Setup – FreePBX

Setting up Skype for outgoing calls in FreePBX is really simple.

Log into FreePBX admin and click on the Trunks menu > Add Trunk

Enter the following details:
General Settings:

    Trunk Name:
    Outbound Caller ID:
    CID Options: Allow Any CID (but can be changed to personal preference)
    Maximum Channels:

Outgoing Settings:

    Trunk Name:
    Peer Details:
    username=1235456786
    type=peer
    secret=password
    qualify=yes
    nat=yes
    insecure=invite
    host=sip.skype.com
    fromuser=1235456786
    disallow=all
    context=from-trunk
    allow=ulaw&gsm&alaw

    Change the above peer details:
    username, fromuser=SIP User
    secret=Password
    host=Skype for SIP Address

Registration:

    Register String: :@

    e.g
    13456725235:myPassword@sip.skype.com/13456725235

Save the changes.

Go to Outbound Routes and add a new route with the Skype trunk create above. The only thing to remember is that Skype must use international number dialing so an outbound route can be create to append the country code if necessary.

Configuring an Asterisk PBX with Skype for SIP

How to configure Skype for Asterisk as an outgoing trunk in FreePBX