I know I said last week we would tackle IAX client configuration, but I was at a customer site today and they called me down to reset a password and change a few names for voicemail. So I promised her to write my weekly piece on the subject so she and others have a reference for resetting voicemail boxes.
When you are done with this tip of the week, you should be able to add voicemail extensions, change names, change passwords and enable Asterisk voicemail as an e-mail attachment. Sending the voicemail as an e-mail attachment is a great way to recieve and archive e-mails. The extensions.conf and sip.conf are located on the previous two post. They are still on the blog so you may reference them.
1) Open a terminal window. If you need to access the server remotely Download an SSH (Secure Shell) client to access the Asterisk server. You can use Secure Shell from a vareity of Microsoft Windows clients freely available on the world wide web. If you have Linux or Mac OS X just read the man files from a terminal.
example:
[matt@localhost ~]$ man ssh
NAME
ssh - OpenSSH SSH client (remote login program)
SYNOPSIS
ssh [-1246AaCfgkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec]
[-D port] [-e escape_char] [-F configfile] [-i identity_file] [-L
port:host:hostport] [-l login_name] [-m mac_spec] [-o option]
[-p port] [-R port:host:hostport] [-S ctl] [user@]hostname [command]
DESCRIPTION ssh (SSH client) is a program for logging into a remote machine and for executing commands on a remote machine. It is intended to replace rlogin and rsh, and provide secure encrypted communications between two untrusted hosts over an insecure network. X11 connections and arbitrary TCP/IP ports can also be forwarded over the secure channel. ssh connects and logs into the specified hostname (with optional user name). The user must prove his/her identity to the remote machine using one of several methods depending on the protocol version used.
If command is specified, command is executed on the remote host instead of a login shell.
2) After we log in succesfully, go to the /etc/asterisk directory. Oh by the way, if you are not logged in as root use the 'su' command to become the 'root' user. The 'root' user account is the account for administrators.
example:
[matt@localhost ~]$ cd /etc/asterisk
[matt@localhost asterisk]$ su
Password:
[root@localhost asterisk]#
Notice now that it says [root@localhost asterisk] instead of [matt@localhost asterisk]$.
3) Now it's time to edit the voicemail.conf which is located in the directory we just changed to '/etc/asterisk'. I'm using nano to edit the file, but pico, vi, emacs, or any text editor will do.
example:
[root@localhost asterisk]$ nano voicemail.conf
[general]
format=wav
attach=yes
9250 => 1000,matt,mattb@voiceipsolutions.com
9251 => 1000,some one,some1@voiceipsolutions.com
The voicemail.conf file is very easy to read. The first four digitits represent the extension number (as defined in extensions.conf). So my desk extension from inside the office is 9250. The second string of numbers is the password. The third is the name of the person whom owns this paticular box. In this case it's Matt, which is me. The fourth part is the e-mail address that asterisk will send a copy of the voicemail to.
So if for example user 1 forgot his password, I could follow these steps and change the password to 0000. User 1 would then dial intoo his password and change it from his phone to whatever he wanted.
example:
[general]
format=wav
attach=yes
9250 => 1000,matt,mattb@voiceipsolutions.com
9251 => 0000,some one,some1@voiceipsolutions.com
Or, if for example if I fired myself and VoiceIP Solutions hired an imaginary person called Lawson. The voicemail.conf would look like the example below. Keep in mind I'm changing the password to a default of '0000'. You can make the default whatever you like. I also want him to recieve copies of his voicemail as an attachment to his e-mail box.
example:
[general]
format=wav <------- This is value determines format for e-mail attachments I like
GSM or WAV
attach=yes <------- this value determines whether asterisk sends out voicemails as e-
mail atttachments
9250 => 0000,Law,law@voiceipsolutions.com
9251 => 0000,some one,some1else@voiceipsolutions.com
NOTE: you don't want my notes typed in the voicemail.conf.
Once you made your changes save voicemail.conf.
4) Now we have to reload Asterisks config files. I'm assuming asterisk has been running this whole time. There is no need to shut the server down for minor updates. When asterisk command line comes up type 'reload'.
example:
[root@localhost asterisk]# asterisk -r
Asterisk CVS-v1-0-10/13/05-13:41:20, Copyright (C) 1999-2004 Digium.
Written by Mark Spencer
-------
Connected to Asterisk CVS-v1-0-10/13/05-13:41:20 currently running on localhost (pid = 21007)
localhost*CLI>reload
After Asterisk reloads the configs type 'exit' and close your SSH terminal. Thats it. Not much too it to change basic voicemail options. Next week we'll get to trickier IAX tunnels or clients.
Note: My name is Matt Birkland, I work as a VoIP Engineer for VoiceIP Solutions an Asterisk Provider in Washington State. Every Monday I will be submitting a one page Asterisk/VoIP tip of the week on the blog. This week we will discuss voicemail.conf configuration and walk through the dial plan in this regard.