6.3 UC/PBX setup
Introduction
This tutorial outlines how to create a service similar to the Callto.net demonstration service.
PBX accounts are divided into company accounts and subaccounts.
Both types are based on email addresses. Company account has greater rights than subaccount. It allows for managing the company billing and other settings. Besides, it has all communication features as subaccount.
Setup
The default setup consists of several services pre-installed on three servers. Your setup might differ, for example using a HA cluster, but it usually follows the same general template.
Server Name | Domains | Services |
S-WAW | CUSTOMER-DOMAIN, BACKEND-DOMAIN | SIP services, IIS customer web modules |
WA | API-DOMAIN | Apache API modules, WebRTC modules |
DB | - | MySQL Database |
Service flow
The flow of the service on callto.net is as follows:
a customer signs up online through a web-form hosted on a landing page
A company account is created
Then from the VUC portal the first user (who has admin rights) creates accounts for other users.
Onlineshop, on a recurring basis charges the customer’s payment method.
Another option is to create company accounts manually from the VSM portal and then let company admin users to log in to VUC to create user accounts.
Online signup
If you want an online sign up you need to do following steps:
Create a tariff which will be assigned to new company accounts
Define a package – monthly subscription – optional
Define a trial package – allows to create accounts that are active for a limited period
Configure default account prefixes
Create a web form on your website that will send a request to the OnlineShop
Configure SMTP server for sending out emails with login credentials
Add a DID provider – optional, required only if you offer phone numbers
Add Paypal account for monthly subscriptions and top up
Add SMS provider for sending verification code for mobile apps
Add voice termination provider
//Adding DID, paypal and SMTP are described in following chapters.
Note: all the required details should be sent to us in the Requirements document. Please make sure that ALL information is filled.
Add a tariff
A tariff is used to charge customers for minutes used on the platform. All VoIP accounts on the platform have to have a tariff assigned, even if those accounts will have a different billing process.
Using your web browser navigate to:
Log in with the credentials provided by VoipSwitch in the post-install email. Using the following guide, create a tariff that will be used by your customers:
http://docs.voipswitch.com:18081/display/doc/1.6.2+Tariffs
Creating a package
A package includes a bundle with certain number of minutes to given country or countries, an optional DID number or numbers and also a number of users that can be added to the company account.
Using the following guide, create a package that will be used by your customers during signup:
http://docs.voipswitch.com:18081/display/doc/1.6.4+Packages
The screenshot below can be used as a reference of the standard package used with the Callto.net service. The standard package offers one DID number and 600 minutes to UK landline and mobile. The monthly cost of the plan is 9.99 and the same initial charge.
Once a package is created, we need to define the packages that we can use during signup. This is important, as we do not want to allow the customers to use different Packages. The plans listed in configuration will also be available for the customer to purchase once an account is active.
Log into the S-WAW server, using Remote Desktop and open the following file with your favourite text editor:
c:\inetpub\wwwroot\VUC\App_Config\AppSettings.config
Navigate through the file to find the following section:
<add key="PbxSignupPlan1Id" value="1" />
<add key="PbxSignupPlan2Id" value="2" />
<add key="PbxSignupPlan3Id" value="3" />
The value is the ID of the package from the database, to get the IDs open MySQL query browser and run the following command:
SELECT id_plan_pack, name FROM plans_packs;
The resulting table will show a list with two columns, the ID of the Package and the name of the Package.
Trial package
The process to create a trial package is similar to a regular package.
To create a trial package you need to create a regular package which is non-recurring and the initial charge is set to 0. You can choose a period, e.g. one month. It will deactivate the service after one month from the date of signing up.
A company admin user can upgrade company account from VUC Settings/Account menu http://docs.voipswitch.com:18081/display/doc/2.3.9+Billing+menu
Usually the trial signup is done as a separate form, and the Package ID of the trial plan is passed as a parameter.
Web form
The goal is to send a properly formatted request to the api URL, from a web form that is available to the customer. Once this is done, the system will start the account creation process.
Here you will find information on what parameters can be passed from the form for signup.
http://docs.voipswitch.com:18081/display/doc/2.5+Signup+API
The form allows to choose number of users, primary package, additional plans (optional), DID included in the primary package (optional), additional DIDs (optional). Additionally a topup amount can be defined (optional).
The form is usually a part of a landing page that is not supplied by VoipSwitch. It can be hosted on the S-WAW server or on a seperate server. This allows us to offer the service from a preexisting company page.
The form uses the below API to get a list of available DID numbers:
API to get available DID numbers: https://[CUSTOMER-DOMAIN]/VUC/api/DidSelect
All the selected parameters are sent to the below URL:
https://[CUSTOMER-DOMAIN]/VUC/api/CompanySignup
When a new account is created the system gets some of default configuration parameters from the AppSettings.config file (c:\inetpub\wwwroot\VUC\App_Config\AppSettings.config)
These parameters include information like:
Default client codec
Default type
Default customer prefix, in other words the way the customer is allowed to dial numbers (but more on this later…)
Confirmation and welcome emails
As a part of the signup process we send emails to the user. Emails are used to notify the customer about the status of the account creation process.
The first email that we send is an activation email. This is used to confirm the email address of the customer. We need to edit the email template file, so that it contains the proper company information. Log in again to the S-WAW server and modify the following files:
Confirmation email details - this is the email with the email confirmation link, the first one sent out to the customer.
<add key="PbxSignupRegisterMessageTitle" value="VUC new account confirmation" />
<add key="PbxSignupRegisterMessageBody" value="file://Content/CompanySignup/confirmation_email_UK.html" />
Welcome email subject - this is the subject of the email that will be sent to the customer once an account is activated.
<add key="PbxSignupWelcomeMessageTitle" value="Welcome to VUC" />
Trial account welcome - body of the email if we have a trial account.
<add key="PbxSignupWelcomeMessageBody" value="file://Content/CompanySignup/welcome_email_UK.html" />
Paid account welcome - body of the email if we have a paid account.
<add key="PbxSignupWelcomePremiumMessageBody" value="file://Content/CompanySignup/welcome_email_premium_UK.html" />
For the email functionality to work we need to define a SMTP (email) server, so that the messages can be delivered, which is one of the following steps.
Configure default account prefixes
The configuration for new account prefixes is located by default in the VUC AppSettings.config file
The default values are designed to work with all VoipSwitch products and allow compatibility for 3rd party devices like SIP Phones. By default all offnet traffic is directed to the Dialingplan with a special prefix “int”. All traffic to onnet customers will use the prefix “onnet”.
Log into the S-WAW server, using Remote Desktop and edit the AppSettings.config file
c:\inetpub\wwwroot\VUC\App_Config\AppSettings.config
Find the following key and make sure the value matches the example below.
<add key="NewClientTechPrefix" value="DP:+->int OR 011-> OR 00->int;TP:+-> OR 011-> OR 00-> OR int-> OR onnet"/>
Creating a PBX company account from VSM
One of the methods to provision new accounts on the system is to create them manually using the VSM interface.
Detailed documentation http://docs.voipswitch.com:18081/display/doc/2.2+VSM+portal
Add a tariff
Follow the steps for the tariff creation process in signup.
Add a new company
To start the process, log into your VSM3 account.
Using your web browser navigate to:
Highlight the menu item Clients -> UC/PBX clients -> Companies. On the list click the NEW button.
You will be asked to provide details about the new account.
The Company name will be later on used as a reference in the system to this account.
Usernames in the PBX are based on email addresses, an email like jack@mail.com will be references ad jack_mail.com in the system to keep SIP compatibility.
Select the currency and tariff the user will be using.
Make sure the account is Active.
A welcome email will be sent to the user, if you need to modify the email, check out the email section in the signup process.
Using this account a user can log into VUC and create accounts there for his colleagues within the company http://docs.voipswitch.com:18081/display/doc/2.3.2+Adding+user+accounts
Modify the account
Once the account is created, we can modify some of the properties. One of the important ones is the client prefix. Navigate to your VSM3 account, using your web browser:
Highlight the menu item Clients -> UC/PBX clients -> Users.
Select the email address of the user you want to modify.
Select advanced
Fill out the section with the proper prefixes, as during the signup configuration process
Note: you can modify two types of accounts here. If the email address is the same as the one provided during company creation, you are editing the admin account. The client prefix will be copied to new PBX users under that company from this account. If you modify a non-admin user, the change will be only applied to this user.
Adding SMTP server
Emails are used to send information to the customer and to check if an email address is proper. To do this, we use an SMTP server, which is used to deliver emails.
The SMTP server can be defined in VSM. Using your web browser navigate to
Highlight Settings > Online payments > Notifications settings
Select Email settings
Fill out the SMTP server settings based on the details you have for your server.
Save settings
Test your new settings using the last field
Adding DID provider
Voipswitch platform works with several DID API providers. Also you can import DID numbers to the database if you have a bulk of numbers from a provider.
Here you will find how to add a provider http://docs.voipswitch.com:18081/display/doc/1.8+DIDs
To add a DID provider we need to configure it as:
A DID API interconnection - to talk to the provider when purchasing numbers.
A SIP signalling interconnection - to receive calls from the provider.
We can start by logging into the S-WAW server. Log into your S-WAW server using Remote Desktop and open the following file:
c:\inetpub\wwwroot\VSServices\AppSettings.config
Depending on the provider you will be using, you need to find the appropriate section in the configuration. For example, if using Voxbone, search for
<!-- Voxbone 2 - configuration →
All other providers are located under the Voxbone section. Configure the section with the proper credentials and details. Use the documentation link above for additional help.
Restart IIS by issuing the iisreset command in Start -> Run. This lets the system know to use the new DID provider settings from the config file.
Once the step is completed, we need to configure the SIP interconnection. The interconnection can be defined in VSM. Using your web browser navigate to
Highlight Clients > Wholesale Clients
Click NEW
Type in the Login of the user - to make things easier, use the providers name, like “Voxbone”
The SIP password needs to be defined, but it will be unused. Please make sure it is impossible to guess
Setting up the currency and tariff will allow us to measure the minutes used by the provider. You can leave the testtariff for now.
Make sure the account is active.
The account is created, but is missing a few configuration steps. Select the account from the list of existing accounts and click the IP addresses link. Provide the IP addresses that the DID provider originates traffic from - usually this is a list of multiple IPs and all need to be added. Only these IP addresses will be able to originate traffic to this account. Do not add an authorization prefix.
Configuring a payment provider
The callto.net service uses PayPal to manage customer subscriptions. We need to interconnect with PayPal to be able to process payments with their platform.
In the Paypal’s backoffice set the following:
Auto Return - must be switched to On
Return URL - set the your onlineshop URL http://[BACKEND-DOMAIN]/OnlineShop/PayPal.notify
Payment Data Transfer - should be switched on
Block Non-encrypted Website Payment – set to off to accept Non-Encrypted payments
Set the notification (IPN) URL. Select Instant Payment Notification preferences in the Profile and set the URL to http://[BACKEND-DOMAIN]/OnlineShop/PayPal.notify
Log into the S-WAW server and open the configuration file:
c:\inetpub\wwwroot\OnlineShop\Payments.config
Find the PayPal section by searching for PayPalStandardProvider and provide the following
businessEmail="email@usedwithpaypal.com"
currency="Your Currency in ISO format"
country=”Two letter country code"
More details: http://docs.voipswitch.com:18081/display/doc/1.13.3+Adding+payment+providers#id-1.13.3Addingpaymentproviders-PayPalStandard
SMS provider for sending verification code
The verification code is used to confirm the Mobile number of the user. If the mobile number is confirmed, then the user can select the mobile number as his or hers Caller ID.
Log into the WA server using SSH. Us a superuser edit the API configuration file:
sudo nano /var/www/emci/AppSettings.config
Find the <!-- SMS API--> section
<add key="sms_api_body" value="Your AppName code is: [CODE]"/> # The SMS text in
<add key="nexmo_api_url" value="https://rest.nexmo.com/sms/json"/> # The Nexmo API URL
<add key="nexmo_api_user" value=""/> # Parameter nexmo key.
<add key="nexmo_api_pass" value=""/> # Parameter nexmo secret.
<add key="nexmo_api_from_num" value=""/> # DID nexmo from the USA.
<add key="nexmo_api_from_txt" value="AppName"/> # Sender name, max 8 characters. Note - for the US it needs to be a DID number supplied by nexmo
Voice termination provider
You need a provider which can receive your outgoing calls. Providers usually authenticate traffic by IP address of your server. You need to get an IP address of a gateway where to send traffic and also supported voice codecs.
Using your web browser navigate to:
First we need to create the SIP interconnect for the termination provider:
Navigate to Routing -> Destination -> Gateways
Select NEW
Name - is the name of the provider used to identify it in the system
Host - IP or DNS supplied by the provider
Port - UDP port of the provider
Make sure it’s active and click create.
Once this is done, we need to tell the system to send calls from the users to the provider. Only offnet calls will be routed this way.
Navigate to Routing -> Routing plan
Select new -> add
Prefix must have the value int
Route type needs to be Gateway
Route needs to be the same as the Name provided during the creation of the gateway
Create
All calls to offnet numbers will go to the new provider. To add additional providers, check out the detailed documentation on destinations:
http://docs.voipswitch.com:18081/display/doc/1.7.3+Destinations
SMS termination provider
Using your web browser navigate to:
First we need to create the SMS interconnect for the termination provider:
Navigate to Routing -> SMS -> Providers
Select NEW
Name - is the name of the provider used to identify it in the system
Provider type - select the proper one based on the info from the provider. Http is the most popular
Fill out the connection string, for Nexmo it would be:
HTTP Connection String
Select Log provider’s response
Click create.
Once this is done, we need to tell the system to send SMS from the users to the provider. Only offnet SMS will be routed this way.
Navigate to Routing -> SMS -> Routing plan
Select new -> add
Prefix must have the value int
SMS privider needs to be the same as the Name provided during the creation of the gateway
Create
All SMS to offnet numbers will go to the new provider. To add additional providers, check out the detailed documentation on Outbound SMS:
http://docs.voipswitch.com:18081/display/doc/1.9.2+Outbound+SMS