In this topic, I will try to tell you about an attempt to organize a budget `virtual telephone office`.
And so, initially there is:
- a couple dozen small offices (tenants).
- telephony coming with them
- custom SIP phones and softphones.
- the desire of some clients instead of just a phone on the table, to have features: auto secretary / schedule / voice mail / call recording and unwillingness to have a real PBX and administrator for this business.
- our desire to do well to customers.
- a system administrator who knows scary words like linux and asterisk.
attempt to realize the desires of customers by investing only in the server, under the cut.
')
Googling, it was decided to dig in the direction of
asterisk or
freeswitch .
Googling it was also discovered that a large number of 'virtual office' offers for an asterisk are either `five single-level IVR points` or an asterisk with
FreePBX installed in a virtual machine (for some reason they like OpenVZ very much). It was decided to abandon FreePBX in a virtual machine so far - the interface is not for the user, and an administrator should be attached to each such asterisk, and a bunch of asterisks in virtual machines should not be ice. There is an interesting thing for FS, which seems to be Multi-Tenant -
blue.box , but so far we are looking carefully at FS (with an asterisk you have more experience), so, too, so far they have passed by.
On request, the
virtual PBX gives Google a bunch of links, almost all of which are actually providers' offers, for example, something like 'LIGHT' which is now in
octopus and Rostelecom is nice, but it will not work, either expensive or sell only service.
A little more searching you can google
VitualPBX , without any frills in the goo, but on the asterisk to which you can finish what is yours.
Judging by the
documentation Wishlist users:
- auto secretary
- schedule
- voice mail
- call recording
and ours:
- asterisk + user isolation
- management from one place
- local calls between offices in the same building
several dozens of them are not always telephone there, but for some it may be useful features.
Actually we will customize it.
We look at the current version on the
main page (latest VMWare image) and download it.
Now it is: VM Ware image with the number
8645 9613 (
virtual-pbx.ru/en-downloads.html ).
Check for updates and if there is, also download the latest .tgz.
For those who have installed the previous version, the update will look like this:
cd /tmp wget http://virtual-pbx.ru/updates/vpbx/VirtualPBX-8645.tgz tar -xzvf VirtualPBX-8645.tgz cd VirtualPBX-8645 rpm -Fvh *.rpm
We make a pre-setting for the documentation , and then go to the administrator interface:
_https: // server_ip / ai_
In the list of groups, select the default group and correct the settings we need, we had it:
- Dialout asterisk context (changed to vpbx-local)
- Maximum Number of Schedule items in ext
- + limits
- We allow the use of all additional features.

A rough plan of what I want to do as a template for each user:
- register the number with the provider (transfer from the IP phone to asterisk)
- get phone numbers (we connect IP phones and softphones to our virtual-pbx)
- inbound / outbound routing
- make a standard IVR template with:
- schedule
- black list
- auto secretary
- routing by department
- voice mail
Getting started
Add context for outgoing communication, for all users. (will be used if the dialed number does not fall into the routing configured by the user)
tail -5 /etc/asterisk/extensions.conf [vpbx-local] ; exten => 0999,1,Goto(xvb-main,${EXTEN},1) ; local DID's exten =>_00XX,1,Goto(xvb-main,${EXTEN},1)
in the users tab we add a user (since each user is a combination of a phone number + access code, we get all users on the number '0999' for ourselves - (if the system asks to enter the access code for it), and for each office we prescribe a 4-digit internal did):

Click 'create' and get something like this:

then go to `user` cabinet`:

change the time zone / language / set the user name / his email / and so on.
Set up registration on the provider equipment:

write here:
- ip address of the provider
- username on the equipment provider (we have a phone)
- password
- put a tick to receive calls
- put 0 in the column 'to the internal number'
Now our virtual office 43 must register with the provider’s equipment to receive incoming calls, check:
[root@n-test 5701]
We will register the client’s equipment in our 403 virtual office:

here we have created profiles for 2 user phones with numbers 101 and 102
This is how the connection of the Fanvil phone to our virtual office looks like (as number 101):

then we also register the softphone on the number 102.
Create a default outbound routing through the phone’s SIP provider:

that is, here all the numbers, except 4-digit ones starting with 0, are sent to the provider (if in the future the user wants to send calls, for example, through hoarse, he just needs to make a route with a higher weight)
Go to the list of internal numbers:

And in particular to number 0:

we set the type of internal number - 'Schedule' and created a simple schedule - from Monday to Saturday from 9 to 18 to send calls to internal number 1 (here we will have the IVR itself) otherwise 600 (voice mail)
Further, here we configure the filtering of incoming calls by caller number:

This means that when you receive calls from numbers 1234567890 and 0987654321, the system will hang up.
Create the number 600 - voicemail:

(instead of a system message, it is better to download a sound file with your own greeting. Out of the box, from Russian voices, TTS voice festival and TTS from google.translate are available)
Next, create the number 1, in which we ask the caller to choose who he wants to hear:

and numbers for accounting (1 * 1)

and technical department (1 * 2)

All together it looks like this:

Next, in order not to repeat everything the same for each user, go to the 'User Profile' tab and make backup settings (in xml format) after which it can be downloaded for a new user (after correcting numbers and passwords).
Actually everything. We expand the prepared template to the new user and return it with a piece of PBX.
So we have:
- the system we have installed and controlled by us
User has:
- schedule for all incoming calls.
- blacklist telephone spammers and hooligans.
- auto secretary.
- recording conversations.
- voice mail.
- opportunity to call from 101 to 102 or to the city.
- redirect calls for numbers 101 and 102 to mobile (via a SIP provider).
- Manage your virtual office with the possibility of expanding the above options.
- Detailed CDR for each call:

Now all this works in test mode and deadly bugs have not yet got out, about what I want to fix a little lower.
A few words about the inconvenience:
- Putting on the server from scratch from rpm is a bit hemorrhaging due to a lot of dependencies, so it’s easier to copy with tar directly from the vmare image.
- At some moments there is a strong desire to record your voice messages (TTS goes out of the box) and fix the web interface.