Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Building Telephony Systems With Asterisk (2005).pdf
Скачиваний:
45
Добавлен:
17.08.2013
Размер:
1.82 Mб
Скачать

Chapter 4

We can use one or more options for each user. Some of the options to be aware of are: tz to set the timezone, as defined in [zonemessages] above, attach, which tells Comedian Mail whether this particular user wants to have their voicemail file attached to the email, saycid, which can make Comedian Mail speak the Caller ID of the caller who left the message, and operator, which allows us to define whether the caller can press 0 to get an operator while leaving a message. Each option is separated by the pipe ("|") symbol.

So, if we wanted to have a normal voicemail box for extension 1000, with a password of 1234, and accepting all of the defaults, and not sending email, we would have a line like the following in voicemail.conf:

1000 => 1234,Example Mailbox

Now, suppose we wanted to set up a little more of an advanced example. Suppose Joe User, on extension 1001, with a password of 123456789, has an email address of juser@domain.tld, no pager, and lives in the Central timezone. He wants his voicemail message attached to his email, wants Comedian Mail to speak the Caller ID, and wants his callers to be able to press 0 for an operator. His voicemail box line would look like:

1001 => 123456789,Joe User,juser@domain.tld,,tz=central|attach=yes| saycid=yes|operator=yes

Great! We have just configured a fully-functional voicemail box. In a similar fashion, we can now create all of the voicemail boxes we need.

Music On Hold

Using music on hold, Asterisk enables us to stream MP3 files to any handset or line. These streams are commonly used for Music on Hold and for the music played while people are waiting in a queue. Each stream is configured in /etc/asterisk/

musiconhold.conf.

Asterisk gives us the flexibility of defining multiple instances of MOH, referred to as classes. Each class can use a different directory of MP3s and a different mode. For our purposes, we will only be using the mode called files. This mode allows us to use Asterisk's native players to stream music on hold.

Asterisk's definition of Music on Hold has change quite a bit for version 1.2; therefore, if we have some older configuration files from 1.0.x, we will need to update them for the new release.

Using Asterisk's native player also allows us to have our Music on Hold in various formats that Asterisk supports. Our PBX will determine the best format to play; therefore, transcoding may be avoided if we create our Music on Hold files in the format our channels are in.

There are two main directives we need to be aware of: mode and directory:

63

Configuring Asterisk

Mode refers the the mode we previously discussed. We will be using files, meaning we will use Asterisk's native player.

Directory simply points Asterisk to the directory holding the Music on Hold files.

If we choose to shuffle the music on hold media files, we can simply add the directive called random, and set it to yes.

A typical Music on Hold class would look something like this:

[default]

mode=files directory=/var/lib/asterisk/music-on-hold random=yes

That's all there is to it! We have now defined two different classes of music. Now, we need to put in an entry for each different stream of MP3s we want our phone system to have.

Queues

As we discussed in Chapter 2, queues give us a logical place to put callers until we are ready to answer the calls. Queues are a very flexible and powerful tool to improve customer service, and better utilize our personnel.

When we edit /etc/asterisk/queues.conf, the first sections we will have are [general] and [default]. Neither of them is used yet.

Below these headings, we come to where we will define our queues. For simplicity's sake, I recommend we name the queue according to the main extension that will represent it. For instance, if on our worksheet we entered that the queue would be dialed from extension 1000, I would define the queue thus:

[1000]

Now we need to set the parameters for the queue. First, we set the music that the callers will hear until their call is answered. This is done by setting the music variable, like this:

music = q1000

We are stating that the queue should play the music indicated in the q1000 class of MOH, as defined in musiconhold.conf. Each queue can have its own music, or it can use the default MOH.

Next, we define an announcement, if we wish to have one. This will play a audio file to the agent when he or she answers the queued call. We might find this helpful if we have agents answering multiple queues, to tell them which queue calls come from as they answer. If we use this, be sure that we have a file in /var/lib/asterisk/sounds/

<promptfilename>.<extension> that works.

announce = <promptfilename>

64

Chapter 4

Notice that we do not need to use the extension in the configuration file: Asterisk will recognize valid files. However, even though we don't have to put the extension on the file name in the configuration file, it must still have the correct extension in the

/var/lib/asterisk/sounds directory.

Now we need to define our strategy. We should have decided this on our worksheet. For example, if we wanted to use the ringall strategy, we would enter:

strategy = ringall

If we do not define a strategy, Asterisk will default to ringall.

We may now define an escape context. We have not yet explored the full meaning of a context, but will be doing so soon. If we checked the box indicating that our users should be able to escape, we will call the context by the name of this queue, followed by the word out. Therefore, for this example, it would be:

context = 1000out

Now we get to set the timeout. This is how long each handset will ring before the queue will consider the call unanswered. We should set this to be the longest reasonable time that we expect our agents to take to pick up the phone. In our case, our agents do not use headsets, and answer questions on the computer. Therefore, they should be given 15 seconds to answer the phone before we assume that they are away from their desk.

timeout = 15

Next, we define the amount of time we wait before trying all of the extensions again. As our company handles many calls, and we want our customer to have the shortest possible wait time, we will define it to be 0 seconds.

retry = 0

Now we can set a limit on how many calls will be enqueued. Since we want to allow every caller to enter the queue, we will set this to 0.

maxlen = 0

On our worksheet, we decided if we wanted to announce callers' positions in the queue, along with an estimate of how long they can expect to be kept in the queue. First, we enter how often we want these announcements. Since I want it to happen every two minutes, I will set it to 120 seconds. If I wanted to have no announcements, I would enter 0.

announce-frequency = 120

Now we set whether or not to give estimates of waiting time when the current queue position is announced. Valid options are yes, no, and once, meaning the queue application will announce the position only once, when the caller first enters the queue. Since I do want to announce their estimated wait time, I enter:

announce-holdtime = yes

65

Configuring Asterisk

Next, we can define filenames for the announcement. As the defaults work for us, we will not change them. If we started serving people who spoke a different language, we could change the recordings to use each user's native tongue.

Finally, we define our members. We have a bit of flexibility in defining this. We can either define them as being agents in the queue, or we can hard-code the members to be handsets. Since we want to do things right, we will define the members to be agents.

member => Agent/007 member => Agent/777

Notice that this only means that we have two members assigned to the queue, Agent 007 and Agent 777, as defined in agents.conf.

We can now go on and define other queues, in exactly the same way as above. There is no built-in limit to the number of queues we can define. It depends only on the resources of the server.

Conference Rooms

We now configure our conference rooms. These are defined and configured using the file

/etc/asterisk/meetme.conf.

This file is among the simplest configuration files we will encounter. When we open the file we see something like:

;

;Configuration file for MeetMe simple conference rooms

;for Asterisk of course.

;

[rooms]

;

; Usage is conf => confno[,pin] ;conf => 1234

;conf => 2345,9938

As you can see, we have only to define the conference number. We have the option of creating a PIN, to give some level of security to the conference room. In the above configuration file, two conference rooms were created. The first had no password set, and is conference number 1234. The second, conference 2345, will require that people enter the password of 9938 before they can join the conference.

For ease of administration, I suggest we start off using the same conference number as the extension that we're going to call it. As we move around the configuration files we see the advantage of using an extension number as name, especially when trying to troubleshoot a configuration.

66