Your SlideShare is downloading. ×
Astricon 2013: "Asterisk and Database"
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Astricon 2013: "Asterisk and Database"

2,467
views

Published on

A very practical discussion on how to connect Asterisk with Relational Databases using ODBC database abstraction layer. This session will cover the basics of MySQL/ODBC installation, configuration and …

A very practical discussion on how to connect Asterisk with Relational Databases using ODBC database abstraction layer. This session will cover the basics of MySQL/ODBC installation, configuration and integration with Asterisk.

Additionally will be made practical examples about the benefits of this union: improving dialplan with SQL Queries, store Call Detail Records (CDR) in DB, implementing Realtime Architecture (ARA).

Proposed session is for those who do not yet know benefits of connecting an Asterisk box to a database or are interested to learn about it through a very simple step-by-step demo.

Published in: Technology

0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,467
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
109
Comments
0
Likes
4
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Francesco PRIOR @priorfra
  • 2. .: Numbers
  • 3. .: Numbers There are only types of people in the world: Those who understand binary, and those who don't.
  • 4. .: Happy Birthday
  • 5. .: INTROMe About 2 I’m freelancer: “The idea is my boss”. [Pablo Bernasconi – TEDx Cordoba]
  • 6. .: INTRO 2 2012 Astricon Available on:
  • 7. .: The Definitive Guide You need this book !
  • 8. .: Summary
  • 9. .: Sandwich Layers “In order to get you into the right frame of mind for what follows, we want you to picture a Dagwood sandwich.” [Asterisk™: The Definitive Guide]
  • 10. .: Premises
  • 11. .: MySQL: installation root@ubuntu001:~# apt-get install mysql-server root@ubuntu001:~# /usr/bin/mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! Select a strong password
  • 12. .: MySQL: configuration root@ubuntu001:~# mysql -u root -p mysql> CREATE USER 'asterisk'@'%' IDENTIFIED BY 'some_secret_password'; Query OK, 0 rows affected (0.00 sec) mysql> CREATE DATABASE asterisk; Query OK, 0 rows affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON asterisk.* TO 'asterisk'@'%'; root@ubuntu001:~# mysql -u asterisk -p asterisk Enter password: mysql>
  • 13. .: ODBC: installation root@ubuntu001:~# apt-get install unixODBC unixODBC-dev root@ubuntu001:~# apt-get install libmyodbc
  • 14. .: ODBC: configuration Edit /etc/odbcinst.ini Edit /etc/odbc.ini
  • 15. .: Asterisk: installation ./configure ./make menuselect make install
  • 16. .: Asterisk: configuration /etc/asterisk/res_odbc.conf /etc/asterisk/func_odbc.conf
  • 17. .: Checks Show changes in system
  • 18. .: Resuming /etc/asterisk/func_odbc.conf /etc/asterisk/res_odbc.conf /etc/odbc.ini /etc/odbcinst.ini
  • 19. .: Access from Dialplan
  • 20. .: Access from Dialplan extensions.conf SQL Queries SELECT SELECT UPDATE EXEC Procedure ………
  • 21. .: Access from Dialplan …a practical example. create a table /etc/asterisk/func_odbc.conf
  • 22. .: Access from Dialplan /etc/asterisk/extensions.conf
  • 23. .: CDR saved in Database
  • 24. .: CDR saved in DB Call Detail Records
  • 25. .: CDR saved in DB More details with customized fields.
  • 26. .: CDR saved in DB /etc/asterisk/cdr_adaptive_odbc.conf *CLI> module reload cdr_adaptive_odbc.so
  • 27. .: Now, a Demo Call now to test Dialplan and CDR on Database. 281 864 **** Phone Number no loger available It will execute:
  • 28. .: Now, a Demo
  • 29. .: Asterisk Realtime Architecture
  • 30. .: Asterisk Realtime Architecture Configuration saved in DB /etc/asterisk sip.conf ARA iax.conf voicemail.conf musiconhold.conf queues.conf ....... Static/Dynamic
  • 31. .: Asterisk Realtime Architecture • SIP/IAX peers/users • Dialplan • Queue Members • Access Control Lists • Voicemail boxes • MeetMe conferences • Music on Hold
  • 32. .: Asterisk Realtime Architecture /etc/asterisk/extconfig.conf [settings] sippeers => odbc,asterisk,ast_sippeers extensions => odbc,asterisk,dialplan
  • 33. .: Asterisk Realtime Architecture Server 1 Server 2 Server 3 Server N Scalable Replicable • Sip Peers/Users • Voicemail • Extensions Centralized
  • 34. .: Conclusion REFERENCES: Asterisk Project Wiki [https://wiki.asterisk.org/wiki/display/AST/Realtime+Database+Configuration] Asterisk: The Definitive Guide, 4th Edition [http://shop.oreilly.com/product/0636920025894.do]
  • 35. .: Any Questions ? PRIOR Francesco priorfra@gmail.com @priorfra