Newfies Dialer
Newfies Dialer
Newfies Dialer
Release 2.20.2
Arezqui Belaid
1 Getting Started 3
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4 Extra Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.5 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 Beginner’s Guide 7
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Server Specification for Newfies-Dialer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Operating System Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.4 Complete Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5 Newfies-Dialer Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.6 Freeswitch Trunk configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.7 Newfies-Dialer Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.8 Customer Portal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.9 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3 Installation 15
3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2 Broker Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.3 Celery Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5 FreeSwitch 27
5.1 Installation and configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.2 Trunk configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6 SMS Configuration 29
6.1 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.2 Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
6.3 Providers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
6.4 Replies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7 User Guide 33
7.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
i
7.2 How to use Newfies-Dialer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
7.3 Survey Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
7.4 Customer Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
7.5 Admin Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
7.6 Appointment Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.7 SMS Campaign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
8 Developer doc 97
8.1 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
8.2 Coding Style & Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
8.3 Database Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
8.4 Objects Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
8.5 Newfies-Dialer Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
8.6 Newfies-Dialer Admin Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
8.7 Newfies Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
8.8 Newfies Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
8.9 Test Case Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
8.10 Javascript Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
10 Troubleshooting 153
10.1 Where to find help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
10.2 Where to find the log files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
10.3 Where are located the config files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
10.4 Enable the debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
10.5 How to run a quick test call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
10.6 Run in debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
10.7 Run on Amazon EC2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
ii
10.8 Celerymon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
10.9 How to discard all pending tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
10.10 Checking Freeswitch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
10.11 Step By Step Checklist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
11 Contributing 157
11.1 Community Code of Conduct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
11.2 Reporting Bugs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
11.3 Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
11.4 Branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
11.5 Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
11.6 Working on Features & Patches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
11.7 Coding Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
11.8 Contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
11.9 Release Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
12 Resources 167
12.1 Getting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
12.2 Bug tracker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
12.3 Wiki . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
12.4 Contributing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
12.5 License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
iii
iv
Newfies-Dialer Documentation, Release 2.20.2
Version 2.20
Release 2.20.2
Date October 04, 2016
Contents:
Contents 1
Newfies-Dialer Documentation, Release 2.20.2
2 Contents
CHAPTER 1
Getting Started
Web http://www.newfies-dialer.org/
Download http://www.newfies-dialer.org/download/
Source https://github.com/newfies-dialer/newfies-dialer/
Keywords dialer, voip, freeswitch, django, asynchronous, rabbitmq, redis, python, distributed
–
Newfies is an open source VoIP Dialer and SMS broadcasting system based on distributed message passing. It has
been built to support cloud based servers and can also work on standalone servers. It uses Freeswitch (VoIP Server) to
outbound calls.
The platform is focused on real-time operations and task call distributions to clustered brokers and workers.
Newfies-Dialer is written in Python, using the Django Framework. It also operates with message brokers such as
RabbitMQ, Redis but support for Beanstalk, MongoDB, CouchDB and DBMS is also available.
Newfies-Dialer provides an extensive set of APIs to easily integrate with third-party applications. Virtually every
feature on the UI can be managed via the API’s. There is also an API explorer to test different features.
Using very simple steps, Newfies-Dialer will help you create campaigns, add phonebooks, contacts, build audio mes-
sages and create complex telephony applications. Once the campaigns are ready to start, the messages will be dis-
patched and delivered.
• Overview
• Utility
• Features
• Extra Features
• Architecture
1.1 Overview
Newfies-Dialer can be installed and used by anyone who has a need for SMS broadcasting, mass outbound calling,
voice broadcasting or providing outbound IVR Some of the potential uses for Newfies-Dialer are listed below.
The system may be installed and used by either companies who wish to make calls on their own behalf, or by SaaS
(Software as a Service) companies that want to provide bulk dialling and SMS broadcasting facilities to their own
customers.
3
Newfies-Dialer Documentation, Release 2.20.2
Newfies-Dialer can be configured on a single server, or for really high capacity or high speed systems, Newfies-Dialer
can be configured across multiple servers.
1.2 Utility
Newfies-Dialer is loaded up with a list of telephone numbers that can be dialled sequentially at very high rates of
calling depending on carrier capacity and hardware, potentially delivering many millions of calls per day.
When the called party answers the call, Newfies-Dialer passes the call to a telephony application that is custom
designed to provide the desired behaviour.
Some examples of where Newfies-Dialer may be used follow:
• Telecasting: Broadcast marketing or informational messages to customers and clients.
• Phone Polling, Surveys and Voting: Ring large numbers of people and present IVR options for either polling
their opinions, interactive surveys, or taking their vote and record the results.
• Debt Control: Customers can be automatically reminded at intervals that they owe money, and an IVR menu
presented to talk to the finance department or passed to a credit card capture IVR to pay over the phone.
• Appointment Reminders: Doctors, Dentists, and other organisations that make appointments for their clients
can integrate Newfies-Dialer into their appointment systems to pass a message reminding clients of an upcoming
appointment.
• Dissemination of information via phone: Newfies-Dialer was originally designed to call large numbers of
people and disseminate medical and health advice via cellphone in 3rd world countries where often, literacy
levels are low. On a local scale, it can be used to disseminate information about forthcoming community events.
• Mass Emergency broadcast: Where there is a necessity to warn large numbers of people in a short space of
time, such as weather warnings, evacuation notices and crime prevention.
• Subscription Reminders and Renewals: Where a company sells an annual subscription for a product or ser-
vice, Newfies-Dialer can be configured to dial the customer, remind them that the subscription is due.
1.3 Features
AMD Answering Machine Detection module is available. For this module see the
section Add-ons on website
Rebranding & Rebranding and design services to match your corporate imagee. See the
Whitelabelling Add-ons section on website
1.3. Features 5
Newfies-Dialer Documentation, Release 2.20.2
1.5 Architecture
• User selects contacts, phonebooks and campaigns, then chooses a voice application to use. The campaign is
then launched
• Newfies-Dialer spools the outbound calls to FreeSWITCH via ESL.
• FreeSWITCH dials the contact via the configured telephony gateways.
• Contact picks up the call, and the answer event is received in FreeSWITCH and passed back to the Lua IVR
Application.
• Newfies-Dialer is notified that the call is answered, then renders the appropriate IVR.
• The application is delivered to the contact by FreeSWITCH.
Beginner’s Guide
• Introduction
• Server Specification for Newfies-Dialer
• Operating System Installation
• Complete Installation
• Newfies-Dialer Installation
• Freeswitch Trunk configuration
• Newfies-Dialer Configuration
– Set Hostname
– Newfies-Dialer’s Gateway
– Dialer Settings
• Customer Portal
– Create Phonebook
– Add Contacts
– Add Survey
– Configure Campaign
– Start The Campaign
• Conclusion
2.1 Introduction
This is a simple step-by-step guide for installation of the necessary components to install Newfies-Dialer. It covers
the installation of the operating system, Freeswitch and Newfies-Dialer along with all the dependencies, followed by
setting off the first Newfies-Dialer campaign, and can be achieved in under one hour, given suitably quick broadband.
As a minimum, we recommend a server with 2Gb of RAM and at least 20Gb of hard drive space with a 64 bit
architecture. This will be sufficient to test Newfies-Dialer. However, for best performance a highly specified server
would be better with good IO suggesting SSD, RAID 0 or RAID 10, plenty of RAM and multiple processors.
The capacity of the system is not limited by the software, but by the hardware dedicated to Newfies-Dialer, and
the way that the software is tuned to take best advantage of the given hardware. We offer a tuning and optimi-
sation service(http://www.newfies-dialer.org/add-ons/acceleration-and-optimisation-service/) which can make some
dramatic improvements to performance.
7
Newfies-Dialer Documentation, Release 2.20.2
We recommend that you use Debian 7.X or 8.x 64 bit server, with only SSH installed; This document is written with
this in mind. It is available at http://www.debian.org/distrib/
Please note that the Newfies-Dialer install scripts are only designed to work on Debian 7.X and 8.x (64 bit)
Burn the image to CD, and install onto your hardware. The installation of Debian is straight forward and simple. The
only package to install is SSH Server so that you can manage the server from your desktop PC or Mac. All other
packages will be installed by Star2Billing’s Newfies-Dialer installation scripts.
When Debian is installed, it maybe worthwhile installing the latest patches and updates. This is achieved with the
following commands:
sudo apt-get update
sudo apt-get upgrade
A reboot after major updates is recommended, type “reboot” at the command line.
We have provided automated scripts that installs Newfies-Dialer on your Server and includes all the dependencies such
as Freeswitch, Celery and Redis.
• Freeswitch is the telephony engine used by Newfies-Dialer to make calls, as well as play voice applications
• Celery is the task queuing system.
• Redis is the task messaging system
Once Debian 7.x is installed, log in as root, then download and run the install-all.sh installation script, by executing
the following command:
The installation will prompt you to install Freeswitch, press enter. this will download and install Freeswitch with the
modules appropriate for Newfies-Dialer. The installation will take some time, but does not require your interaction
once started.
Finally, the Newfies-Dialer selection menu will appear.
Newfies-Dialer is the management and control system providing a web interface for admin and customers alike, to
manage the platform, subscribers and voice broadcast campaigns.
The installation script will prompt you as to what you want to install. For this guide, we chose the option to install all.
At points during the installation, you will be prompted to press enter to continue, with a short explanation of what is
happening next. Just press enter for the defaults.
You will be prompted to create a superuser. Accept root, enter your email address, and your chosen password, twice.
This will be the username and password you use to log on to the Newfies-Dialer web interface.
Once installed, the system will then prompt you to continue with the installation and install the backend processes.
Press enter to continue. On completion, the script will return to the original Newfies-Dialer install menu. Exit the
menu.
We can now reboot to ensure that, on startup, all required services are running. Type “reboot” at the command line.
We don’t need to type “sudo reboot” as mentioned earlier, because we are already logged in as root.
On reboot log into the new system via your web browser to check that everything is working. Type http://<<IP-
ADDRESS>>:8008 into your web browser’s address bar where <<IP-ADDRESS>> is the IP address or hostname
of your Newfies-Dialer platform. If you have followed the instructions above, you should be able to login using the
username and password you created during the installation.
The scripts are well tested, and there is no reason for them to fail provided you have followed the instructions and you
have Internet access. If things have not gone well, and you cannot log on, re-read the instructions and check you have
internet access and DNS resolution.
NB: See the video at the top of the page for an overview of the initial configuration of Newfies-Dialer.
In order for Newfies-Dialer to make outbound calls to its subscribers, you will need a SIP trunk. The Freeswitch
wiki can provide more information on configuring trunks. However creating a trunk simply for Newfies-Dialer is
straightforward.
Trunks or gateways, as they are known in Freeswitch, are configured using XML syntax, so using your favourite text
editor, while logged in as root “sudo su -” create an XML file in /etc/freeswitch/sip_profiles/external/ and give it an
identifiable name, e.g. call-labs.xml, and place the following lines in the file.
<include>
<gateway name="ip address or hostname of carrier">
<!--/// account username *required* ///-->
<param name="username" value="your username provided by carrier"/>
<!--/// auth realm: *optional* same as gateway name, if blank ///-->
<!--<param name="realm" value="asterlink.com"/>-->
The lines in bold are almost certainly required by your carrier and Freeswitch, the remaining parameters can be
uncommented and used, if required by your carrier. The XML syntax for comments are denoted by lines that begin ”
<!– ” and end in “–> ”.
Finally we need to load the new configuration, and check the trunk is registered. The Freeswitch console is accessed
by typing “fs_cli” at the command prompt. The logging level can be increased or decreased from level 0 to level 7.
to switch off logging, type /log 0 at the Freeswitch console, followed by enter. For the greatest verbosity, type /log 7
followed by enter.
Type “fs_cli” followed by enter.
You should now see the Freeswitch CLI, so now reload the Freeswitch configuration with the following command:
(tip; Tab auto-completes)
sofia profile external restart reloadxml
When complete, check the trunk has registered with the following command.
sofia status
Against the name of the trunk you configured in the XML file, you should see REGED (registered) at the end of the
line. Take a note of the trunk name, we are going to need it for telling Newfies-Dialer that it can use this trunk.
To exit the Freeswitch CLI, do CTRL D, or /exit
Freeswitch configuration is now complete.
For demonstration purposes, we are going to configure one standard voice application supplied with Newfies-Dialer,
using the root user, to call only one person.
We are going to use the admin interface to tell Newfies-Dialer about the gateway we have configured in Freeswitch
and set the maximum parameters for a customer such as their allowed dial rate, maximum number of campaigns, etc.
Some of the features of Newfies-Dialer are dependent on the hostname or IP address, so this has to be set correctly in
site address.
In the Admin dashboard, locate the “Sites” link and click change. By default, there will be an entry of “exam-
ple.com”. Edit this setting to reflect the hostname of the server, or if you do not have this set up, the IP address. e.g.
http://www.domain.tld:8008 or in the case of an IP address, something like http://192.168.1.200:8008
Log into the Newfies-Dialer interface using your root username and password previously created in these instructions.
Click Admin, and locate and enter the “Dialer Gateways” panel on the dashboard, then add a dialer gateway. Only the
fields in bold need to be filled in. That is to say, the name of gateway, for identification, and the Gateway’s field, e.g.
sofia/gateway/myprovider/
“myprovider” is the name of the gateway which you can take from the gateway name when you typed “sofia status”
when configuring the Freeswitch Gateway. Finally, check the status is active, and save. The trunk should now appear
in the gateway list.
Each customer, including the root user, needs to have Dialer Settings and trunks associated with their account. These
set the limit to which each customer can utilise Newfies-Dialer in terms of trunks, calls per minute, call duration,
subscribers and campaigns, as well as blacklisting or whitelisting phone numbers.
In the Admin Dashboard, locate the Dialer Settings, and click Add, in the name, put “DS1” and, for the moment, leave
the default settings as they are, then save them.
The Dialer Settings have to be associated with the customer’s account. For the purposes of this demonstration, we are
using the root user. In production, you would apply these settings to the customers.
In the Admin dashboard, click Admins, then root. Scroll to the bottom of the page.
• Optionally add an accountcode, which can be used for billing in an external billing application to identify the
customer from the CDR. The accountcode must be numerical.
• Select which Dialer Settings apply to this customer, in this case “DS1”
• Select which gateway(s) this customer is allowed to use.
Finally, click save.
NB: Everything above this is covered at the video at the top of the page, from configuring FreeSWITCH to apply
Dialer Settings.
Now we are going to use the customer’s portal to create phonebooks containing subscribers to call, configure a survey,
add campaign, and start the outbound voice broadcast. These should always be done from the Customer Portal and
not from the Admin Interface. To proceed, click “Customer Panel” at the top of Admin interface.
The phonebook is where lists of subscribers are grouped. Click Customer Panel on the top menu in the Admin
Dashboard, then click Phonebook, and add a new phonebook.
Create a new phonebook called, for the purposes of the exercise, PB1, and give it a description.
Click contact, and add a new contact. As a minimum add a phone number to call in the Contact field, and for the
purposes of this demonstration, enter your own telephone number in the format that your carrier expects it. Click
Submit.
Repeat as necessary until you have your test numbers added.
Next we are going to configure the survey that will be executed when Newfies-Dialer calls your phone and you answer.
Click Modules, Survey, then click add. As is traditional with first steps, we will call this survey “Hello World”.
The aim is that Newfies-Dialer will call you, and when you answer, Newfies-Dialer will broadcast “Hello World” to
you using the text to speech engine in Freeswitch.
Click “Add Section” and select “Play Message”, enter “Hello World” in the section title. This is the speech that will
be read out by the TTS engine. It can be edited later. When done, click save.
Best practice is that we should hangup, and mark the survey as complete, so click “Add Section” and select Hangup
as the node type. Type “Goodbye” in the section title, and tick “Survey complete”
Next, set up the node branching. On the play message panel, click the branch icon, and select “Goodbye” as the next
destination.
Finally, click Close Survey, and move on to configuring the campaign.
We now have all the components to create and run our campaign, so click campaign, and click add.
Give the Campaign a name, say “CPN Hello World”, optionally, a description, set a caller ID to pass the called party,
select the A-Leg Gateway you configured earlier, the application, Hello World, and highlight the phonebook PB1, and
submit. You will be returned to the list of campaigns.
We are now ready to launch the campaign, simply press the Play button against the CPN Hello World campaign.
In a few seconds, your campaign will launch, your phone will ring, and you will hear “Hello World” followed by
“Goodbye” broadcast to you over the phone.
2.9 Conclusion
This is a brief step by step instruction set of installing Newfies-Dialer, and making the first call. Please refer to the
advanced documentation on the Newfies-Dialer and Freeswitch websites to cover more advanced topics, and begin
implementing your own Voice Broadcast applications.
Star2Billing’s Support Team (newfies-dialer@star2billing.com) are on hand to provide one to one installation, support
and tuition where required, and Star2Billing’s Development Team can be commissioned to build voice applications
and integrate them with third party software and systems.
Note: As with all telephony systems, they are a valuable target on the internet, so before exposing any telephone
system to the Internet, do ensure that you have done a security audit. Also note that in some countries, telemarketing,
phone polling, and automated dialling is under regulatory control, and advice should be sought as to how best to remain
within the limits of the law. First points of reference may be Ofcom in the UK and the Federal Trade Commission
(FTC) in the USA.
2.9. Conclusion 13
Newfies-Dialer Documentation, Release 2.20.2
Installation
Contents:
3.1 Overview
A Requirements file gives you a way to create an environment where you can put all optional dependencies which are
needed for your Project/Application.
To get started with Newfies-Dialer you must have the following installed:
• python >= 2.7 (programming language)
• HTTP server with WSGI modules (Apache, Nginx)
• Django Framework >= 1.6.1 (Python based Web framework)
• Celery >= 3.0 (Asynchronous task queue/job queue based on distributed message passing)
• MySQL-python >= 1.2.3 (MySQL for python language)
• Werkzeug >= 0.6.2 (Collection of various utilities for WSGI applications)
• amqplib >= 0.6.1 (Client library for AMQP)
• anyjson >= 0.3 (Loads the fastest JSON module)
• django-celery >= 3.1.1 (Celery integration for Django)
• django-extensions >= 1.0.3 (Collection of global custom management extensions for Django)
• django-jsonfield >= 0.9.12 (Reusable django field that can use inside models)
• django-pagination >= 1.0.7 (Utilities for creating robust pagination tools throughout a django application)
• django-picklefield >= 0.3.1 (Implementation of a pickled object field)
• django-threaded-multihost >= 1.4-0 (Provides multi-host utilities to Django projects)
• django-urlauth = 0.1.8 (Allows to build links with authentication effect )
• django-uuidfield >= 0.4 (Provides a UUIDField for your Django models)
• django-reusableapps >= 0.1.1 (Python module to enable Django to load reusable, pluggable and egg-based
applications)
• docutils >= 0.10 (Text processing system for processing plaintext documentation into useful formats)
15
Newfies-Dialer Documentation, Release 2.20.2
You can install Newfies-Dialer manually or using the shell script provided.
To install Newfies-Dialer using this script,:
$ chmod +x install/install-newfies.sh
$ ./install/install-newfies.sh
16 Chapter 3. Installation
Newfies-Dialer Documentation, Release 2.20.2
syncdb will create a database named test.db in database folder of the Newfies-Dialer directory. We have con-
figured Newfies-Dialer to do this, but you can change this simply by modifying settings.py where DATABASES
dictionary is constructed. You can find more information about this in the Django documentation.
collectstatic will fetch all necessary media files and put them into static folder defined in the settings
module.
runserver runs an embedded webserver to test your site. By default it will run on http://localhost:8000. This is
configurable and more information can be found on runserver in Django documentation.
When a User requests a page, the Web server makes calculations for business logic and to create the page that your
visitor sees. It creates a processing overhead higher than a standard read-a-file-off-the-filesystem server arrangement.
This is where caching comes in.
To cache something is to save the result of an expensive calculation so that you don’t have to perform the calculation
next time:
$ mkdir /usr/share/django_cache
This document describes the installation of two different Brokers. One is Redis and second is Rabbitmq. You can
install either to work with Newfies-Dialer.
3.2.1 Redis
To install Redis-Server
$ /etc/init.d/redis-server start
3.2.2 Rabbitmq
RabbitMQ is a complex and sophisticated product. If you don’t need this level of robustness, then you might want to
take a look at Redis - it installs easily, runs relatively lean, and can be monitored and maintained without a lot of fuss.
See Installing RabbitMQ over at RabbitMQ’s website.
Note: If you’re getting nodedown errors after installing and using rabbitmqctl then this blog post can help you
identify the source of the problem:
http://somic.org/2009/02/19/on-rabbitmqctl-and-badrpcnodedown/
Download Source
http://www.rabbitmq.com/server.html
Note: The word testing in the above line refers to the state of the release of RabbitMQ, not any particular Debian
distribution. You can use it with Debian stable, testing or unstable, as well as with Ubuntu. In the future there will be
a stable release of RabbitMQ in the repository.
2. (optional) To avoid warnings about unsigned packages, add RabbitMQ’s public key to your trusted key list using
apt-key(8):
$ wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
Setting up RabbitMQ
To use celery we need to create a RabbitMQ user, a virtual host and allow that user access to that virtual host:
$ rabbitmqctl add_user myuser mypassword
See the RabbitMQ Admin Guide for more information about access control.
18 Chapter 3. Installation
Newfies-Dialer Documentation, Release 2.20.2
you can also run it in the background by adding the -detached option (note: only one dash):
$ sudo rabbitmq-server -detached
Never use kill to stop the RabbitMQ server, but rather use the rabbitmqctl command:
$ sudo rabbitmqctl stop
When the server is running, you can continue reading Setting up RabbitMQ.
3.3.1 Celery
Celery is an asynchronous task queue/job queue based on distributed message passing. It is focused on real-time
operation, but supports scheduling as well.
Celery communicates via messages using a broker to mediate between clients and workers. To initiate a task a client
puts a message on the queue, the broker then delivers the message to a worker.
You can visit Celery Project webpage to find further information : http://celeryproject.org/
You can install Celery either via the Python Package Index (PyPI) or from source.
$ cd celery-*****
20 Chapter 3. Installation
CHAPTER 4
Contents:
This is a sample configuration to get you started. It should contain all you need to create a basic set-up.
Newfies-Dialer configuration file is by default located at /usr/share/newfies-dialer/newfies_dialer/settings_local.py
Some of the more important parts of the configuration module for the Newfies, settings.py, are explained below:
import os.path
APPLICATION_DIR = os.path.dirname(globals()['__file__'])
APPLICATION_DIR now contains the full path of your project folder and can be used elsewhere in the
settings.py module so that your project may be moved around the system without you having to worry about
changing any troublesome hard-coded paths.
DEBUG = True
turns on debug mode allowing the browser user to see project settings and temporary variables.
ADMINS = ( ('xyz', 'xyz@abc.com') )
sends all errors from the production server to the admin’s email address.
DATABASE_ENGINE = 'django.db.backends.postgresql_psycopg2'
DATABASE_NAME = 'newfies_dialer_db'
DATABASE_USER = 'user'
DATABASE_PASSWORD = 'password'
DATABASE_HOST = 'db-host'
DATABASE_PORT = '5432'
sets up the options required for Django to connect to your database. Only Postgresql is supported.
MEDIA_ROOT = os.path.join(APPLICATION_DIR, 'static')
tells Django where to find your media files such as images that the HTML templates might use.
21
Newfies-Dialer Documentation, Release 2.20.2
ROOT_URLCONF = 'urls'
tells Django to start finding URL matches at in the urls.py module in the newfies project folder.
TEMPLATE_DIRS = ( os.path.join(APPLICATION_DIR, 'templates'), )
tells Django which applications (custom and external) to use in your project. The custom applications,
dialer_gateway, dialer_campaign etc. are stored in the project folder along with these custom applica-
tions.
The defined URL patterns for the CPI Pilot project are divided into URL patterns specific to the project and URL
patterns specific to the applications. For more information on how the pattern matching syntax work or how to write
your own url patterns please consult Django’s URL Dispatcher documentation.
The URL patterns specific to the project are applied in the urls.py file that is stored in the project directory
newfies. The code segments that add these URL patterns aren’t lengthy and are shown below:
urlpatterns = patterns('',
# redirect
('^$', 'django.views.generic.simple.redirect_to', {'url': '/dialer_campaign/'}),
(r'^admin/', include(admin.site.urls)),
(r'^api/dialer_campaign/', include('dialer_campaign.api.urls')),
(r'^dialer_campaign/', include('dialer_campaign.urls')),
(r'^static/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.STATIC_ROOT}),
)
The URL patterns specific to the dialer_campaign application are applied in the /dialer_campaign/urls.py
file in the dialer_campaign application folder. The code segment that adds these URL patterns isn’t lengthy either and
is shown below:
urlpatterns = patterns('dialer_campaign.views',
(r'^phonebook/$', 'phonebook_list'),
(r'^phonebook/add/$', 'phonebook_add'),
(r'^phonebook/(.+)/$', 'phonebook_change'),
)
The functions defined in views.py represent the logic behind the webpages. The view functions (called through
the URL matching) decide which data structures need to be constructed and sent through to the HTML templates. To
do this, each view function uses Django’s object relational model (ORM) to query the database picking out what is
needed for any particular page.
@login_required
def phonebook_add(request):
"""
Add new Phonebook
"""
form = PhonebookForm()
if request.method == 'POST':
form = PhonebookForm(request.POST)
if form.is_valid():
obj = form.save(commit=False)
obj.user = User.objects.get(username=request.user)
obj.save()
request.session["msg"] = _('"%s" is added.' %\
request.POST['name'])
return HttpResponseRedirect('/dialer_campaign/phonebook/')
template = 'dialer_campaign/phonebook/change.html'
data = {
'form': form,
'action': 'add',
}
return render_to_response(template, data,
context_instance=RequestContext(request))
The classes defined in admin.py tell Django what attributes are visible and modifiable from the admin site.
Example:
def get_urls(self):
urls = super(VoiceAppAdmin, self).get_urls()
my_urls = patterns('',
(r'^add/$', self.admin_site.admin_view(self.add_view)),
)
return my_urls + urls
1. Redis Settings
CELERY_RESULT_BACKEND = "redis"
REDIS_HOST = "localhost"
REDIS_PORT = 6379
REDIS_DB = 0
#REDIS_CONNECT_RETRY = True
2. Rabbitmq Settings
CELERY_RESULT_BACKEND = "amqp"
To run celerybeat
$ python manage.py celerybeat --schedule=/var/run/celerybeat-schedule
To run both
$ python manage.py celeryd -E -B -l debug
To configure celeryd you will need to tell it where to change directory to, when it starts in order to find your celerycon-
fig.
$ cd install/celery-init/etc/default/
# Path to celeryd
CELERYD="/path/to/newfies/manage.py celeryd"
2. Open celeryd (for periodic task) in text editor & add the following variables
Configuration file: /etc/default/celerybeat or /etc/default/celeryd
Init script: celerybeat
Usage: /etc/init.d/celerybeat {start|stop|force-reload|restart|try-restart|status}:
# Path to celerybeat
CELERYBEAT="/path/to/newfies/manage.py celerybeat"
$ cp etc/init.d/celeryd /etc/init.d/
$ cp etc/init.d/celerybeat /etc/init.d/
4.2.4 Troubleshooting
If you can’t get the celeryd as a daemon to work, you should try running them in verbose mode:
$ sh -x /etc/init.d/celeryd start
$ sh -x /etc/init.d/celerybeat start
FreeSwitch
Freeswitch is the telephony engine used by Newfies-Dialer to make calls, as well as broadcast voice applications
Newfies-Dialer communicates with Freeswitch though the Event-Socket. Communication is made via the Event Socket
Library ESL. We have some Freeswitch dependencies, therefore the following modules will need to be installed
mod_curl, asr_tts, mod_flite, asr_tts, mod_shout, mod_dingaling, mod_shell_stream, mod_xml_cdr
A script for Freeswitch Installation which will install Freeswitch with the required modules and configure it for you is
available.
Download and run the Freeswitch installation script.
Once logged in as root, execute the following command:
wget https://raw.github.com/newfies-dialer/newfies-dialer/master/install/install-freeswitch.sh
The above commmand download the installation script. We can then execute the script with the following command:
bash install-freeswitch.sh
This will download and install Freeswitch with the modules appropriate for Newfies-Dialer. The installation will take
some time, but does not require your interaction once started.
In order for Newfies-Dialer to make outbound calls to its subscribers, you will need a SIP trunk. The Freeswitch
wiki can provide more information on configuring trunks. However creating a trunk simply for Newfies-Dialer is
straightforward.
Trunks or gateways, as they are known in Freeswitch, are configured using XML syntax, so using your favourite text
editor, while logged in as root “sudo su -” create an XML file in /usr/local/freeswitch/conf/sip_profiles/external/ and
give it an identifiable name, e.g. call-labs.xml, and place the following lines in the file:
<include>
<gateway name="ip address or hostname of carrier">
<!--/// account username *required* ///-->
<param name="username" value="your username provided by carrier"/>
<!--/// auth realm: *optional* same as gateway name, if blank ///-->
<!--<param name="realm" value="asterlink.com"/>-->
27
Newfies-Dialer Documentation, Release 2.20.2
The uncommented lines are almost certainly required by your carrier and Freeswitch, the remaining parameters can
be uncommented and used, if required by your carrier. The XML syntax for comments are denoted by lines that begin
“ <!– “ and end in “–> “.
Finally we need to load the new configuration, and check the trunk is registered. Enter the Freeswitch CLI (Command
Line Interface) from the console:
/usr/local/freeswitch/bin/fs_cli
You should now see the Freeswitch CLI, so now reload the Freeswitch configuration with the following command:
(tip; Tab auto-completes):
sofia profile external restart reloadxml
When complete, check the trunk has registered with the command:
sofia status
Against the name of the trunk you configured in the XML file, you should see REGED (registered) at the end of the
line. Take a note of the trunk name, we are going to need it for telling Newfies-Dialer that it can use this trunk.
To exit the Freeswitch CLI, do CTRL D, or /exit
Freeswitch configuration is now complete.
28 Chapter 5. FreeSwitch
CHAPTER 6
SMS Configuration
6.1 Configuration
SMS braodcasting is supported as standard by Newfies-Dialer, allowing Newfies-Dialer to send out thousands or
millions of SMS messages to contacts.
The SMS gateway supports the following gateways, Clickatell (http://www.clickatell.com/) and SMSGlobal
(http://www.smsglobal.com). Additionally, Khomp hardware is supported to allow the use of SIM cards in house.
See http://www.khomp.com.br/ for more details.
Go to the Admin interface and identify the SMS Gateway section, and click on Gateways. Listed by default are three
gateways, Clickatell, SMSGlobal and Khomp. Those that you don’t want to be configured can be deleted.
Click the gateway to be configured and edit the pre-filled settings and populate the fields with the credentials supplied
by your SMS provider:
URL:
• http://localhost:8000/admin/sms/gateway/
• http://localhost:8000/admin/sms/gateway/add/
29
Newfies-Dialer Documentation, Release 2.20.2
6.1.1 Clickatell
Clickatell settings:
{
"api_id": "_API_ID_",
"password": "_PASSWORD_",
"from": "_SENDER_ID_",
"user": "_USERNAME_",
"concat": "3"
}
Edit _API_ID_, _Sender_ID_, _USERNAME_ and _PASSWORD_ to the credentials provided by Clickatell and leave
everything else as it is, and click save.
6.1.2 SMSGlobal
Edit _Sender_ID_, _USERNAME_ and _PASSWORD_ to match the credetials issued by SMSGlobal, leave every-
thing else unchanged and save.
6.1.3 Vitelity
Vitelity: http://www.vitelity.com/services_sms/
You will need to turn on API access for whatever IP your Newfies-Dialer installation is hosted on, create a shortcode
keyword, and set a default response to that keyword.
Here it’s how you should configure the new SMS Gateway to support Vitelity:
Name:
SMSvitelity
Base URL:
http://smsout-api.vitelity.net/api.php
Recipient keyword:
dst
Content keyword:
msg
Status mapping:
{
"fail": "Error",
"ok": "Sent"
}
Success format:
6.1. Configuration 31
Newfies-Dialer Documentation, Release 2.20.2
.*\n*.*\n*.*<status>(?P<status_message>.+)</status>\n*<response>(?P<status_code>.+)</response>(?P<gat
6.1.4 Khomp
Khomp hardware is supported to all the use of SIM cards in house. See http://www.khomp.com.br/ for more details.
The hardware needs to be configured for Freeswitch, see http://wiki.freeswitch.org/wiki/Khomp for more details.
Additionally, the SMS Khomp API needs to be installed to link Newfies-Dialer and Khomp hardware which is available
at https://github.com/areski/sms-khomp-api.
Contact us (http://www.newfies-dialer.org/about-us/contact/) for support and assistance.
6.2 Messages
The messages section in the admin screens shows the status of the messages, e.g. success or failure as well as the
status message.
6.3 Providers
This area is not operational at the moment and is as a place-holder for future development.
6.4 Replies
This area is not operational at the moment and is as a place-holder for future development
User Guide
Contents:
7.1 Overview
Newfies-Dialer is an open source VoIP Dialer based on distributed message passing. It has been built to support cloud
servers and also works on standalone servers. It uses Freeswitch (VoIP Server) to outbound calls, but support for other
VoIP Servers such as Asterisk could be easily added in the future. The platform is focused on real-time operations and
task call distributions to clustered brokers and workers.
Newfies-Dialer is a computerised system that automatically dials a group of telephone numbers for connection to
assigned campaigns.
Features
• Restful-API based to easily integrate the platform dialer with third-party applications
• Web-based administrative/customer interfaces
• Lower operating costs
• Calls are made through Internet VoIP. No need for telephony hardware
• Call reports and Statistics
• Freeswitch Set-Up
• Create Gateway
• Dialer Settings
• Create Survey
• Survey Nodes
• Survey Branching
• Create call list
• Create campaign
• VoIP Call Report
• Survey Report
33
Newfies-Dialer Documentation, Release 2.20.2
Then in the Freeswitch CLI (fs_cli) “sofia profile external restart reloadxml”. When the command is complete, check
the gateway has registered with the command “sofia status”.
Having created the gateway in Freeswitch, Newfies-Dialer has to be told that it can use it. In admin, add a new dialer
gateway, e.g. sofia/gateway/myprovider/ (The final / is important) where “myprovider” is the gateway name setting
used in above xml file in Freeswitch.
Only the fields in bold are compulsory.
Dialer settings has to be mapped with system users who are going to create campaigns & contacts. If dialer setting is
not mapped with system users, notification & mail has been sent to Super admin user.
To create restrictions (like the Max. no of campaign, Max no of contacts etc.) for system User, Click on Add in dialer
settings list of admin side. Add numeric values for the limit.
To apply the dialer settings limit on a system user, click on Customers or Admins in admin UI, select the user to
update, & apply the settings from the dialer settings list.
Dialer settings:
The survey application for Newfies-Dialer allows polls and surveys to be taken over the phone.
Each contact is called, and then played a sound file. After the sound file is heard, the user can enter their answer
through the phone keypad using keys 0 to 9.
Therefore before creating the survey, the first job is to upload the audio for the survey. One audio file is required for
each question.
Uploading Audio Files:
Select Audio Files from the top menu then click add.
Enter a name to describe the audio, then click chose file, select the file you require from your computer, then click
submit.
Note that only mp3, Wav and ogg formats are supported.
The audio file will then be uploaded and renamed so that it is unique.
Create the Survey:
URL:
• http://localhost:8000/survey/
• http://localhost:8000/survey/add/
• http://localhost:8000/survey/1/
• Timeout, the amount of time before it is considered that no input has been received.
• Check Validity, whether the answer is deemed valid.
• Audio Invalid Input, The audio to play when invalid input is received.
• Survey Complete, check this field to mark the survey is complete for reporting & retry purposes.
There is many type of survey nodes which allow to create complex IVR applications. On each node you will be able
to perform call transfer, capture digits, go to conference room, add a contact to the DNC list and much more, see the
list of survey nodes Survey Nodes.
The flow of the survey is determined by Survey Branching, which will pass the contact onto the next node depending
on the parameters you set for instance, invalid entry, any key or a specified key.
To create a call list, click on Add in Phonebook list, add name of phonebook & its description. Click on Contacts
and add phone numbers in the contact list. You can also import your call list from csv files, via clicking on Import
contact.
Update Phonebook:
Contact List:
Import contact:
To create a campaign, click on Add in campaign list, add details for the campaign. Important: Add the campaign’s
start and end dates with times & week-day exceptions. Select the gateway through which calls will be routed & the
phonebook(s) linked with the contacts.
Campaign list:
Update Campaign:
As per the status of a call-request, it will be stored in the VoIP call records. This gives information of all the calls &
call statistics made with the call-request and also you can search for records on the basis of date range. You can export
the VoIP call report into a csv file.
When the survey is complete, the survey results can be inspected by clicking Reporting on the top and selecting Survey
Results from the drop-down.
• Call Transfer
• Capture Digits
• Conference
• DNC
• Hangup
• Multi-Choice
• Play Message
• Rating Question
• Record Message
• SMS Message
• Audio Invalid Input, The audio to play when invalid input is received.
• Survey Complete, check this field to mark the survey is complete for reporting & retry purposes.
Used for “press one” campaigns and live lead generation. This node bridges the call to the number in the Phone
Number field when the contact answers.
The field can have a telephone number or something like sofia/gateway/my.gateway/12345 which will direct the call
via a specified gateway (my.gateway) to number 12345.
In order to support screen-pops and deliver other data, there has been some data included in the SIP message
By default the following data is included in the SIP header on call transfer: P-CallRequest-ID is the Call request
ID P-Contact-ID is is the Contact ID.
It is envisaged that these ID numbers can be used to do database look-ups on the Newfies-Dialer database.
Furthermore, there is a optional SIP header that can be added.
P-Contact-Transfer-Ref:
This can be added against the Contact in the “Additional Parmeters (JSON)” field. Simply add the “transfer_ref”
keyword and string to send in the SIP message as follows:
{“transfer_ref”: “My-Unique-Ref-Number”}
In the SIP headers, you will see:
Captures a series of digits, e.g. a telephone number or account number and stores it in the reporting. The number of
digits and the minimum and maximum values can be set.
7.3.3 Conference
Set up a conference with outbound calls. The default conference number in Freeswitch is 9888. The Freeswitch
dialplan can be adjusted to add more conferences.
7.3.4 DNC
Do Not Call node, which will add the called contact to the DNC list configured in the campaign.
7.3.5 Hangup
7.3.6 Multi-Choice
Multi-Choice offering options 0 to 9. The value placed in the “Key X” fields appears in the survey reports.
Survey branching can be used to control the flow of the IVR depending on the key pressed.
Play message is simply to play a message, either with TTS or pre-recorded audio.
Rating allows the entry of a digit or digits from 1 to X, where X is a number you select.
Record a message, the system stops recording after 3 seconds of silence, or by pressing the # key. The IVR flow will
then continue.
Recordings can be listened to in the survey reports menu.
Play a message to the customer, either via TTS or audio file, then send an SMS message to the customer.
Note that when the campaign is created, an SMS gateway must be selected under the Dialer tab.
Reports on SMS messages can be be viewed under the Reporting section.
• Login Page
• Phonebook
• Contact
• Survey
• Campaign
• Dashboard
• User Settings
• SMSCampaign
• Calendar Setting
• Calendar User
• Calendar
• Event
• Alarm
• Reports
Index page for the customer interface after successful login with user credentials
7.4.2 Phonebook
The phonebook list will be displayed from the following URL. You can add a new phonebook by clicking Add
phonebook and add the name of a phonebook and its description. Also from the phonebook list, click on the
phonebook to update.
URL:
• http://localhost:8000/phonebook/
7.4.3 Contact
The contact list will be displayed from following the URL. You can add a new contact by clicking Add contact
& adding the contact details (i.e. phone number, name, description about contact, contact status) under the logged in
user’s phonebook from the phonebook list. On the contact list, click on the contact to update.
URL:
• http://localhost:8000/contact/
To import bulk contacts into a phonebook, click on Import. where you can upload contacts via a CSV file under a
logged in user’s phonebook.
URL:
• http://localhost:8000/contact_import/
7.4.4 Survey
The survey application for Newfies-Dialer allows polls and surveys to be taken over the phone.
Each contact is called, and then played a sound file. After the sound file is heard, the user can enter their answer
through the phone keypad using keys 0 to 9.
Therefore before creating the survey, the first job is to upload the audio for the survey. One audio file is required for
each question.
Uploading Audio Files:
Select Audio Files from the top menu then click add.
Enter a name to describe the audio, then click chose file, select the file you require from your computer, then click
submit.
Note that only mp3, Wav and ogg formats are supported.
The audio file will then be uploaded and renamed so that it is unique.
Create the Survey:
URL:
• http://localhost:8000/module/survey/
• http://localhost:8000/module/survey/add/
• http://localhost:8000/module/survey/1/
7.4.5 Campaign
The campaign list will be displayed from the following URL. You can add a new campaign for the logged in user by
clicking Add campaign. When adding a campaign, it is important to add the campaign’s start and end dates with
time & week-day exceptions. Select the gateway through which calls will be routed & phonebook(s) that are linked
with contacts from the campaign list, click on campaign to update.
URL:
• http://localhost:8000/campaign/
7.4.6 Dashboard
Dashboard provides a contact and call reporting for the running campaign.
7.4.8 SMSCampaign
The sms campaign list will be displayed from the following URL. You can add a new sms campaign for the logged
in user by clicking Add sms campaign. When adding a sms campaign, it is important to add the campaign’s
start and end dates with time & week-day exceptions. Select the sms gateway through which smses will be routed &
phonebook(s) that are linked with contacts from the sms campaign list, click on sms campaign to update.
URL:
• http://localhost:8000/sms_campaign/
URL:
• http://localhost:8000/module/calendar_setting/
URL:
• http://localhost:8000/module/calendar_user/
7.4.11 Calendar
URL:
• http://localhost:8000/module/calendar/
7.4.12 Event
URL:
• http://localhost:8000/module/event/
• http://localhost:8000/module/event/1/
7.4.13 Alarm
URL:
• http://localhost:8000/module/alarm/
7.4.14 Reports
URL:
• http://localhost:8000/voipcall_report/
URL:
• http://localhost:8000/survey_report/
URL:
• http://localhost:8000/subscribers/
URL:
• http://localhost:8000/sms_report/
• Dashboard
• Admin User Management
• Customers
• Sites
• Phonebook
• Contact
• Campaign
• Subscriber
• Dialer Settings
• Dialer Gateway
• Survey
• Call Request
• Call contacts/subscribers
• VoIP Call Report
7.5.1 Dashboard
Dashboard page for the admin interface after successful login with superuser credentials
The Admin section allows you to create administrators who have access the admin screens. Levels of access can be set.
If the administrator is to be allowed to make calls, then a gateway and dialer- settings must be set for that administrator.
7.5.3 Customers
Customers only have access to the customer panel. Before a customer can make calls, they must have both dialer-
settings and a gateway attached to their account.
7.5.4 Sites
Some of the features of Newfies-Dialer are dependent on the hostname or IP address, so this has to be set correctly in
site address.
In the Admin dashboard, locate the “Sites” link and click change. By default, there will be an entry of “exam-
ple.com”. Edit this setting to reflect the hostname of the server, or if you do not have this set up, the IP address. e.g.
http://www.domain.tld:8008 or in the case of an IP address, http://192.168.1.200:8008
• http://localhost:8000/admin/sites/
7.5.5 Phonebook
The phonebook list will be displayed from the following URL. You can add a new phonebook by clicking Add
phonebook and adding the name of the phonebook and its description, Also from the phonebook list, click on the
phonebook that you want to update.
URL:
• http://localhost:8000/admin/dialer_campaign/phonebook/
7.5.6 Contact
The contact list will be displayed from the following URL and you can add a new contact by clicking Add contact
& adding the contact details (i.e. phone number, name, description about contact, contact status) to one phonebook
from the phonebook list.
If the contact is active and the linked phonebook is also attached to a running campaign, then the contact will be added
into subscriber.
From the contact list, click on the contact that you want to update.
URL:
• http://localhost:8000/admin/dialer_campaign/contact/
To Add/Update a contact
URL:
• http://localhost:8000/admin/dialer_campaign/contact/add/
• http://localhost:8000/admin/dialer_campaign/contact/1/
To import bulk contacts into a phonebook, click on Import contacts. where you can upload the contacts via a
CSV file in to one phonebook.
URL:
• http://localhost:8000/admin/dialer_campaign/contact/import_contact/
7.5.7 Campaign
The campaign list will be displayed from the following URL. You can add a new campaign by clicking Add
campaign. While adding a campaign, it is important to add campaign’s start and end dates with time & week-day
exceptions. Also select the gateway through which calls will be routed & the phonebook(s) linked with contacts.
From the campaign list, click on the campaign that you want to update.
URL:
• http://localhost:8000/admin/dialer_campaign/campaign/
7.5.8 Subscriber
The Subscriber list will be displayed from the following URL. You can add a new subscriber by clicking Add
Subscriber. Also from the campaign subscriber list, click on the subscriber to update.
While creating a contact, if its linked phonebook is also attached to a running campaign, then the contact will be added
into the subscriber.
URL:
• http://localhost:8000/admin/dialer_campaign/campaignsubscriber/
To Add/Update Subscriber
URL:
• http://localhost:8000/admin/dialer_campaign/campaignsubscriber/add/
• http://localhost:8000/admin/dialer_campaign/campaignsubscriber/1/
The dialer settings list will be displayed from the following URL. The Dialer settings list is applied to a system User.
You can add a new setting by clicking Add Dialer Settings and add numeric values for the limit. Also from
the dialer settings list, click on the setting to update.
URL:
• http://localhost:8000/admin/dialer_settings/dialersetting/
To apply dialer settings limit to a User, click on Customers or Admins, select the user to be updated & apply
settings from the dialer settings list.
URL:
• http://localhost:8000/admin/auth/staff/1/
The Dialer Gateway list will be displayed from the following URL. You can add a new gateway by clicking Add
Dialer Gateway and adding the details (e.g. gateway name, hostname, protocol etc.). Also from the gateway list,
click on the gateway that you want to update.
URL:
• http://localhost:8000/admin/dialer_gateway/gateway/
7.5.11 Survey
The survey application for Newfies-Dialer allows polls and surveys to be taken over the phone.
Each contact is called, and then played a sound file. After the sound file is heard, the user can enter their answer
through the phone keypad using keys 0 to 9.
Therefore before creating the survey, the first job is to upload the audio for the survey. One audio file is required for
each question.
Add Audio File
CLick Audio Files, then click Add.
Give the audio file a descriptive name, chose the file to upload.
In the Admin screens, there are options to convert to other formats, change the number of channels, e.g. change from
stereo to mono, and down-sample the frequency. Finally, the user can be assigned.
Survey Admin Functions
From the admin screen, Surveys can be added, deleted and edited. Additionally, survey questions can be re-ordered.
URL:
• http://localhost:8000/admin/survey/surveyapp/
To Add/Update a survey
URL:
• http://localhost:8000/admin/survey/surveyapp/add/
• http://localhost:8000/admin/survey/surveyapp/1/
The call request list will be displayed from the following URL. You can add a new call request by clicking Add Call
Request. Also from the call request list, click on the request to update.
URL:
• http://localhost:8000/admin/dialer_cdr/callrequest/
A call-request will spool a call directly from the platform using a dialer gateway and update the call-request status
after receiving a response from the gateway.
A VoIP Call list will be displayed from following URL. You can not add new call reports.
URL:
• http://localhost:8000/admin/dialer_cdr/voipcall/
From version 2.10, Newfies-Dialer includes an appointments module supporting appointment reminders. Newfies-
Dialer was originally designed to provide powerful voice broadcasting, making thousands or even millions of calls
via gateways to different audiences. One of the major limitations of voice broadcasting was that it is difficult, or even
impossible to target a call to a specific contact at a programmed or preset time. The appointments module addresses
this limitation allowing calls to be sent at a preset time.
The appointments module has the following components and are described in this section.
A survey is created with the required messages and actions. Once the Calendar settings and users are configured, an
event is created attached to a calendar, then an alarm is triggered by the Event and sent out via voice call, email or
SMS. In the case of a Voice Call, the survey selected will be executed.
Calendar User
The Calendar-User is a sub-user of the Newfies-Dialer User. The Calendar-User will be the customer who
is creating the reminders or alarms. For instance, if you create a appointment reminders for a Doctor’s
surgery, then the calendar user may be an individual doctor or secretary. The rights of a Calendar-User
can be configured via the Calendar-User’s settings.
Note that a Calendar-User does not log into the interface, alarms are created and configured via the
Newfies-Dialer login.
Calendar
Calendar is an entity that helps to group and collect events.
Event
An Event sets the time, date and duration of when the alarms are to be sent out. An event is linked to a
calendar. The Event also includes custom rules that can be set up to trigger an event every day, week or
month, as well as create more complex rules such as; repeat every Tuesday at a given time.
A data field is provided and used to pass extra variables You can pass custom variables by using the
“Additional Parameters (JSON)” field which allows you to add custom key-values that will be used in the
survey and replaced by the Text2Speech processor.
For example; set “Additional Parameters (JSON)” to:
{"doctor_name": "Herbert", "apt_date" : "10 January at 5pm"}
You can use “sms_phonenumber” as one of the “Additional Parameters”, in this case it will overwrite the
sms destination number when sending SMS during an IVR call:
{"sms_phonenumber": "6004891138"}
When a survey is created with a node that plays TTS, you can replace the key-values in the text:
"We are calling you on behalf of {doctor_name}, we want to remind you of your appointment at {ap
Rule
Newfies-Dialer comes with a set of predefined rules which can be used for the events, e.g. the Daily rule,
which, if applied to an event, will make the event recur every day.
The Rule is based on the rrule python module. The rrule module offers a small, com-
plete, and very fast implementation of the recurrence rules documented in the iCalendar RFC :
http://www.ietf.org/rfc/rfc2445.txt
More info about rrule: http://labix.org/python-dateutil#head-470fa22b2db72000d7abe698a5783a46b0731b57
Events happen at a specified time and you can also program the event to recur daily or follow recurring rules, In order
to get notified about an event it is necessary to create Alarms related to the event.
Alarm
An Alarm notifies by SMS, voice call or email that an event is occuring. Other methods could be added.
Alarms have a number of settings which offer a great deal of flexibility.
Settings of Alarms
• Method: Set the method to use for an Alarm (Voice Call, SMS or email)
• Date Start: Date and time to trigger the alarm which generally will be similar to the event date and time.
• Alarm Phone Number: Set the phone number to be called by the alarm.
• Alarm Email: Set the email address to send the alarm email.
• Daily Start & Daily Stop: Configure when alarms are allowed to triggered during the day, for instance, prevent
alarms before 6AM and 10PM.
• Advance Notice: How long before the alarm occurs to start the notification.
• Max Retry: Applies to a voice call, and sets the number of retries in the event of a failed call.
• Retry Delay: Interval between each call retry
• Phone Number SMS Failure: In the case of a failed voice call, an SMS is triggered to this number
• URL Cancel / URL Confirm / Phone Number Transfer: A feature that will be implemented in a future version.
Alarm Result
A mechanism is provided to store the results from Alarms. For instance, imagine that a calendar user is
calling all clients at the beginning of the week to tell them about their forthcoming appointment and ask
them if they want to confirm, cancel or re-schedule.
For this scenario, a Survey application is built with the 3 options:
- Press 1 to Confirm,
- Press 2 to Cancel
- or Press 4 to Re-schedule your appointment
You will simply need to create a Rating Question, as this section type will behave differently with the
appointment module and the result of the question will be stored in the Alarm result. This will be practical
for future reporting and will allow the calendar user to see all the Events that need to be cancelled or re-
scheduled.
Alarm Requests
Keeps track of the alarms attempts, it’s a useful resource to provide detailed logs.
Calendar User Settings
The Calendar Settings determine the Caller ID name and number to be delivered to the called party, the
timeout and the voice and SMS gateway to use. There is also an option to set the AMD (if installed)
settings.
This diagram of the appointment models should help developers and integrators to understand the system.
The Appointment Module has been built with flexibility in mind, trying to cover several scenarios required by different
applications and software to perform complex appointment reminder applications or alarm systems.
Modules you could build with the Newfies-Dialer Appointment Module may include:
Each of the calendar users will have a calendar in which they create an wake up event, decide when the
event will be triggered, how many times, delay between retries, etc...
The voice application will then play something like “Good morning, it’s 7am and it’s time to wake up and
get ready for work”
Appointment Reminder
In a common appointment reminder scenario, your user could be doctors surgery with a need to call their
patient 24 hours before each appointment and offer an an IVR menu that will call their patient and say
“Hello, you have an appointment tomorrow with Doctor {doc_name} at {apt_date}, please press 1 to
confirm, press 2 to cancel or press 3 to reschedule”
When the user presses any key during a Rating type of Node on the IVR application, this is considered as
a result and will be stored in the alarm result field. If the patient presses 2, it will be seen in the results
and could be displayed to the doctor’s receptionist, if the user presses 3, the call could be transferred to
reception to re-arrange the appointment.
The Appointment Module supports Voice Calls, SMS and email, so the system could be configured to
send a passive SMS as an extra reminder one hour before the appointment.
Some users might want to simply remember important dates and events, such as a meeting, birthday
or to pickup their child from music class. Each Calendar User can create as many Calendars as they
want, for instance they could have a personal calendar and a work calendar so as not to mix personal and
professional events.
To be able to setup and receive alarm there is a process to follow and is described below:
1. Create and Configure Voice Gateway and SMS gateway.
This is done via the admin panel: http://127.0.0.1:8000/admin
2. Create an IVR application (Survey) that will be played to the user receiving the calls
Go to the survey module and create an application with several IVR nodes:
http://127.0.0.1:8000/module/survey/
3. Seal the Survey. This prevents the survey being modified and is important to ensure accurate and consistant
reporting on each survey node.
There is a button in the Action column against the survey to seal the survey and prevent further
editing: http://127.0.0.1:8000/module/survey/
4. Create Calendar User Settings, define a callerID and configure the gateway to use.
Add new Calendar Settings at: http://127.0.0.1:8000/module/calendar_setting/
5. Create Calendar User, set credentials and permissions for this user and assign them to Calendar Setting.
Create a user with a username & password: http://127.0.0.1:8000/module/calendar_user/
6. Create Calendar and give it a name:
http://127.0.0.1:8000/module/calendar/
7. Create Event, for instance an event happening today at 11am, define when the event start and finish, add an
recurring rule if the event is to recur.
Create Event can be done by click on Add button : http://127.0.0.1:8000/module/event/
8. Create Alarm to receive notification when Events are happening. e.g. Create an alarm of type “Call”, link it
to the previously created event, add a date and time for the alarm and the phone number top be called, then
configure the rest of the alarm settings as required.
Create Alarm can be done by click on Add button : http://127.0.0.1:8000/module/alarm/
9. Access results of Alarm Requests.
Access detailed logs of the Alarm by browsing to alarm request at :
http://127.0.0.1:8000/admin/appointment/alarmrequest/
One of the most powerful features of The Appointment Module are the API’s that allow developers to build an appli-
cation on top of Newfies-Dialer or integrate Newfies-Dialer into third party software such as CRM systems.
Described below is an example of work flow with the API’s.
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type:application/json" -X POST --data '{"l
Result:
HTTP/1.0 201 CREATED
Date: Mon, 16 Dec 2013 11:19:30 GMT
Server: WSGIServer/0.1 Python/2.7.3
Vary: Accept, Accept-Language, Cookie
Content-Language: en
Content-Type: application/json; charset=utf-8
Location: http://localhost:8000/rest-api/calendar-setting/3/
Allow: GET, POST, HEAD, OPTIONS
{
"user": "manager",
"sms_gateway": "http://localhost:8000/rest-api/sms-gateway/1/",
"url": "http://localhost:8000/rest-api/calendar-setting/3/",
"label": "cal_setting",
"callerid": "123456",
"caller_name": "xyz",
"call_timeout": 60,
"survey": "http://localhost:8000/rest-api/sealed-survey/1/",
"aleg_gateway": "http://localhost:8000/rest-api/gateway/1/",
"voicemail": false,
"amd_behavior": 1,
"voicemail_audiofile": null,
"created_date": "2013-12-16T11:19:29.994Z",
"updated_date": "2013-12-16T11:19:29.994Z"
}
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type:application/json" -X POST --data '{"u
Result:
HTTP/1.0 201 CREATED
Date: Mon, 16 Dec 2013 11:20:33 GMT
Server: WSGIServer/0.1 Python/2.7.3
Vary: Accept, Accept-Language, Cookie
Content-Language: en
Content-Type: application/json; charset=utf-8
Location: http://localhost:8000/rest-api/calendar-user/6/
Allow: GET, POST, HEAD, OPTIONS
{
"url": "http://localhost:8000/rest-api/calendar-user/6/",
"username": "caluser3",
"password": "pbkdf2_sha256$12000$Rb78UOwQeL2T$YWWy02zcxtFTIDG0ac4lJ7i9jtUbK7FCG1IkgARDVAE=",
"last_name": "",
"first_name": "",
"email": "caluser3@gmail.com",
"groups": []
}
Result:
HTTP/1.0 200 OK
Date: Mon, 16 Dec 2013 11:23:44 GMT
Server: WSGIServer/0.1 Python/2.7.3
Vary: Accept, Accept-Language, Cookie
Content-Type: application/json; charset=utf-8
Content-Language: en
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
{
"manager": "manager",
"id": 4,
"user": 6,
"address": null,
"city": null,
"state": null,
"country": "",
"zip_code": null,
"phone_no": null,
"fax": null,
"company_name": null,
"company_website": null,
"language": null,
"note": null,
"accountcode": 35365532,
"created_date": "2013-12-16T11:20:33.456Z",
"updated_date": "2013-12-16T11:23:44.342Z",
"calendar_setting": 3
}
Result:
HTTP/1.0 201 CREATED
Date: Mon, 16 Dec 2013 11:25:01 GMT
Server: WSGIServer/0.1 Python/2.7.3
Vary: Accept, Accept-Language, Cookie
Content-Language: en
Content-Type: application/json; charset=utf-8
Location: http://localhost:8000/rest-api/calendar/4/
Allow: GET, POST, HEAD, OPTIONS
{
"url": "http://localhost:8000/rest-api/calendar/4/",
"name": "mynewcalendar",
"user": "http://localhost:8000/rest-api/calendar-user/6/",
"max_concurrent": 1,
"created_date": "2013-12-16T11:25:01.378Z"
}
Result:
HTTP/1.0 201 CREATED
Date: Mon, 16 Dec 2013 11:26:56 GMT
Server: WSGIServer/0.1 Python/2.7.3
Vary: Accept, Accept-Language, Cookie
Content-Language: en
Content-Type: application/json; charset=utf-8
Location: http://localhost:8000/rest-api/event/3/
Allow: GET, POST, HEAD, OPTIONS
{
"url": "http://localhost:8000/rest-api/event/3/",
"title": "event_with_new_title",
"description": null,
"start": "2013-12-10T12:34:43",
"end": "2013-12-15T14:43:32",
"creator": "http://localhost:8000/rest-api/calendar-user/6/",
"created_on": "2013-12-16T11:26:56.056Z",
"end_recurring_period": "2013-12-27T12:23:34",
"rule": null,
"calendar": "http://localhost:8000/rest-api/calendar/4/",
"notify_count": 0,
"status": 1,
"data": null,
"parent_event": null,
"occ_count": 0
}
Events, occurring over time, will have a tail of sub-events linked to the parent event. Usually the sys-
tems integrator using API’s will keep track of the parent event and at some stage may need to retrieve
information about the sub-events.
This is achieved by using the API /get_list_child/
CURL Usage:
curl -u username:password -H 'Accept: application/json' http://localhost:8000/rest-api/event/5/g
Result:
HTTP/1.0 200 OK
Date: Thu, 19 Dec 2013 16:37:22 GMT
Server: WSGIServer/0.1 Python/2.7.3
Vary: Accept, Accept-Language, Cookie
Content-Type: application/json
Content-Language: en
Allow: GET, HEAD, OPTIONS
Set-Cookie: sessionid=lklh4z9cop3jhh48n9i9ioe2wkp8simx; expires=Thu, 02-Jan-2014 16:37:22 GMT;
{
"url": "http://localhost:8000/rest-api/event/11/",
"start": "2013-12-17 16:26:07+00:00",
"end": "2013-12-17 17:26:07+00:00",
"description": "",
"title": "EventTitle"
}
In some scenarios it may be necessary to pause an alarm being triggered. As an alarm is linked to all
occurence of an event created, it’s not necessary to update the status of the parent event or all the child
events, only the last event needs updated.
This is achieved by using the API /update_last_child_status/
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type: application/json" -X PATCH --data '{
Result:
HTTP/1.0 200 OK
Vary: Accept, Accept-Language, Cookie
Content-Type: application/json
Content-Language: en
Allow: PATCH, OPTIONS
Set-Cookie: sessionid=dmzjzwt3b6l0eru6vq27vt9ixd9z84ei; expires=Tue, 31-Dec-2013 10:52:26 GMT;
Connection: close
Server: Werkzeug/0.8.3 Python/2.7.3
Date: Tue, 17 Dec 2013 10:52:26 GMT
{
"status": "event status has been updated"
}
In order to provide logs or stats to your customers/users, information can be retrieved from the AlarmRe-
quest for a given event.
The result is a nested JSON structure which gives the Event-ID with the Alarm-ID related to the event,
plus the list alarm-request-ID for each of those Alarms.
This is achieved by using the API /get_nested_alarm_request/
CURL Usage:
curl -u username:password --dump-header - -H 'Accept: application/json' http://localhost:8000/re
Result:
HTTP/1.0 200 OK
Date: Thu, 19 Dec 2013 16:41:22 GMT
Server: WSGIServer/0.1 Python/2.7.3
Vary: Accept, Accept-Language, Cookie
Content-Type: application/json
Content-Language: en
Allow: GET, HEAD, OPTIONS
Set-Cookie: sessionid=w7ze05sob1esrsykp94e0hi8gg1tq0kv; expires=Thu, 02-Jan-2014 16:41:22 GMT;
{
"event-url": "http://localhost:8000/rest-api/event/5/",
"event-5": {
"alarm-23": {
"url": "http://localhost:8000/rest-api/alarm/23/",
"alarm-request-48": {
"status": "4",
"url": "http://localhost:8000/rest-api/alarm-request/48/",
"alarm-callrequest": "http://localhost:8000/rest-api/callrequest/15731/",
"duration": "0",
"date": "2013-12-18 17:19:23.368534+00:00",
"callstatus": "0"
},
"alarm-request-49": {
"status": "5",
"url": "http://localhost:8000/rest-api/alarm-request/49/",
"alarm-callrequest": "http://localhost:8000/rest-api/callrequest/15732/",
"duration": "13",
"date": "2013-12-18 17:20:05.062474+00:00",
"callstatus": "0"
}
},
"alarm-21": {
"url": "http://localhost:8000/rest-api/alarm/21/",
"alarm-request-40": {
"status": "5",
"url": "http://localhost:8000/rest-api/alarm-request/40/",
"alarm-callrequest": "http://localhost:8000/rest-api/callrequest/15722/",
"duration": "13",
"date": "2013-12-16 17:20:27.849068+00:00",
"callstatus": "0"
},
}
}
}
Some APIs can be explored and tested easily via the API-Explorer. This is the best way to understand and read about
all the APIs provided by Newfies-Dialer.
To access the API-Explorer go to http://127.0.0.1:8000/rest-api/
Creating an SMS campaign is straight-forward in Newfies-Dialer and is usually done via the customer interface.
The first step is to create a phone book consisting of the SMS contacts to be called. Click Contact at the top, then
Phonebooks on the side menu, add a new Phonebook and give it a name, for instance SMS-PB1
Manually add or import contacts to the phone book created in the previous step. Note that most SMS providers require
you to properly format the numbers into IETF format, that is to say, +1234567890 rather than 001234567890 or
0111234567890.
Click Campaign on the top menu, then select SMS Campaign from the dropdown.
Click Add and fill in the fields:
• Name: A descriptive name for the Campaign
• Caller ID Number: The number to deliver as the caller ID
• SMS Gateway: Select the gateway to use for the campaign
• Description: Notes on the campaign
• Phonebook: Select one or more phone books containing the contacts to call
• Text Message: Enter the message to be sent, with no more than 160 characters.
Tag Replacement can be used here to personalise the message, e.g. Hello {first_name} {last_name} will
replace whatever you have in the first and last name fields against the contact.
At this point the campaign could be saved and sent, however there are a number of other parameters that can be
adjusted:
Completion
URL:
• http://localhost:8000/sms_campaign/add/
• http://localhost:8000/sms_campaign/1/
Schedule
7.7.4 Reporting
To view the SMS reports, click reporting then SMS reports on the side menu. The call data records for SMS messages
are listed under the SMS tab, while a daily report shows the number of SMS’s sent by day.
Records can be filtered on date, status and campaign.
SMS CDR can be exported in CSV, XML and Excel formats.
URL:
• http://localhost:8000/sms_report/
Developer doc
Contents:
8.1 Prerequisites
To fully understand this project, developers will need to have a advanced knowledge of:
• Django : http://www.djangoproject.com/
• Celery : http://celeryproject.org/
• Python : http://www.python.org/
• Freeswitch : http://freeswitch.org/
• Freeswitch : Event_Sockets (wiki.freeswitch.org/wiki/Mod_event_socket)
8.2.1 Style
8.2.2 Structure
97
Newfies-Dialer Documentation, Release 2.20.2
| `-- fixtures
|-- frontend - The code for dashboard, forgot password
|-- static
| |-- newfies
| | |-- css
| | |-- js
| | |-- icons
| | `-- images
|-- user_profile - The code for user profile to extend auth model of Django
|-- resources - This area is used to hold media files
|-- usermedia - This folder is used to upload audio files
`-- templates - This area is used to override templates
|-- admin
| |-- dialer_contact
| `-- dialer_cdr
|-- admin_tools
|-- registration
|-- memcache_status
`-- frontend
8.4.1 Phonebook
•user - Foreign key relationship to the User model. Each phonebook is assigned to a User
Name of DB table: dialer_phonebook
phonebook_contacts()
This will return a count of the contacts in the phonebook
8.4.2 Contact
8.4.3 CampaignManager
class dialer_campaign.models.CampaignManager
Campaign Manager
get_expired_campaign()
Return all the campaigns which are expired or going to expire based on the expiry date but status is not
‘END’
get_running_campaign()
Return all the active campaigns which will be running based on the expiry date, the daily start/stop time
and days of the week
8.4.4 Campaign
8.4.5 Subscriber
8.4.6 Callrequest
8.4.7 VoIPCall
8.4.8 Gateway
•secondused -
•failover -
•addparameter -
•count_call -
•count_in_use -
•maximum_call -
•status - Gateway status
Name of DB table: dialer_gateway
8.4.9 DialerSetting
8.4.10 Survey_abstract
8.4.11 Survey_template
8.4.12 Survey
8.4.13 Section_abstract
8.4.14 Section_template
8.4.15 Section
8.4.16 Branching_abstract
8.4.17 Branching_template
8.4.18 Branching
8.4.19 Result
8.4.20 ResultAggregate
8.4.21 UserProfile
8.4.22 CalendarSetting
8.4.23 CalendarUser
8.4.24 CalendarUserProfile
8.4.25 Calendar
name: the name of the calendar events: all the events contained within the calendar. >>> calendar = Calen-
dar(name = ‘Test Calendar’) >>> calendar.save()
get_recent(amount=5, in_datetime=<built-in method now of type object>, tzinfo=<UTC>)
This shortcut function allows you to get events that have started recently.
amount is the amount of events you want in the queryset. The default is 5.
in_datetime is the datetime you want to check against. It defaults to datetime.datetime.now
8.4.26 Event
get_occurrences(start, end)
occurrences_after(after=None)
returns a generator that produces occurrences after the datetime after. Includes all of the persisted
Occurrences.
update_last_child_status(status)
we will search for the last created child of an event and update his status to the status value
Note for the integrators: We can pause an event for 12hours but after that we will have to stop and create
the new event.
8.4.27 Alarm
8.4.28 SMSCampaign
common_sms_campaign_status(status)
SMS Campaign Status (e.g. start | stop | abort | pause) needs to be changed. It is a common function for
the admin and customer UI’s
Attributes:
•status - selected status for the sms campaign record
Logic Description:
•Selected SMS Campaign’s status needs to be changed. Changed status can be start, stop or pause.
•This function is used by update_sms_campaign_status_admin() &
update_sms_campaign_status_cust()
count_contact_of_phonebook(status=None)
Count the no. of Contacts in a phonebook
get_active_contact()
Get all the active Contacts from the phonebook
get_active_contact_no_subscriber()
List of active contacts that do not exist in Campaign Subscriber
get_active_max_frequency()
Get the active max frequency
get_pending_subscriber(limit=1000)
Get all the pending subscribers from the sms_campaign
get_pending_subscriber_update(limit=1000, status=6)
Get all the pending subscribers from the campaign
is_authorized_contact(str_contact)
Check if a contact is authorized
progress_bar()
Progress bar generated based on no of contacts
sms_campaignsubscriber_detail()
This will link to sms_campaign subscribers who are associated with the sms_campaign
update_sms_campaign_status()
Update the sms_campaign’s status
For example, If campaign is active, you can change status to ‘Pause’ or ‘Stop’
8.4.29 SMSCampaignSubscriber
8.4.30 SMSMessage
8.4.31 SMSTemplate
8.5.1 index
frontend.views.index(request)
Index view of the Customer Interface
Attributes:
•form - LoginForm
•template - frontend/index.html
8.5.2 customer_dashboard
8.5.3 login_view
frontend.views.login_view(request)
Check User credentials
Attributes:
•form - LoginForm
•template - frontend/index.html
Logic Description:
•Submitted user credentials need to be checked. If it is not valid then the system will redirect to
the login page.
•If submitted user credentials are valid then system will redirect to the dashboard.
8.5.4 cust_password_reset
8.5.5 cust_password_reset_done
8.5.6 cust_password_reset_confirm
8.5.7 phonebook_list
8.5.8 phonebook_add
•Add a new phonebook which will belong to the logged in user via the phonebookForm & get
redirected to the phonebook list
8.5.9 phonebook_change
8.5.10 contact_list
8.5.11 contact_add
8.5.12 contact_change
8.5.13 contact_import
8.5.14 campaign_list
8.5.15 campaign_add
•Add the new campaign which will belong to the logged in user via CampaignForm & get redi-
rected to campaign list
8.5.16 campaign_change
8.5.17 survey_list
8.5.18 survey_add
8.5.19 survey_change
•form - SurveyForm
•template - survey/change.html
Logic Description:
•Update/delete selected survey from the survey list via SurveyForm & get redirected to survey
list
8.5.20 survey_report
8.5.21 audio_list
8.5.22 audio_add
8.5.23 audio_change
•form - SurveyCustomerAudioFileForm
•template - dialer_audio/audio_change.html
Logic Description:
•Update audio which is belong to the logged in user via the CustomerAudioFileForm & get
redirected to the audio list
8.5.24 calendar_setting_list
8.5.25 calendar_setting_add
8.5.26 calendar_setting_del
8.5.27 calendar_setting_change
8.5.28 calendar_user_add
8.5.29 calendar_user_change
8.5.30 calendar_user_del
8.5.31 calendar_user_change_pw
8.5.32 calendar_list
8.5.33 calendar_add
8.5.34 calendar_del
8.5.35 calendar_change
8.5.36 event_list
8.5.37 event_add
8.5.38 event_del
8.5.39 event_change
8.5.40 alarm_list
8.5.41 alarm_add
8.5.42 alarm_del
8.5.43 alarm_change
8.5.44 sms_campaign_list
8.5.45 sms_campaign_add
8.5.46 sms_campaign_del
•Delete/Stop the selected sms campaign from the sms campaign list
8.5.47 sms_campaign_duplicate
8.5.48 sms_campaign_text_message
8.5.49 update_sms_campaign_status_cust
8.5.50 sms_campaign_change
8.5.51 sms_dashboard
8.5.52 sms_report
8.5.53 export_sms_report
8.6.1 CampaignAdmin
•Before adding campaign, check dialer setting limit if applicable to the user, if matched then the user
will be redirected to the campaign list
8.6.2 SubscriberAdmin
8.6.3 PhonebookAdmin
8.6.4 ContactAdmin
8.6.5 CallrequestAdmin
8.6.6 VoIPCallAdmin
has_add_permission(request)
Remove add permission on VoIP Call Report model
Logic Description:
•Override django admin has_add_permission method to remove add permission on VoIP Call Report
model
used_gateway_link(obj)
Used gateway link to edit gateway detail
user_link(obj)
User link to user profile
8.6.7 GatewayAdmin
8.6.8 DialerSettingAdmin
8.6.9 SurveyAdmin
8.6.10 SectionAdmin
8.6.11 BranchingAdmin
8.6.12 ResultAdmin
8.6.13 ResultAggregate
8.6.14 CalendarSettingAdmin
8.6.15 CalendarUserAdmin
8.6.16 CalendarAdmin
8.6.17 EventAdmin
form
alias of EventAdminForm
8.6.18 AlarmAdmin
8.8.1 post_save_add_contact
dialer_campaign.models.post_save_add_contact(sender, **kwargs)
A post_save signal is sent by the Contact model instance whenever it is going to save.
Logic Description:
•When new contact is added into Contact model, active the campaign list will be checked with
the contact status.
•If the active campaign list count is more than one & the contact is active, the contact will be
added into Subscriber model.
8.9.1 Requirement
Run/Start Celery:
$ /etc/init.d/celery start
or:
$ python manage.py celeryd -l info
Run/Start Redis:
$ /etc/init.d/redis-server start
class dialer_contact.tests.DialerContactModel(methodName=’runTest’)
Test Phonebook, Contact models
class dialer_campaign.tests.DialerCampaignModel(methodName=’runTest’)
Test Campaign, Subscriber models
class dialer_cdr.tests.DialerCdrModel(methodName=’runTest’)
Test Callrequest, VoIPCall models
class dialer_settings.tests.DialerSettingModel(methodName=’runTest’)
Test DialerSetting model
class dialer_gateway.tests.GatewayModel(methodName=’runTest’)
Test Gateway model
class survey.tests.SurveyModel(methodName=’runTest’)
Test Survey, Section, Branching, Result, ResultAggregate Model
• jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling,
animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you
write JavaScript.
• Bootstrap is sleek, intuitive, and powerful front-end framework for faster and easier web development.
• Bootbox is a small JavaScript library which allows you to create programmatic dialog boxes using Twitter’s
Bootstrap modals, without having to worry about creating, managing or removing any of the required DOM
elements or JS event handlers.
• Bootstrap-datepicker Datepicker for Bootstrap
API Reference
Contents:
9.1 AlarmRequestSerializer
9.2 AlarmSerializer
9.3 AudioFileSerializer
Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"url": "http://127.0.0.1:8000/rest-api/audio-files/1/",
"name": "Sample audio",
"audio_file": "upload/audiofiles/audio-file-SODXT-1669906647.wav",
"user": "http://127.0.0.1:8000/rest-api/users/1/",
"created_date": "2013-06-14T18:56:58.550",
"updated_date": "2013-06-14T18:56:58.969"
}
]
}
131
Newfies-Dialer Documentation, Release 2.20.2
9.4 BranchingTemplateSerializer
class apirest.branching_template_serializers.BranchingTemplateSerializer(instance=None,
data=None,
files=None,
con-
text=None,
par-
tial=False,
many=False,
al-
low_add_remove=False,
**kwargs)
Create:
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type:application/json" -X POST --data
Response:
HTTP/1.0 201 CREATED
Date: Fri, 14 Jun 2013 09:52:27 GMT
Server: WSGIServer/0.1 Python/2.7.3
Vary: Accept, Accept-Language, Cookie
Content-Type: application/json; charset=utf-8
Content-Language: en-us
Location: http://localhost:8000/rest-api/survey/1/
Allow: GET, POST, HEAD, OPTIONS
Read:
CURL Usage:
curl -u username:password -H 'Accept: application/json' http://localhost:8000/rest-api/branc
or
Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"url": "http://127.0.0.1:8000/rest-api/branching-template/1/",
"keys": "0",
"created_date": "2013-06-13T12:42:28.531",
"updated_date": "2013-06-13T12:42:28.531",
"section": "http://127.0.0.1:8000/rest-api/section-template/1/",
"goto": null
}
]
}
Update:
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type: application/json" -X PATCH --dat
Response:
HTTP/1.0 202 NO CONTENT
Date: Fri, 23 Sep 2011 06:46:12 GMT
Server: WSGIServer/0.1 Python/2.7.1+
Vary: Accept-Language, Cookie
Content-Length: 0
Content-Type: text/html; charset=utf-8
Content-Language: en-us
9.5 CalendarSerializer
9.6 CalendarSettingSerializer
9.7 CalendarUserSerializer
9.8 CalendarUserProfileSerializer
9.9 CampaignSerializer
Response:
HTTP/1.0 201 CREATED
Date: Fri, 14 Jun 2013 09:52:27 GMT
Server: WSGIServer/0.1 Python/2.7.3
Vary: Accept, Accept-Language, Cookie
Content-Type: application/json; charset=utf-8
Content-Language: en-us
Allow: GET, POST, HEAD, OPTIONS
Read:
CURL Usage:
Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 2,
"campaign_code": "BXTWX",
"name": "Sample survey campaign",
"description": "",
"callerid": "",
"phonebook": [
"http://127.0.0.1:8000/rest-api/phonebook/1/"
],
"startingdate": "2011-12-27T14:35:46",
"expirationdate": "2011-12-28T14:35:46",
"aleg_gateway": "http://127.0.0.1:8000/rest-api/gateway/1/",
"user": "http://127.0.0.1:8000/rest-api/users/1/",
"status": 2,
"content_type": "http://127.0.0.1:8000/rest-api/content-type/49/",
"object_id": 1,
"extra_data": "",
"dnc": "http://127.0.0.1:8000/rest-api/dnc/1/",
"voicemail": false,
"amd_behavior": null,
"voicemail_audiofile": null,
"frequency": 10,
"callmaxduration": 1800,
"maxretry": 0,
"intervalretry": 300,
"calltimeout": 45,
"daily_start_time": "00:00:00",
"daily_stop_time": "23:59:59",
"monday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"saturday": true,
"sunday": true,
"completion_maxretry": 0,
"completion_intervalretry": 900
}
]
}
Update:
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type: application/json" -X PATCH --dat
Response:
Delete:
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type: application/json" -X DELETE htt
Response:
{
"data": "campaign deleted"
}
get_fields(*args, **kwargs)
filter content_type field
validate(attrs)
Validate campaign form
9.10 ContactSerializer
Response:
HTTP/1.0 201 CREATED
Date: Fri, 14 Jun 2013 09:52:27 GMT
Server: WSGIServer/0.1 Python/2.7.3
Vary: Accept, Accept-Language, Cookie
Content-Type: application/json; charset=utf-8
Content-Language: en-us
Allow: GET, POST, HEAD, OPTIONS
Read:
CURL Usage:
Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"url": "http://127.0.0.1:8000/rest-api/contact/1/",
"phonebook": "http://127.0.0.1:8000/rest-api/phonebook/1/",
"contact": "55555555",
"status": 1,
"last_name": "Belaid",
"first_name": "Arezqui",
"email": "areski@gmail.com",
"address": "Address",
"city": "Barcelona",
"state": "state",
"country": "ES",
"unit_number": "123",
"additional_vars": "{"facility":"hurron","debt":10,"address":"Sant Lluis street
"description": "test subscriber",
"created_date": "2013-06-27T19:48:45.118",
"updated_date": "2013-06-27T19:48:45.118"
},
]
}
Update:
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type: application/json" -X PATCH --dat
Response:
HTTP/1.0 202 NO CONTENT
Date: Fri, 23 Sep 2011 06:46:12 GMT
Server: WSGIServer/0.1 Python/2.7.1+
Vary: Accept-Language, Cookie
Content-Length: 0
Content-Type: text/html; charset=utf-8
Content-Language: en-us
get_fields(*args, **kwargs)
filter survey field
9.11 ContentTypeSerializer
class apirest.content_type_serializers.ContentTypeSerializer(instance=None,
data=None,
files=None,
context=None,
partial=False,
many=False, al-
low_add_remove=False,
**kwargs)
Read:
CURL Usage:
curl -u username:password -H 'Accept: application/json' http://localhost:8000/rest-api/conte
9.12 DNCSerializer
Response:
HTTP/1.0 201 CREATED
Date: Fri, 14 Jun 2013 09:52:27 GMT
Server: WSGIServer/0.1 Python/2.7.3
Vary: Accept, Accept-Language, Cookie
Content-Type: application/json; charset=utf-8
Content-Language: en-us
Location: http://localhost:8000/rest-api/dnc/1/
Allow: GET, POST, HEAD, OPTIONS
Read:
CURL Usage:
curl -u username:password -H 'Accept: application/json' http://localhost:8000/rest-api/dnc-l
Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"url": "http://127.0.0.1:8000/rest-api/dnc/1/",
"name": "sample dnc",
"user": "http://127.0.0.1:8000/rest-api/users/1/",
"created_date": "2013-03-15T18:28:30.208",
"updated_date": "2013-03-15T18:28:30.208"
}
]
}
Update:
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type: application/json" -X PATCH --dat
Response:
HTTP/1.0 202 NO CONTENT
Date: Fri, 23 Sep 2011 06:46:12 GMT
Server: WSGIServer/0.1 Python/2.7.1+
Vary: Accept-Language, Cookie
Content-Length: 0
Content-Type: text/html; charset=utf-8
Content-Language: en-us
9.13 DNCContactSerializer
class apirest.dnc_contact_serializers.DNCContactSerializer(instance=None,
data=None, files=None,
context=None,
partial=False,
many=False, al-
low_add_remove=False,
**kwargs)
Create:
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type:application/json" -X POST --data
Response:
HTTP/1.0 201 CREATED
Date: Fri, 14 Jun 2013 09:52:27 GMT
Server: WSGIServer/0.1 Python/2.7.3
Vary: Accept, Accept-Language, Cookie
Content-Type: application/json; charset=utf-8
Content-Language: en-us
Location: http://localhost:8000/rest-api/dnc_contact/1/
Allow: GET, POST, HEAD, OPTIONS
Read:
CURL Usage:
curl -u username:password -H 'Accept: application/json' http://localhost:8000/rest-api/dnc-c
Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"url": "http://127.0.0.1:8000/rest-api/dnc-contact/1/",
"dnc": "http://127.0.0.1:8000/rest-api/dnc-list/1/",
"phone_number": "12345"
}
]
}
Update:
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type: application/json" -X PUT --data
Response:
HTTP/1.0 202 NO CONTENT
Date: Fri, 23 Sep 2011 06:46:12 GMT
Server: WSGIServer/0.1 Python/2.7.1+
Vary: Accept-Language, Cookie
Content-Length: 0
Content-Type: text/html; charset=utf-8
Content-Language: en-us
get_fields(*args, **kwargs)
filter survey field
9.14 EventSerializer
9.15 GatewaySerializer
Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"url": "http://127.0.0.1:8000/rest-api/gateway/1/",
"name": "Default_Gateway",
"status": 1,
"description": "",
"addprefix": "",
"removeprefix": "",
"gateways": "user/,user",
"gateway_codecs": "PCMA,PCMU",
"gateway_timeouts": "10,10",
"gateway_retries": "2,1",
"originate_dial_string": "",
"secondused": null,
"created_date": "2011-06-15T00:28:52",
"updated_date": "2013-06-14T17:54:24.130",
"failover": null,
"addparameter": "",
"count_call": 1,
"count_in_use": null,
"maximum_call": null
}
]
}
9.16 MailTemplateSerializer
class apirest.mail_template_serializers.MailTemplateSerializer(instance=None,
data=None,
files=None,
context=None,
partial=False,
many=False, al-
low_add_remove=False,
**kwargs)
Read:
CURL Usage:
curl -u username:password -H 'Accept: application/json' http://localhost:8000/rest-api/mail-
Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"url": "http://127.0.0.1:8000/rest-api/mail-template/1/",
"label": "test_mail",
"template_key": "test_mail",
"from_email": "xyz@gmail.com",
"from_name": "xyz",
"subject": "hi",
"message_plaintext": "test message",
"message_html": "<h1>Hi</h1>",
"created_date": "2013-12-16T06:37:42.938Z"
}
]
}
9.17 PhonebookSerializer
Response:
HTTP/1.0 201 CREATED
Date: Fri, 14 Jun 2013 09:52:27 GMT
Server: WSGIServer/0.1 Python/2.7.3
Vary: Accept, Accept-Language, Cookie
Content-Type: application/json; charset=utf-8
Content-Language: en-us
Allow: GET, POST, HEAD, OPTIONS
Read:
CURL Usage:
curl -u username:password -H 'Accept: application/json' http://localhost:8000/rest-api/phone
Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"url": "http://127.0.0.1:8000/rest-api/phonebook/1/",
"name": "Default_Phonebook",
"description": "",
"user": "http://127.0.0.1:8000/rest-api/users/1/",
"created_date": "2011-04-08T07:55:05",
"updated_date": "2011-04-08T07:55:05"
}
]
}
Update:
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type: application/json" -X PATCH --dat
Response:
HTTP/1.0 200 NO CONTENT
Date: Fri, 23 Sep 2011 06:46:12 GMT
Server: WSGIServer/0.1 Python/2.7.1+
Delete:
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type: application/json" -X DELETE htt
9.18 RuleSerializer
9.19 SectionTemplateSerializer
class apirest.section_template_serializers.SectionTemplateSerializer(instance=None,
data=None,
files=None,
con-
text=None,
par-
tial=False,
many=False,
al-
low_add_remove=False,
**kwargs)
Create:
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type:application/json" -X POST --data
Response:
HTTP/1.0 201 CREATED
Date: Fri, 14 Jun 2013 09:52:27 GMT
Server: WSGIServer/0.1 Python/2.7.3
Vary: Accept, Accept-Language, Cookie
Content-Type: application/json; charset=utf-8
Content-Language: en-us
Location: http://localhost:8000/rest-api/section-template/1/
Allow: GET, POST, HEAD, OPTIONS
Read:
CURL Usage:
curl -u username:password -H 'Accept: application/json' http://localhost:8000/rest-api/secti
or
Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"url": "http://127.0.0.1:8000/rest-api/section-template/1/",
"order": 1,
"type": 1,
"question": "this is test question",
"script": "this is test question",
"audiofile": null,
"retries": null,
"timeout": 5,
"key_0": null,
"key_1": null,
"key_2": null,
"key_3": null,
"key_4": null,
"key_5": null,
"key_6": null,
"key_7": null,
"key_8": null,
"key_9": null,
"rating_laps": 9,
"validate_number": true,
"number_digits": 2,
"min_number": 0,
"max_number": 99,
"phonenumber": null,
"conference": null,
"completed": false,
"queue": null,
"created_date": "2013-06-13T12:42:28.457",
"updated_date": "2013-06-13T12:42:28.511",
"survey": "http://127.0.0.1:8000/rest-api/survey-template/1/",
"invalid_audiofile": null
}
]
}
Update:
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type: application/json" -X PATCH --dat
Response:
HTTP/1.0 202 NO CONTENT
Date: Fri, 23 Sep 2011 06:46:12 GMT
Server: WSGIServer/0.1 Python/2.7.1+
Vary: Accept-Language, Cookie
Content-Length: 0
Content-Type: text/html; charset=utf-8
Content-Language: en-us
9.20 SMSCampaignSerializer
class apirest.sms_campaign_serializers.SMSCampaignSerializer(instance=None,
data=None,
files=None,
context=None,
partial=False,
many=False, al-
low_add_remove=False,
**kwargs)
Create:
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type:application/json" -X POST --data
Response:
HTTP/1.0 201 CREATED
Date: Fri, 14 Jun 2013 09:52:27 GMT
Server: WSGIServer/0.1 Python/2.7.3
Vary: Accept, Accept-Language, Cookie
Content-Type: application/json; charset=utf-8
Content-Language: en-us
Allow: GET, POST, HEAD, OPTIONS
Read:
CURL Usage:
curl -u username:password -H 'Accept: application/json' http://localhost:8000/rest-api/sms-c
Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 2,
"sms_campaign_code": "BXTWX",
"name": "Sample SMS campaign",
"description": "",
"callerid": "",
"phonebook": [
"http://127.0.0.1:8000/rest-api/phonebook/1/"
],
"startingdate": "2011-12-27T14:35:46",
"expirationdate": "2011-12-28T14:35:46",
"sms_gateway": "http://127.0.0.1:8000/rest-api/sms-gateway/1/",
"user": "http://127.0.0.1:8000/rest-api/users/1/",
"status": 2,
"frequency": 10,
"callmaxduration": 1800,
"maxretry": 0,
"daily_start_time": "00:00:00",
"daily_stop_time": "23:59:59",
"monday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"saturday": true,
"sunday": true,
}
]
}
Update:
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type: application/json" -X PATCH --dat
Response:
HTTP/1.0 202 NO CONTENT
Date: Fri, 23 Sep 2011 06:46:12 GMT
Server: WSGIServer/0.1 Python/2.7.1+
Vary: Accept-Language, Cookie
Content-Length: 0
Content-Type: text/html; charset=utf-8
Content-Language: en-us
Delete:
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type: application/json" -X DELETE htt
Response:
{
"data": "sms campaign deleted"
}
get_fields(*args, **kwargs)
filter content_type field
validate(attrs)
Validate sms campaign form
9.21 SMSGatewaySerializer
class apirest.sms_gateway_serializers.SMSGatewaySerializer(instance=None,
data=None, files=None,
context=None,
partial=False,
many=False, al-
low_add_remove=False,
**kwargs)
Create:
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type:application/json" -X POST --data
Response:
HTTP/1.0 201 CREATED
Date: Fri, 14 Jun 2013 09:52:27 GMT
Server: WSGIServer/0.1 Python/2.7.3
Vary: Accept, Accept-Language, Cookie
Content-Type: application/json; charset=utf-8
Content-Language: en-us
Allow: GET, POST, HEAD, OPTIONS
Read:
CURL Usage:
curl -u username:password -H 'Accept: application/json' http://localhost:8000/rest-api/gatew
Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"url": "http://127.0.0.1:8000/rest-api/gateway/1/",
"name": "Default_Gateway",
"status": 1,
"description": "",
"addprefix": "",
"removeprefix": "",
"gateways": "user/,user",
"gateway_codecs": "PCMA,PCMU",
"gateway_timeouts": "10,10",
"gateway_retries": "2,1",
"originate_dial_string": "",
"secondused": null,
"created_date": "2011-06-15T00:28:52",
"updated_date": "2013-06-14T17:54:24.130",
"failover": null,
"addparameter": "",
"count_call": 1,
"count_in_use": null,
"maximum_call": null
}
]
}
9.22 SMSTemplateSerializer
class apirest.sms_template_serializers.SMSTemplateSerializer(instance=None,
data=None,
files=None,
context=None,
partial=False,
many=False, al-
low_add_remove=False,
**kwargs)
Read:
CURL Usage:
curl -u username:password -H 'Accept: application/json' http://localhost:8000/rest-api/sms-t
Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"url": "http://127.0.0.1:8000/rest-api/sms-template/1/",
"label": "sms_test",
"template_key": "sms_test",
"sender_phonenumber": "9427164510",
"sms_text": "hello test",
"created_date": "2013-12-16T06:43:29.475Z"
}
]
}
9.23 SubscriberListSerializer
class apirest.subscriber_list_serializers.SubscriberListSerializer(instance=None,
data=None,
files=None,
con-
text=None,
par-
tial=False,
many=False,
al-
low_add_remove=False,
**kwargs)
Read:
CURL Usage:
curl -u username:password -H 'Accept: application/json' http://localhost:8000/rest-api/subsc
Response:
[
{
"id": 1,
"contact": "/rest-api/contact/11/",
"campaign": "/rest-api/campaigns/3/",
"last_attempt": null,
"count_attempt": 0,
"completion_count_attempt": 0,
"duplicate_contact": "34235464",
"status": 1
},
{
"id": 2,
"contact": "/rest-api/contact/12/",
"campaign": "/rest-api/campaigns/3/",
"last_attempt": null,
"count_attempt": 0,
"completion_count_attempt": 0,
"duplicate_contact": "34235464",
"status": 1
}
]
9.24 SurveySerializer
or
Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"url": "http://127.0.0.1:8000/rest-api/sealed-survey/1/",
"name": "Sample survey campaign",
"tts_language": "en",
"description": "ok",
"created_date": "2013-06-13T12:42:18.148",
"updated_date": "2013-06-13T12:42:31.527",
"user": "http://127.0.0.1:8000/rest-api/users/1/"
}
]
}
9.25 SurveyTemplateSerializer
class apirest.survey_template_serializers.SurveyTemplateSerializer(instance=None,
data=None,
files=None,
con-
text=None,
par-
tial=False,
many=False,
al-
low_add_remove=False,
**kwargs)
Create:
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type:application/json" -X POST --data
Response:
HTTP/1.0 201 CREATED
Date: Fri, 14 Jun 2013 09:52:27 GMT
Server: WSGIServer/0.1 Python/2.7.3
Vary: Accept, Accept-Language, Cookie
Content-Type: application/json; charset=utf-8
Content-Language: en-us
Location: http://localhost:8000/rest-api/survey-template/1/
Allow: GET, POST, HEAD, OPTIONS
Read:
CURL Usage:
curl -u username:password -H 'Accept: application/json' http://localhost:8000/rest-api/surve
or
Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"url": "http://127.0.0.1:8000/rest-api/survey-template/1/",
"name": "Sample survey campaign",
"tts_language": "en",
"description": "ok",
"created_date": "2013-06-13T12:42:18.148",
"updated_date": "2013-06-13T12:42:31.527",
"user": "http://127.0.0.1:8000/rest-api/users/1/"
}
]
}
Update:
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type: application/json" -X PATCH --dat
Response:
HTTP/1.0 202 NO CONTENT
Date: Fri, 23 Sep 2011 06:46:12 GMT
Server: WSGIServer/0.1 Python/2.7.1+
Vary: Accept-Language, Cookie
Content-Length: 0
Content-Type: text/html; charset=utf-8
Content-Language: en-us
To test individual api, click on one api from above api list and you will get like following screen.
URL : http://127.0.0.1:8000/api-explorer/switch/
Troubleshooting
10.1.1 Documentation:
http://www.newfies-dialer.org/documentation/
10.1.3 Forum:
10.1.4 Support:
Star2Billing S.L. offers consultancy including installation, training and customisation. Please email us at newfies-
dialer@star2billing.com for more information.
153
Newfies-Dialer Documentation, Release 2.20.2
All the logs are centralized into one single directory /var/log/newfies/
newfies-django-db.log : This contains all the Database queries performed by the UI
newfies-django.log : All the logger events from Django
err-apache-newfies.log : Any apache errors pertaining to Newfies-Dialer
celery-newfies-node1.log : This contains celery activity
newfieslua_logs_%%.log.log : This contains the phone system logs
When you get a message “Server Error, You’ve encountered an error!”, you might want to enable the debugger to get
a full traceback of the error.
To enable the debugger, edit the file /usr/share/newfies-dialer/newfies_dialer/settings_local.py and set those settings as
follow:
DEBUG = True
TEMPLATE_DEBUG = DEBUG
Go on the admin panel and check if there is any call request that has been spooled.
• http://your-ip:8008/admin/dialer_cdr/callrequest/
If there are no calls queued, this means that the campaign is not properly configured.
You should:
1. Check if the campaign is started that the “Start time”, “Finish Time” and server time are correct.
2. Make sure that you configured a Dialer Setting for the user running the campaign, although there will be a
warning for this on the Customer UI : http://your-ip:8008/admin/dialer_settings/dialersetting/
If there is an existing Call Request, check the status, and check the Celery log stored in /var/log/newfies
Although installing and running Newfies-Dialer on EC2 should work flawlessly, you will need to update the settings
ALLOWED_HOSTS manually as the install script won’t be able to detect the public IP address of your EC2 Instance.
Edit /usr/share/newfies/settings_local.py and ensure that your public IP is set in ALLOWED_HOSTS, ie. AL-
LOWED_HOSTS = [’XXX.YYY.ZZZ’]
Further information about ALLOWED_HOSTS: https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
10.8 Celerymon
• https://github.com/ask/celerymon
Running the monitor :
Start celery with the –events option on, so celery sends events for celerymon to capture:: $ workon newfies-
dialer $ cd /usr/share/newfies/ $ python manage.py celeryd -E
Run the monitor server:
$ workon newfies-dialer
$ cd /usr/share/newfies/
$ python manage.py celerymon
However, in production you probably want to run the monitor in the background, as a daemon:
$ workon newfies-dialer
$ cd /usr/share/newfies/
$ python manage.py celerymon --detach
For a complete listing of the command line arguments available, with a short description, you can use the help com-
mand:
$ workon newfies-dialer
$ cd /usr/share/newfies/
$ python manage.py help celerymon
Now you can visit the webserver celerymon starts by going to: http://localhost:8989
You can use the celery purge command to purge all configured task queues.
http://docs.celeryproject.org/en/latest/faq.html?highlight=purge#how-do-i-purge-all-waiting-tasks
Entering the Freeswitch CLI shold indicate whether it is running by typing fs_cli at the console. Once logged in, you
can check the trunk registration by typing sofia status at the Freeswitch CLI. CTRL-D exits the Freeswitch CLI.
If the Freeswitch CLI cannot be launched, then the status of freeswitch can be checked with:
$ ps aux | grep freeswitch
or
$ /etc/init.d/freeswitch status
The step by step checklist below should be used to validate that all components of the platform are running.
User interface :
• 1. Dialer Gateway matching a configured trunk is set up in the UI
• 2. Dialer Settings configured and attached to the appropriate user
• 3. Phonebook Created with contacts attached to the phonebook
• 4. Configured voice application
• 5. Campaign created, and started, with a phone book attached, and the campaign schedule current
Backend :
• 1. Celery Monitor Running
• 2. Freeswitch running
If there are still problems, then raise a support question on the mailing-list http://groups.google.com/group/newfies-
dialer or our forum, http://forum.newfies-dialer.org/, alternatively, contact newfies-dialer@star2billing.com for com-
mercial support.
Contributing
157
Newfies-Dialer Documentation, Release 2.20.2
The goal is to maintain a diverse community that is pleasant for everyone. That is why we would greatly appreciate it
if everyone contributing to and interacting with the community also followed this Code of Conduct.
The Code of Conduct covers our behavior as members of the community, in any forum, mailing list, wiki, website,
Internet relay chat (IRC), public meeting or private correspondence.
The Code of Conduct is heavily based on the Ubuntu Code of Conduct, Celery Code of Conduct, and the Pylons Code
of Conduct.
11.1.1 Be considerate.
Your work will be used by other people, and you in turn will depend on the work of others. Any decision you take
will affect users and colleagues, and we expect you to take those consequences into account when making decisions.
Even if it’s not obvious at the time, our contributions to Newfies will impact the work of others. For example, changes
to code, infrastructure, policy, documentation and translations during a release may negatively impact others work.
11.1.2 Be respectful.
The Newfies community and its members treat one another with respect. Everyone can make a valuable contribution
to Newfies. We may not always agree, but disagreement is no excuse for poor behavior and poor manners. We might
all experience some frustration now and then, but we cannot allow that frustration to turn into a personal attack. It’s
important to remember that a community where people feel uncomfortable or threatened is not a productive one. We
expect members of the Newfies community to be respectful when dealing with other contributors as well as with
people outside the Newfies project and with users of Newfies.
11.1.3 Be collaborative.
Collaboration is central to Newfies and to the larger free software community. We should always be open to collab-
oration. Your work should be done transparently and patches from Newfies should be given back to the community
when they are made, not just when the distribution releases. If you wish to work on new code for existing upstream
projects, at least keep those projects informed of your ideas and progress. It many not be possible to get consensus
from upstream, or even from your colleagues about the correct implementation for an idea, so don’t feel obliged to
have that agreement before you begin, but at least keep the outside world informed of your work, and publish your
work in a way that allows outsiders to test, discuss and contribute to your efforts.
Disagreements, both political and technical, happen all the time and the Newfies community is no exception. It is
important that we resolve disagreements and differing views constructively and with the help of the community and
community process. If you really want to go a different way, then we encourage you to make a derivative distribution
or alternate set of packages that still build on the work we’ve done to utilize as common of a core as possible.
Nobody knows everything, and nobody is expected to be perfect. Asking questions avoids many problems down the
road, and so questions are encouraged. Those who are asked questions should be responsive and helpful. However,
when asking a question, care must be taken to do so in an appropriate forum.
Developers on every project come and go and Newfies is no different. When you leave or disengage from the project,
in whole or in part, we ask that you do so in a way that minimizes disruption to the project. This means you should
tell people you are leaving and take the proper steps to ensure that others can pick up where you leave off.
11.2.1 Bugs
Bugs can always be described to the Mailing list, but the best way to report an issue and to ensure a timely response is
to use the issue tracker.
1. Create a GitHub account.
You need to create a GitHub account to be able to create new issues and participate in the discussion.
2. Determine if your bug is really a bug.
You should not file a bug if you are requesting support. For that you can use the Mailing list, or IRC.
3. Make sure your bug hasn’t already been reported.
Search through the appropriate Issue tracker. If a bug like yours was found, check if you have new information that
could be reported to help the developers fix the bug.
4. Check if you’re using the latest version.
A bug could be fixed by some other improvements and fixes - it might not have an existing report in the bug tracker.
Make sure you’re using the latest version.
5. Collect information about the bug.
To have the best chance of having a bug fixed, we need to be able to easily reproduce the conditions that caused it.
Most of the time this information will be from a Python traceback message, though some bugs might be in design,
spelling or other errors on the website/docs/code.
1. If the error is from a Python traceback, include it in the bug report.
2. We also need to know what platform you’re running (Windows, OS X, Linux, etc.), the version of your Python
interpreter, and the version of related packages that you were running when the bug occurred.
6. Submit the bug.
By default GitHub will email you to let you know when new comments have been made on your bug. In the event
you’ve turned this feature off, you should check back on occasion to ensure you don’t miss any questions a developer
trying to fix the bug might ask.
Bugs for a package in the Newfies-Dialer ecosystem should be reported to the relevant issue tracker.
• Newfies-Dialer Core: https://github.com/newfies-dialer/newfies-dialer/issues/
• Python-Acapela: https://github.com/newfies-dialer/python-acapela/issues
• Lua-Acapela: https://github.com/newfies-dialer/lua-acapela/issues
• Python-NVD3: https://github.com/areski/python-nvd3/issues
If you are unsure of the origin of the bug you can ask the Mailing list, or just use the Newfies-Dialer issue tracker.
11.3 Versions
Version numbers consists of a major version, minor version and a release number. We use the versioning semantics
described by semver: http://semver.org.
Stable releases are published at PyPI while development releases are only available in the GitHub git repository as
tags. All version tags starts with “v”, so version 0.8.0 is the tag v0.8.0.
11.4 Branches
You can see the state of any branch by looking at the Changelog:
https://github.com/newfies-dialer/newfies-dialer/blob/master/Changelog
Major new features are worked on in dedicated branches. There is no strict naming requirement for these branches.
Feature branches are removed once they have been merged into a release branch.
11.5 Tags
Tags are used exclusively for tagging releases. A release tag is named with the format vX.Y.Z, e.g. v2.3.1.
Experimental releases contain an additional identifier vX.Y.Z-id, e.g. v3.0.0-rc1. Experimental tags may be
removed after the official release.
Note: Contributing to Newfies-Dialer should be as simple as possible, so none of these steps should be considered
mandatory.
You can even send in patches by email if that is your preferred work method. We won’t like you any less, any
contribution you make is always appreciated!
However following these steps may make maintainers life easier, and may mean that your changes will be accepted
sooner.
First you need to fork the repository, a good introduction to this is in the Github Guide: Fork a Repo.
After you have cloned the repository you should checkout your copy to a directory on your machine:
$ git clone git@github.com:username/newfies-dialer.git
When the repository is cloned enter the directory to set up easy access to upstream changes:
$ cd newfies-dialer
$ git remote add upstream git://github.com/newfies-dialer/newfies-dialer.git
$ git fetch upstream
If you need to pull in new changes from upstream you should always use the --rebase option to git pull:
$ git pull --rebase upstream master
With this option you don’t clutter the history with merging commit notes. See Rebasing merge commits in git. If you
want to learn more about rebasing see the Rebase section in the Github guides.
If you need to work on a different branch than master you can fetch and checkout a remote branch like this:
$ git checkout --track -b 3.0-devel origin/3.0-devel
To run the Newfies-Dialer test suite you need to install a few dependencies. A complete list of the dependencies
needed are located in requirements/test.txt.
Installing the test requirements:
$ pip install -U -r requirements/test.txt
When installation of dependencies is complete you can execute the test suite by calling py.test:
$ py.test
When your feature/bugfix is complete you may want to submit a pull requests so that it can be reviewed by the
maintainers.
Creating pull requests is easy, and also let you track the progress of your contribution. Read the Pull Requests section
in the Github Guide to learn how this is done.
You can also attach pull requests to existing issues by following the steps outlined here: http://bit.ly/koJoso
To calculate test coverage you must first install the coverage module.
Installing the coverage module:
$ pip install -U coverage
If you only want to test specific Python versions use the -e option:
$ tox -e py27
To build the documentation you need to install the dependencies listed in requirements/docs.txt:
$ pip install -U -r requirements/docs.txt
After these dependencies are installed you should be able to build the docs by running:
$ cd docs
$ rm -rf .build
$ make html
Make sure there are no errors or warnings in the build output. After building succeeds the documentation is available
at .build/html.
To use these tools you need to install a few dependencies. These dependencies can be found in
requirements/pkgutils.txt.
Installing the dependencies:
$ pip install -U -r requirements/pkgutils.txt
To ensure that your changes conform to PEP8 and to run pyflakes execute:
$ flake8 newfies
You should probably be able to pick up the coding style from surrounding code, but it is a good idea to be aware of the
following conventions.
• All Python code must follow the PEP-8 guidelines.
pep8.py is an utility you can use to verify that your code is following the conventions.
• Docstrings must follow the PEP-257 conventions, and use the following style.
Do this:
def method(self, arg):
"""Short description.
More details.
"""
or:
def method(self, arg):
"""Short description."""
If adhering to this limit makes the code less readable, you have one more character to go on, which means 78 is
a soft limit, and 79 is the hard limit :)
• Import order
– Python standard library (import xxx)
– Python standard library (‘from xxx import‘)
– Third party packages.
– Other modules from the current package.
or in case of code using Django:
– Python standard library (import xxx)
– Python standard library (‘from xxx import‘)
– Third party packages.
– Django packages.
– Other modules from the current package.
Within these sections the imports should be sorted by module name.
Example:
import threading
import time
– If the module uses the with statement and must be compatible with Python 2.5 then it must also
enable that:
– Every future import must be on its own line, as older Python 2.5 releases did not support import-
ing multiple features on the same future import line:
# Good
from __future__ import absolute_import
from __future__ import with_statement
# Bad
from __future__ import absolute_import, with_statement
(Note that this rule does not apply if the package does not include support for Python 2.5)
• Note that we use “new-style‘ relative imports when the distribution does not support Python versions below 2.5
This requires Python 2.5 or later:
from . import submodule
11.8 Contacts
This is a list of people that can be contacted for questions regarding the official git repositories, PyPI packages Read
the Docs pages.
If the issue is not an emergency then it is better to report an issue.
11.8.1 Committers
Areski Belaid
github https://github.com/areski
twitter http://twitter.com/#!/areskib
11.8.2 Website
Star2Billing
website http://star2billing.com/
twitter https://twitter.com/#!/star2billing
11.9.2 Releasing
If this is a new release series then you also need to do the following:
• Go to the Read The Docs management interface at: http://readthedocs.org/projects/newfies-
dialer/?fromdocs=newfies-dialer
• Enter “Edit project”
Change default branch to the branch of this series, e.g. 2.4 for series 2.4.
• Also add the previous version under the “versions” tab.
Resources
• Getting Help
– Mailing list
– IRC
• Bug tracker
• Wiki
• Contributing
• License
For discussions about the usage, development, and future of Newfies-Dialer, please join the Newfies-Dialer mailing
list.
12.1.2 IRC
Come chat with us on IRC. The #newfies-dialer channel is located at the Freenode network.
If you have any suggestions, bug reports or annoyances please report them to our issue tracker at
https://github.com/newfies-dialer/newfies-dialer/issues/
12.3 Wiki
https://github.com/newfies-dialer/newfies-dialer/wiki/
167
Newfies-Dialer Documentation, Release 2.20.2
12.4 Contributing
12.5 License
This software is licensed under the MPL 2.0 License. See the LICENSE file in the top distribution directory for the
full license text.
• General
– What is Newfies-Dialer
– Why should I use Newfies-Dialer
– What’s the history behind Newfies-Dialer
– How to change your IP address
– How to translate the frontend application
– How often do I need to upgrade / How do I upgrade?
• Text2Speech
– How does the tag substitution work with the TTS engine
– How does Newfies-Dialer provide TTS in multiple languages
– How to enable Acapela on Newfies-Dialer
• Dialer Logic
– How does the dial retry logic works
13.1 General
Answer:
Newfies-Dialer is a voice broadcast application designed and built to automate the delivery of interactive phone calls
to contacts, clients and the general public.
Answer:
Below are some examples of some of the uses that Newfies-Dialer can be put to. There are more details and examples
at http://www.newfies-dialer.org/solutions/
• Telecasting:
Broadcast marketing or informational messages to customers and clients.
• Phone Polling, Surveys and Voting:
169
Newfies-Dialer Documentation, Release 2.20.2
Ring large numbers of people and present IVR options for either polling their opinions, interactive
surveys, or taking their vote and record the results.
• Debt Control:
Customers can be automatically reminded at intervals that they owe money, and an IVR menu pre-
sented to talk to the finance department or passed to a credit card capture IVR to pay over the phone.
• Appointment reminders:
Doctors, Dentists, and other organisations that make appointments for their clients can integrate
Newfies-Dialer into their appointment systems to pass a message reminding them of an upcoming
appointment.
• Dissemination of Information by Phone:
Newfies-Dialer was originally designed to call large numbers of people and disseminate medical and
health advice via the ubiquitous cellphone in 3rd world countries where often, literacy levels are low.
• Mass Emergency Broadcasting:
Where there is a necessity to warn large numbers of people in a short space of time, such as weather
warnings.
• Subscription Reminders and Renewals:
Where a company sells an annual subscription for a product or service, Newfies-Dialer can be con-
figured to dial the customer, remind them that the subscription is due, and optionally pass the call
into a call centre or into a credit card payment IVR.
Answer:
Newfies-Dialer is a bulk dialer application which was commissioned by a charity named Ku-
batana (http://www.kubatana.net) based in Zimbabwe, which sponsors the Freedomfone project
(http://www.freedomfone.org/) dedicated to providing information via phone technology.
In less economically developed countries, Internet is often limited, but there is usually comprehensive mobile phone
coverage. Freedomfone uses Newfies-Dialer to dial up people’s phones and offer health information on Cholera,
Malaria and so many other avoidable health issues in the third world, which may be alleviated by education. Newfies-
Dialer was so named after the Newfoundland Dog nicknamed Newfies and used by sea rescue services around the
world.
During the installation Newfies-Dialer Web interface are bind to the detected IP, if you change the IP or want to change
the interface to which is bind you then need change the settings ALLOWED_HOSTS. Please find some documentation
about this settings at https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
The configuration file on your server is located at /usr/share/newfies-dialer/newfies_dialer/settings_local.py
After changes in settings_local.py you will need to restart supervisord:
/etc/init.d/supervisor stop
Then to start it back:
/etc/init.d/supervisor start
It is not necessary to upgrade to each and every release, and generally we would advise against it, unless we issue an
advisory via mailing list to the contrary, e.g. major bug or security issue. Generally one can stay with a single version
for a long time and decide to upgrade when there are new features or bug fixes that affect you.
The database has to be migrated with Django migration which is very well documented here:
https://docs.djangoproject.
Newfies-Dialer has several components that will need to be reinstalled / upgraded: the code of the Django project, the
dependencies in virtualenv, the lua code base for the IVR and the dependencies for Lua.
In some versions, OS packages need to be upgraded too, so it might be wise to keep an eye on what is needed.
The Newfies-Dialer team provide an upgrade service as described at http://www.newfies-dialer.org/ where we try to
limit your downtime. Do note that it may not be possible to upgrade from very old instances of Newfies-Dialer due to
major architecture changes.
13.2 Text2Speech
13.2.1 How does the tag substitution work with the TTS engine
Answer:
This is the list of standard tags that will be automatically replaced: {last_name} {first_name} {email} {country}
{city} {contact} // This is the phone number
If you need more flexibility, you can use the “Additional Parameters (JSON)” field which allow you to add custom
key-values that will be replaced.
For example, let’s add this in “Additional Parameters (JSON)”: {“company_name”: “Canonical”, “bonus” :
“200”, “currency” : “euro”}
When you create a survey with a node that plays TTS, you can easily replace the key-values in the text. Text example:
“We are calling you on behalf of {company_name}, you receive a bonus of {bonus} {currency}”
Answer:
By default the TTS engine used by newfies-Dialer is Flite (http://www.speech.cs.cmu.edu/flite/) which only supports
English. If you want to use another language you will need another TTS engine.
We have integrated Acapela: http://acapela-vaas.com/ and in order to use Acapela, the only thing you have to do is to
sign in and enable Acapela on Newfies-dialer.
Answer:
First you will have to sign-up and register an account with Acapela : http://acapela-vaas.com/ Once you signed up you
will receive a login, an application login and an application password, you will need those to configure Acapela on
Newfies-Dialer.
Acapela needs to be configured in 2 places:
1. On the Web interface
Edit the file /usr/share/newfies-dialer/newfies_dialer/settings_local.py and find:
#TEXT-TO-SPEECH
#==============
TTS_ENGINE = 'FLITE' # FLITE, CEPSTRAL, ACAPELA
ACCOUNT_LOGIN = 'EVAL_XXXX'
APPLICATION_LOGIN = 'EVAL_XXXXXXX'
APPLICATION_PASSWORD = 'XXXXXXXX'
SERVICE_URL = 'http://vaas.acapela-group.com/Services/Synthesizer'
QUALITY = '22k' # 22k, 8k, 8ka, 8kmu
ACAPELA_GENDER = 'W'
ACAPELA_INTONATION = 'NORMAL'
You will have to change the value of the settings : TTS_ENGINE, ACCOUNT_LOGIN, APPLICATION_LOGIN and
ACCOUNT_LOGIN = 'EVAL_VAAS'
APPLICATION_LOGIN = 'EVAL_XXXXXX'
APPLICATION_PASSWORD = 'XXXXXX'
SERVICE_URL = 'http://vaas.acapela-group.com/Services/Synthesizer'
QUALITY = '22k' -- 22k, 8k, 8ka, 8kmu
ACAPELA_GENDER = 'M'
ACAPELA_INTONATION = 'NORMAL'
ACAPELA_LANG = 'EN'
Change the value of the settings : ACCOUNT_LOGIN, APPLICATION_LOGIN, APPLICATION_PASSWORD and optiona
Answer:
There are 2 systems available to retry calls:
Basic Retry:
Basic retry checks to see if the call has been answered, even for a very short duration, this is regarded as a
successful call. However if the call is not answered, busy or unreachable, it will be considered as a failed
call, and will be retried as defined in the “Dialer Settings” section in the campaign.
Completion Retry:
This feature works with the survey editor. When a survey node is created, the “Survey Complete” check-
box can be ticked so that it is clear that the contact reached a certain point in the survey and did not
abandon the call early. Usually, one of the last nodes in the survey is ticked as “Survey Complete”.
The Completion Retry interval and number of times to retry is set in the campaign under the “Dialer
Completion Settings” section.
• genindex
• modindex
• search
175
Newfies-Dialer Documentation, Release 2.20.2
a dialer_contact.models, 98
apirest.audiofile_serializers, 131 dialer_contact.tests, 130
apirest.branching_template_serializers, dialer_contact.views, 113
131 dialer_gateway.admin, 127
apirest.campaign_serializers, 133 dialer_gateway.models, 103
apirest.contact_serializers, 135 dialer_gateway.tests, 130
apirest.content_type_serializers, 136 dialer_settings.admin, 127
apirest.dnc_contact_serializers, 138 dialer_settings.models, 104
apirest.dnc_serializers, 137 dialer_settings.tests, 130
apirest.gateway_serializers, 139
apirest.mail_template_serializers, 140 f
apirest.phonebook_serializers, 140 frontend.views, 112
apirest.section_template_serializers,
142 m
apirest.sms_campaign_serializers, 143 mod_sms.models, 110
apirest.sms_gateway_serializers, 145 mod_sms.views, 123
apirest.sms_template_serializers, 146
apirest.subscriber_list_serializers, 147 s
apirest.survey_serializers, 148 survey.admin, 127
apirest.survey_template_serializers, 149 survey.models, 104
appointment.admin, 128 survey.tests, 130
appointment.models.alarms, 110 survey.views, 116
appointment.models.calendars, 108
appointment.models.events, 109 u
appointment.views, 118 user_profile.models, 107
c
calendar_settings.admin, 128
d
dialer_audio.views, 117
dialer_campaign.admin, 125
dialer_campaign.models, 129
dialer_campaign.tasks, 129
dialer_campaign.tests, 130
dialer_campaign.views, 115
dialer_cdr.admin, 126
dialer_cdr.models, 101
dialer_cdr.tests, 130
dialer_contact.admin, 126
177
Newfies-Dialer Documentation, Release 2.20.2
A B
add_view() (dialer_campaign.admin.CampaignAdmin Branching (class in survey.models), 107
method), 125 Branching_abstract (class in survey.models), 106
add_view() (dialer_contact.admin.ContactAdmin Branching_template (class in survey.models), 107
method), 126 BranchingAdmin (class in survey.admin), 128
Alarm (class in appointment.models.alarms), 110 BranchingTemplateSerializer (class in
alarm_add() (in module appointment.views), 122 apirest.branching_template_serializers), 132
alarm_change() (in module appointment.views), 123 build_dtmf_filter() (survey.models.Section_abstract
alarm_del() (in module appointment.views), 122 method), 106
alarm_list() (in module appointment.views), 122
AlarmAdmin (class in appointment.admin), 129 C
apirest.audiofile_serializers (module), 131 Calendar (class in appointment.models.calendars), 108
apirest.branching_template_serializers (module), 131 calendar_add() (in module appointment.views), 120
apirest.campaign_serializers (module), 133 calendar_change() (in module appointment.views), 121
apirest.contact_serializers (module), 135 calendar_del() (in module appointment.views), 120
apirest.content_type_serializers (module), 136 calendar_list() (in module appointment.views), 120
apirest.dnc_contact_serializers (module), 138 calendar_setting_add() (in module appointment.views),
apirest.dnc_serializers (module), 137 118
apirest.gateway_serializers (module), 139 calendar_setting_change() (in module appoint-
apirest.mail_template_serializers (module), 140 ment.views), 118
apirest.phonebook_serializers (module), 140 calendar_setting_del() (in module appointment.views),
apirest.section_template_serializers (module), 142 118
apirest.sms_campaign_serializers (module), 143 calendar_setting_list() (in module appointment.views),
apirest.sms_gateway_serializers (module), 145 118
apirest.sms_template_serializers (module), 146 calendar_settings.admin (module), 128
apirest.subscriber_list_serializers (module), 147 calendar_user_add() (in module appointment.views), 119
apirest.survey_serializers (module), 148 calendar_user_change() (in module appointment.views),
apirest.survey_template_serializers (module), 149 119
appointment.admin (module), 128 calendar_user_change_pw() (in module appoint-
appointment.models.alarms (module), 110 ment.views), 120
appointment.models.calendars (module), 108 calendar_user_del() (in module appointment.views), 119
appointment.models.events (module), 109 CalendarAdmin (class in appointment.admin), 128
appointment.views (module), 118 CalendarSetting (class in user_profile.models), 108
audio_add() (in module dialer_audio.views), 117 CalendarSettingAdmin (class in calen-
audio_change() (in module dialer_audio.views), 117 dar_settings.admin), 128
audio_list() (in module dialer_audio.views), 117 CalendarUser (class in user_profile.models), 108
AudioFileSerializer (class in CalendarUserAdmin (class in appointment.admin), 128
apirest.audiofile_serializers), 131 CalendarUserProfile (class in user_profile.models), 108
Callrequest (class in dialer_cdr.models), 102
CallrequestAdmin (class in dialer_cdr.admin), 127
179
Newfies-Dialer Documentation, Release 2.20.2
180 Index
Newfies-Dialer Documentation, Release 2.20.2
get_active_contact() (mod_sms.models.SMSCampaign I
method), 111 import_contact() (dialer_contact.admin.ContactAdmin
get_active_contact_no_subscriber() method), 126
(mod_sms.models.SMSCampaign method), index() (in module frontend.views), 112
111 is_authorized_contact() (di-
get_active_max_frequency() (di- aler_campaign.models.Campaign method),
aler_campaign.models.Campaign method), 101
101 is_authorized_contact() (mod_sms.models.SMSCampaign
get_active_max_frequency() method), 111
(mod_sms.models.SMSCampaign method),
111 L
get_branching_count_per_section() (sur- login_view() (in module frontend.views), 113
vey.models.Section_abstract method), 106
get_campaign_type() (di- M
aler_campaign.models.Campaign method), MailTemplateSerializer (class in
101 apirest.mail_template_serializers), 140
get_expired_campaign() (di- min_duration() (dialer_cdr.models.VoIPCall method),
aler_campaign.models.CampaignManager 103
method), 99 mod_sms.models (module), 110
get_fields() (apirest.campaign_serializers.CampaignSerializer
mod_sms.views (module), 123
method), 135
get_fields() (apirest.contact_serializers.ContactSerializer O
method), 136 occurrences_after() (appointment.models.events.Event
get_fields() (apirest.dnc_contact_serializers.DNCContactSerializer method), 109
method), 139
P
get_fields() (apirest.sms_campaign_serializers.SMSCampaignSerializer
method), 145 Phonebook (class in dialer_contact.models), 98
get_list_alarm() (appointment.models.events.Event phonebook_add() (in module dialer_contact.views), 113
method), 109 phonebook_change() (in module dialer_contact.views),
get_list_child() (appointment.models.events.Event 114
method), 109 phonebook_contacts() (dialer_contact.models.Phonebook
get_next_occurrence() (appointment.models.events.Event method), 99
method), 109 phonebook_list() (in module dialer_contact.views), 113
get_occurrences() (appointment.models.events.Event PhonebookAdmin (class in dialer_contact.admin), 126
method), 109 PhonebookSerializer (class in
get_pending_subscriber() apirest.phonebook_serializers), 141
(mod_sms.models.SMSCampaign method), post_save_add_contact() (in module di-
111 aler_campaign.models), 129
get_pending_subscriber_update() (di- progress_bar() (dialer_campaign.models.Campaign
aler_campaign.models.Campaign method), method), 101
101 progress_bar() (mod_sms.models.SMSCampaign
get_pending_subscriber_update() method), 111
(mod_sms.models.SMSCampaign method),
111 R
get_recent() (appointment.models.calendars.Calendar replace_tag() (dialer_contact.models.Contact method), 99
method), 109 Result (class in survey.models), 107
get_running_campaign() (di- ResultAdmin (class in survey.admin), 128
aler_campaign.models.CampaignManager ResultAggregate (class in survey.admin), 128
method), 99 ResultAggregate (class in survey.models), 107
retry_alarm() (appointment.models.alarms.Alarm
H method), 110
has_add_permission() (dialer_cdr.admin.VoIPCallAdmin
method), 127 S
Section (class in survey.models), 106
Index 181
Newfies-Dialer Documentation, Release 2.20.2
182 Index