Abdullah Mohammad Ansari, Md. Faisal Nehal, Mohammed Abdul Qadeer. Department of Computer Engineering. ZakirHussain College of Engineering & ...
SIP-based Interactive Voice Response System using FreeSwitch EPBX Abdullah Mohammad Ansari, Md. Faisal Nehal, Mohammed Abdul Qadeer Department of Computer Engineering ZakirHussain College of Engineering & Technology Aligarh Muslim University, Aligarh Uttar Pradesh, India-202002 {abd.svc, syed.faisal.nehal, maqadeer}@gmail.com Abstract—Accessing information during a call without having to open up a web browser in a phone is not only easier but also efficient in time-constraint situations. To achieve this, we have implemented an Interactive Voice Response System (IVRS) for SIP-based phones. Telecommunication services plays a vital role in exchange of information. Although this system is limited to SIP-based phones, we propose a general IVRS that can be implemented for a regular network operator. Keywords—Session Initiation Protocol (SIP), Interactive Voice Response System (IVRS), FreeSwitch, PBX.
I.
INTRODUCTION
Mobile Phones play a major role in exchange of information and communication. India has the world's secondlargest mobile phone user base with over 929.37 million users as of May 2012 [1]. Out of these, 14.7% of the users access internet either for communication services or for retrieving information [2]. If a person moves to a new city, he may use the internet to get information regarding various hospitals, restaurants and other health services. However, not all restaurants or health services information is available over the internet. He may use his mobile phone to call on a certain number to get relevant information from a universal Interactive Voice Response System. This would enable a user to achieve his desired information without having to go through the tremendous effort of searching over the internet which may be time consuming and eventually costly. It is also argued that IVR is easier to use when compared to the internet, as internet use requires certain skills and training. However, the downside to this solution is that IVR systems can be quite frustrating to use if the menus are long. Voice quality and information content are the primary issues. Keeping this in mind we plan to implement a system which can be used by the common people to access information regarding any facilities and make use of this technology to the most. The information content is made short and concise, which also helps in optimizing the time duration for each call. There are many IVR systems commercially available and setting them up can result in unnecessary expenditure for any organization. We propose a cost-effective solution for this problem. These systems can help the needs of the people by delivering relevant required information in due time.
978-1-4673-5999-3/13/$31.00 ©2013 IEEE
Fig. 1. Flow of information of health services
In this paper, we propose multiple scenarios in which our IVR system can be implemented. The first one corresponds to health services, the second to general services and the last, on which we actually performed our tests is educational services. The backbone of our application is an open-source scalable softswitch called FreeSwitch [3]. We use FreeSwitch as a PBX (Private Branch Exchange) server. It performs all the functionalities of a traditional PBX. It follows a client-server architecture. We can either use a SIP compliant hardphone, i.e. a physical phone or a software-based phone, also known as softphone to connect to FreeSwitch. These act as SIP clients to the FreeSwitch server. These SIP clients register on the PBX server. This server contains all registered clients and information of other connected FreeSwitch servers. In our considered scenario, not only can each SIP client access the IVRS but also communicate with other SIP clients registered on the server. This provides an added functionality to our SIPbased approach. This communication was studied by M.A.
Qadeer, K. Shah and U. Goel [4] using an Asterisk server. M.A. Qadeer and A. Imran [10][11][13] implemented a voice exchange between SIP clients on an Asterisk server [5]. Moreover, in the later sections, we'll discuss how to connect a typical network operated mobile phone to a FreeSwitch server. II.
APPLICATION ARCHITECTURE
Figure 1 illustrates the flow of information in a healthcare IVR system corresponding to a DTMF (Dual-tone Multifrequency) input. The maximum number of sublevels is five and the sentences have been restricted to a maximum of five words per option. Figure 2 describes the flow of information for general services. Lastly, figure 3 refers to our implemented architecture. All the three architectures follow the same model. Figure 4 illustrates the underlying architecture when the caller tries to access IVRS. In case of SIP-based phone, the caller needs to register with the FreeSwitch server and on being registered, the call can be placed to the corresponding IVRS number. The entire IVRS application is written using a scripting language called Lua and is present on the machine running the FreeSwitch server. This PBX server has inbuilt dependencies for handling SQLite [6] databases and the Lua script exploits these dependencies to fetch the required information from the database.
Fig. 4. Basic Architecture for a call accessing IVR application
The various modules used within the server are discussed in the following subsections. However, in case of a typical network operated mobile phone, a simple GSM modem, preferably Huawei [7], is connected to the FreeSwitch server. A module called mod_gsmopen is used to bridge the call between the incoming GSM call to the IVRS number. However, this enables us to serve only one call at a time. The information fetching mechanism is the same as discussed in the former case. A. mod_flite mod_flite is a small embeddable text-to-speech engine. It supports four 16 kHz voices. B. mod_lua Although FreeSwitch supports various scripting languages like JavaScript and Perl, we chose Lua as our scripting language for writing the IVRS application as it is small, fast, portable and a powerful language. mod_lua enables us to use the vast functionality of Lua scripts.
Fig. 2. Flow of information of general services
C. mod_gsmopen mod_gsmopen serves as an endpoint that allows incoming as well as outgoing voice calls (that can be answered, originated or bridged to other endpoints). It supports a limited number of GSM modems and is still in beta stage. D. mod_sofia Sofia-SIP is an open-source project sponsored by Nokia, which is determined to make a programming interface to the Session Initiation Protocol or SIP. We use this library in FreeSwitch in a module called mod_sofia. This module registers to all the hooks in FreeSwitch necessary to make an Endpoint module, and translates the native FreeSwitch constructs into SIP constructs and back again. This allows FreeSwitch to accept registration from SIP phones and devices and register to other SIP Endpoints.
Fig. 3. Flow of information of educational services
E. Endpoint Endpoint modules are critically important and add some of the key features which make FreeSwitch the powerful platform it is today. The primary role of these modules is to
take certain common communication technologies and normalize them into a common abstract entity which we refer to as a session. A session represents a connection between FreeSwitch and a particular protocol. There are several Endpoint modules that come with FreeSwitch, which implement several protocols such as SIP, H.323, Jingle, and many others. F. Dialplan The default and most widely used Dialplan module is the XML Dialplan module. This module is designed to look up a list of instructions from the central XML registry within the FreeSwitch server. III.
DESIGN AND IMPLEMENTATION ISSUES
We set up the FreeSwitch [3] server on a normal PC running Ubuntu 12.04 LTS. For SIP clients, we used X-lite 5.0 [9], a softphone that permits both voice as well as video calls and Android based phones supporting SIP accounts. These phones were tested while the server was connected to wireless LAN and when the server was running over internet. A. Various packages used libcurl4-openssl-dev, libexpat1-dev, libssl-dev, libtiff4-dev, libx11-dev, unixodbc-dev, python2.6-dev, zlib1g-dev, libzrtpcpp-dev, libasound2-dev, libogg-dev, libvorbis-dev, libperl-dev, libgdbm-dev, libdb-dev, python-dev, uuid-dev, bison, autoconf, g++, libncurses-dev. B. Registering users (SIP clients) Each SIP client needs to be added to FreeSwitch directory before it can register. We can set up the extension for each client as configuration files in xml format. These need to be added to /usr/local/freeswitch/conf/directory/.
In case the FreeSwitch server is running over the internet or connected to a wireless LAN, we need to make sure that the server recognizes the corresponding IP address. It was observed, that in some cases, the server failed to recognize the current IP address and took into account the address of the localhost. This resulted in failure of connection between the clients and server. This problem can easily be sought by setting the relevant IP address in the internal.xml configuration file present in /usr/local/freeswitch/conf/sip_profiles/. However, this problem seldom occurs when the server is running over internet and if it does, the corresponding IP address can be set in the external.xml file located in the same location. Furthermore, the range of extensions can be set in the default xml dialplan. This dialplan is located in /usr/local/freeswitch/conf/dialplan/. We can add a separate xml file containing the range of all the extensions in the default directory or we can simply append the default.xml file. However, the former approach tends to be unappealing and time consuming if any modification is needed as the default.xml configuration tends to be large. Hence, we follow the latter approach. C. Accessing the IVRS After registering, the SIP client can easily call the IVRS application. The delay or latency produced is proportional to the traffic on the internet if the server is running over internet. If it is connected to wireless LAN, the delay between the dialed number and the call being answered by the server is minimal. The information is presented to the user either by playing sound files residing on the server or by using the text-to-speech module supported within the server. Other dynamic information can be retrieved from the databases using the builtin SQLite engine. Figure 5 represents the custom XML configuration added to the default configuration. Multiple instances of various applications are possible due to the modular nature of the FreeSwitch server. These extensions can easily be appended to the default configuration.
Fig. 6. The FreeSwitch console window displaying a call incoming scenario by a client connected by a softphone.
Fig. 5. Code for setting an extension for our IVRS application.
Fig. 7. The FreeSwitch client window showing operations performed during an IVRS session.
If a typical mobile phone requires access to this IVRS application, it needs to call on a GSM operated number. Figure 9 illustrates the flow of information between the caller and the server. The call is first interpreted by a GSM modem, which bridges the call to the internal SIP extension of our application and rest follows accordingly. IV.
Fig. 8. Scenario depicting access to IVRS over Wi-Fi/LAN.
RESULTS AND DISSCUSSION
A. Experimental Setup We set up the FreeSwitch server on a Linux based system. We experimented with various Android based phones supporting SIP clients as well as softphones, such as X-lite, to retrieve information from the IVRS application. We observed that there was a certain delay while accessing information through the text-to-speech module which might put-off some callers. We intend to write a caching mechanism to rectify this issue. We enabled the SIP clients to communicate through our FreeSwitch server using voice as well as video calls. This serves as a cheaper alternative to actual calls using mobile operator. However, this communication highly entails the drawbacks of high traffic density during peak hours. B. Call Scenarios We tested our application on various scenarios such as those comprising of FreeSwitch running on wireless LAN and internet. In the first scenario, as shown in figure 8, we communicated with our IVRS application through various endsystems. These endsystems were connected to the FreeSwitch server either by LAN or wireless LAN. Figure 9 shows a typical network operated mobile phone accessing the application running on the server over 3G. A simple GSM modem is connected to the system running the FreeSwitch server which answers the call from the incoming external mobile network. This call is then bridged to the internal SIP extension pertaining to our IVRS application by a module known as mod_gsmopen.
Fig. 9. Scenario depicting access to IVRS over 3G.
Fig. 10. Communication between connected FreeSwitch servers.
We even managed to access our application running on a different FreeSwitch server than the one on which the SIP client is actually registered as performed in [12][13][14][17].
REFERENCES [1]
[2] Fig. 11. Fragment of code appended to default XML dialplan of F1.
This also works for the SIP clients registered on different PBX servers to communicate. However, this requires the FreeSwitch server to maintain information of the other connected servers. Figure 10 illustrates the working of a call, placed by a SIP client C1 registered on a particular FreeSwitch server for an IVRS application residing on another server connected to the registered server. If the call is initiated by the client for the IVRS, its extension is then matched in the connected server. If found, the call is connected to the IVRS and the user can retrieve the required information. The same procedure is followed by the SIP clients registered on different servers. Client C1 calls the extension of client C2 registered on different server. Server F1 looks for extension of C2 in server F2, if a match is found, then the call is established between the two clients. C. Future Work In spite of various developments in IVRS application, it is still not exploited to its full potential. We intend to integrate it with voicemail, so that the users can lodge suggestions or complaints which can be forwarded to their respective departments. We can also make use of SMS module mod_sms which is fully integrated with mod_gsmopen module to send the required information as messages to the caller. Configuring a GSM module can be quite tricky and hence, it only accepts those GSM modems that accept AT commands. The major drawback in using a GSM module is that it can handle only one call at a time. In this paper, we also proposed different architectures like health and general services which can be easily implemented using our model.
V.
CONCLUSION
In this paper, we propose a cost-effective IVRS application built without the need of physical PBX systems. We implemented this application on wireless LAN within the college and plan to expand it to the entire university for each faculty. We can also deploy this application for the city by integrating health services and general services to public telephone line. This application serves as a backbone for developing various other applications which can easily be integrated to the current scenario such as complaint boxes can be set up for various municipal departments.
[3] [4]
[5] [6] [7] [8]
[9] [10]
[11]
[12]
[13]
[14]
[15]
[16]
[17]
[18]
[19]
"Highlights of Telecom Subscription Data as on 31 May 2012". TRAI. 4 July 2012. http://www.trai.gov.in/WriteReadData/PressRealease/Document/PRTSD-May12.pdf "Internet subscriber base in India may reach 150mn: Report". Financial Express. http://www.financialexpress.com/news/internet-subscriberbase-in-india-may-reach-150-mn-report/998389, accessed on 11 April 2013. FreeSwitch: http://www.freeswitch.org, accessed on April 2013. Qadeer, Mohammed Abdul, Kanika Shah, and Utkarsh Goel. "VoiceVideo Communication on Mobile Phones and PCs' Using Asterisk EPBX." In Communication Systems and Network Technologies (CSNT), 2012 International Conference on, pp. 534-538. IEEE, 2012. Asterisk.org, "About Asterisk PBX",http://www.asterisk.org/get-started, accessed on April, 2013. SQLite: http://www.sqlite.org/, accessed on April 2013. Huawei: http://www.huawei.com/en/, accessed on April 2013. Anthony Minessale, Michael S. Collins, Darren Schreiber. "Build robust high performance telephony systems using FreeSWITCH" FreeSWITCH 1.0.6 X-Lite: http://www.counterpath.com/x-lite.html, accessed April 2013. Qadeer, Mohammed A., and Ale Imran. "Asterisk voice exchange: An alternative to conventional EPBX." In Computer and Electrical Engineering, 2008. ICCEE 2008. International Conference on, pp. 652656. IEEE, 2008. Imran, Ale, Mohammed A. Qadeer, and M. Khan. "Asterisk VoIP private branch exchange." In Multimedia, Signal Processing and Communication Technologies, 2009. IMPACT'09. International, pp. 217-220. IEEE, 2009. Qadeer, Mohammed Abdul. "Dynamic Call Transfer through Wi-Fi Networks Using Asterisk." In Proceedings of the International Conference on Soft Computing for Problem Solving (SocProS 2011) December 20-22, 2011, pp. 51-61. Springer India, 2012. Imran, Ale, and Mohammed A. Qadeer. "Conferencing, paging, voice mailing via Asterisk EPBX." In Computer Engineering and Technology, 2009. ICCET'09. International Conference on, vol. 1, pp. 186-190. IEEE, 2009. Qadeer, Mohammed A., Mohammad Salim, and M. Sana Akhtar. "Profile management and authentication using LDAP." In Computer Engineering and Technology, 2009. ICCET'09. International Conference on, vol. 2, pp. 247-251. IEEE, 2009. Qadeer, Mohammed A., Afaq H. Khan, Juned A. Ansari, and Sariya Waheed. "IMS Network Architecture." In Future Computer and Communication, 2009. ICFCC 2009. International Conference on, pp. 329-333. IEEE, 2009. Qadeer, Mohammed A., Nadeem Akhtar, Shalini Govil, and Anuja Varshney. "A Novel Scheme for Mobile Payment Using RFID-Enabled Smart SIMcard." In Future Computer and Communication, 2009. ICFCC 2009. International Conference on, pp. 339-343. IEEE, 2009. Qadeer, Mohammed A., Robin Kasana, and Sarvat Sayeed. "Encrypted voice calls with ip enabled wireless phones over gsm/cdma/wifi networks." In Computer Engineering and Technology, 2009. ICCET'09. International Conference on, vol. 2, pp. 218-222. IEEE, 2009. Salim, Mohammad, M. Sana Akhtar, and Mohammed A. Qadeer. "Data Retrieval and Security Using Lightweight Directory Access Protocol." In Knowledge Discovery and Data Mining, 2009. WKDD 2009. Second International Workshop on, pp. 685-688. IEEE, 2009. Habeeb, Ahmad Ali, and Mohammed Abdul Qadeer. "Interference evaluation and MS controlled Handoff Technique for FemtoCell." In Internet, 2009. AH-ICI 2009. First Asian Himalayas International Conference on, pp. 1-5. IEEE, 2009.