SlideShare a Scribd company logo
1 of 26
Download to read offline
Presented By:
Kamailio and Kazoo
Karl Anderson
Karl Anderson
Senior Bit Herder
My name is Karl Anderson, I am one of the senior bit herders at 2600hz. I have no
credentials that will “wow” you, but hopefully you will still find this talk
informative and at the very least interesting.
www.2600hz.com
What is Kazoo
At 2600hz we are building an
ambitious open-source
project called Kazoo. Kazoo
is a distributed
communication platform
This is Kazoo from a high level, it is a control layer focused on the telecom problem
domain. It provides modern interfaces to the communication revolution and allows
anybody to quickly enter the telecom industry. At the border you can see the SBC, which
in our case is Kamailio. We also use Kamailio for as presence and registration servers,
which is why we created the Kamailio module db_kazoo to connect to Kazoo’s internal
AMQP message bus.
www.2600hz.com
What is AMQP
• Enterprise messaging
• Initially John O'Hara with JP Morgan
Chase
• 2005 formed a working group, which
grew to include:
Cisco, Bank of America, Red Hat,
Microsoft, VM Ware, Goldman
Sachs, Software AG and Others
• Originated from the demands of financial services. Completely open, version 1.0
accepted by OASIS (Organization for the Advancement of Structured Information
Standards) this year.
• It is a document, standard specification. We use a implementation called
RabbitMQ.
• AMQP is a wire-level messaging protocol that offers organizations an efficient,
reliable approach to passing real-time data and business transactions with
confidence. AMQP provides a platform-agnostic method for ensuring information is
safely transported between applications, among organizations, within mobile
infrastructures, and across the Cloud.
• Solves the a lot of really hard distributed system problems.
What Does this Mean?
• Messages are published to exchanges, which are often compared to post
offices or mailboxes. Exchanges then distribute message copies
to queues using rules called bindings. Then AMQP brokers either deliver
messages to consumers subscribed to queues, or consumers fetch/pull
messages from queues on demand.
• A direct exchange delivers messages to queues based on the message
routing key. A direct exchange is ideal for the unicast routing of messages
• A fanout exchange routes messages to all of the queues that are bound to
it and the routing key is ignored.
• Topic exchanges route messages to one or many queues based on
matching between a message routing key and the pattern that was used
to bind a queue to an exchange. The topic exchange type is often used to
implement various publish/subscribe pattern variations.
www.2600hz.com
What is db_kazoo
db_kazoo presents the Kazoo AMQP message bus a database type to Kamailio. This
allows lookups to preform response/request operations in Kazoo which in turn draw
from our database.
Discuss why we use the db interface in Kamailio and how in this architecture Kazoo
is a middle man for the Bigcouch, providing a layer of realtime logic…
www.2600hz.com
How do we use it
modparam("auth_db|usrloc", "db_url", "kazoo://guest:guest@127.0.0.1:5672/callmgr")
modparam("presence", "db_url", "kazoo://guest:guest@127.0.0.1:5672/dialoginfo")
####### Authentication module ##########
loadmodule "auth.so"
loadmodule "auth_db.so"
modparam("auth_db", "version_table", 0)
modparam("auth_db", "password_column", "password")
modparam("auth_db", "load_credentials", "$avp(password)=password")
####### User Location module ##########
loadmodule "usrloc.so"
modparam("usrloc", "db_mode", 1)
modparam("usrloc", "db_update_as_insert", 1)
route[HANDLE_REGISTER]
{
if (is_method("REGISTER")) {
if (auth_check("$fd", "subscriber", "1")) {
consume_credentials();
save("location");
} else {
auth_challenge("$fd", "0");
}
exit;
}
}
######## Generic Hash Table in shared memory ########
modparam("htable", "htable", "dbkp=>size=16;autoexpire=7200")
######## Presence User Agent ########
loadmodule "pua_dialoginfo.so"
modparam("pua_dialoginfo", "library_mode", 1)
######## Presence Server ########
loadmodule "presence.so"
loadmodule "presence_dialoginfo.so"
modparam("presence", "subs_db_mode", 1)
####### Presence Logic ########
route[HANDLE_SUBSCRIBE]
{
if (is_method("SUBSCRIBE")) {
if (!t_newtran()) {
sl_reply_error();
exit;
}
handle_subscribe();
t_release();
exit;
}
}
•How does it work
int db_kazoo_bind_api(db_func_t *dbb)
{
dbb->init = db_kazoo_init;
dbb->use_table = db_kazoo_use_table;
dbb->close = db_kazoo_close;
dbb->query = db_kazoo_query;
dbb->free_result = db_kazoo_free_result;
dbb->insert = db_kazoo_insert;
dbb->replace = db_kazoo_replace;
dbb->insert_update = db_kazoo_insert_update;
dbb->delete = db_kazoo_delete;
dbb->update = db_kazoo_update;
dbb->raw_query = db_kazoo_raw_query;
dbb->cap = DB_CAP_ALL;
return 0;
}
int dbk_credentials_query(const db1_con_t* _h, ..., db1_res_t** _r) {
amqp_mb.len = sprintf(messagebody, "{"Method":"REGISTER","
""Auth-Realm":"%.*s","
""Auth-User":"%.*s","
""From":"%.*s@%.*s","
""To":"%.*s@%.*s","
""Server-ID":"%s","
""Node":"kamailio@%.*s","
""Msg-ID":"%.*s","
""App-Version":"%s","
""App-Name":"%s","
""Event-Name":"authn_req","
""Event-Category":"directory"}",
_v[1].val.str_val.len, _v[1].val.str_val.s,
_v[0].val.str_val.len, _v[0].val.str_val.s,
_v[0].val.str_val.len, _v[0].val.str_val.s,
_v[1].val.str_val.len, _v[1].val.str_val.s,
_v[0].val.str_val.len, _v[0].val.str_val.s,
_v[1].val.str_val.len, _v[1].val.str_val.s,
serverid,
dbk_node_hostname.len, dbk_node_hostname.s,
unique_string.len, unique_string.s,
VERSION, NAME);
amqp_mb.bytes = messagebody;
if (!amqp_basic_publish(rmq->conn, rmq->channel, ..., amqp_mb)) {
goto error;
}
while (body_received < body_target) {
if (dbk_rmq_wait_for_data(rmq->conn) < 0 ) {
goto error;
}
memcpy(body + body_received, frame.payload.body_fragment.bytes,
frame.payload.body_fragment.len);
body_received += frame.payload.body_fragment.len;
if (body_received != body_target) {
goto error;
}
}
body[body_received] = '0';
db1_res_t* db_res = dbk_creds_build_result(body, _c, _nc);
*_r = db_res;
return 0;
}
www.2600hz.com
What next
www.2600hz.com
Make it More Generic
www.2600hz.com
Commit it Upstream
www.2600hz.com
Add Support to Multiple AMQP Brokers
github.com/2600hz www.2600hz.com
415-886-7900
info@2600hz.com
www.2600hz.com
CONTACT US
Thank You!
FOLLOW US
/2600hzOfficial
@2600hertz
/2600hzOfficial

More Related Content

What's hot

2600Hz - Least Cost Routing in the Cloud
2600Hz - Least Cost Routing in the Cloud2600Hz - Least Cost Routing in the Cloud
2600Hz - Least Cost Routing in the Cloud2600Hz
 
Kamailio :: A Quick Introduction
Kamailio :: A Quick IntroductionKamailio :: A Quick Introduction
Kamailio :: A Quick IntroductionOlle E Johansson
 
CNPM: Private NPM for Company / 企業級私有NPM
CNPM: Private NPM for Company / 企業級私有NPMCNPM: Private NPM for Company / 企業級私有NPM
CNPM: Private NPM for Company / 企業級私有NPMFeng Yuan
 
Kamailio - Large Unified Communication Platforms
Kamailio - Large Unified Communication PlatformsKamailio - Large Unified Communication Platforms
Kamailio - Large Unified Communication PlatformsDaniel-Constantin Mierla
 
Kamailio with Docker and Kubernetes
Kamailio with Docker and KubernetesKamailio with Docker and Kubernetes
Kamailio with Docker and KubernetesPaolo Visintin
 
High Availability Asterisk and FreePBX on Microsoft Azure
High Availability Asterisk and FreePBX on Microsoft AzureHigh Availability Asterisk and FreePBX on Microsoft Azure
High Availability Asterisk and FreePBX on Microsoft AzureSanjay Willie
 
Astricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installationsAstricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installationsOlle E Johansson
 
NGINX.conf 2017 - Not all microservices are created equal ... some are server...
NGINX.conf 2017 - Not all microservices are created equal ... some are server...NGINX.conf 2017 - Not all microservices are created equal ... some are server...
NGINX.conf 2017 - Not all microservices are created equal ... some are server...Dragos Dascalita Haut
 
Network Automation (NetDevOps) with Ansible
Network Automation (NetDevOps) with AnsibleNetwork Automation (NetDevOps) with Ansible
Network Automation (NetDevOps) with AnsibleAPNIC
 
Build HA Asterisk on Microsoft Azure using DRBD/Heartbeat
Build HA Asterisk on Microsoft Azure using DRBD/HeartbeatBuild HA Asterisk on Microsoft Azure using DRBD/Heartbeat
Build HA Asterisk on Microsoft Azure using DRBD/HeartbeatSanjay Willie
 
Docker and Pharo @ZWEIDENKER
Docker and Pharo @ZWEIDENKERDocker and Pharo @ZWEIDENKER
Docker and Pharo @ZWEIDENKERZWEIDENKER GmbH
 
SIP Server Optimizations for Mobile Networks
SIP Server Optimizations for Mobile NetworksSIP Server Optimizations for Mobile Networks
SIP Server Optimizations for Mobile NetworksDaniel-Constantin Mierla
 
Network Automation - Interconnection tools
Network Automation - Interconnection toolsNetwork Automation - Interconnection tools
Network Automation - Interconnection toolsAndy Davidson
 
NGINX.conf 2016 - Fail in order to succeed ! Designing Microservices for fail...
NGINX.conf 2016 - Fail in order to succeed ! Designing Microservices for fail...NGINX.conf 2016 - Fail in order to succeed ! Designing Microservices for fail...
NGINX.conf 2016 - Fail in order to succeed ! Designing Microservices for fail...Dragos Dascalita Haut
 
Ruby プログラマのための Perl ウェブアプリケーション開発入門 (Perl web development guide for Rubyist )
Ruby プログラマのための Perl ウェブアプリケーション開発入門 (Perl web development guide for Rubyist )  Ruby プログラマのための Perl ウェブアプリケーション開発入門 (Perl web development guide for Rubyist )
Ruby プログラマのための Perl ウェブアプリケーション開発入門 (Perl web development guide for Rubyist ) Kensuke Nagae
 
Nats.io meetup october 2015 - Community Update
Nats.io meetup october 2015 - Community UpdateNats.io meetup october 2015 - Community Update
Nats.io meetup october 2015 - Community UpdateBrian Flannery
 
Pharo, Spec and GTK
Pharo, Spec and GTKPharo, Spec and GTK
Pharo, Spec and GTKESUG
 
What is NetDevOps? How? Leslie Carr PuppetConf 2015
What is NetDevOps? How? Leslie Carr PuppetConf 2015What is NetDevOps? How? Leslie Carr PuppetConf 2015
What is NetDevOps? How? Leslie Carr PuppetConf 2015Leslie Carr
 

What's hot (20)

Provisioning Q and A
Provisioning Q and AProvisioning Q and A
Provisioning Q and A
 
Kamailio and VoIP Wild World
Kamailio and VoIP Wild WorldKamailio and VoIP Wild World
Kamailio and VoIP Wild World
 
2600Hz - Least Cost Routing in the Cloud
2600Hz - Least Cost Routing in the Cloud2600Hz - Least Cost Routing in the Cloud
2600Hz - Least Cost Routing in the Cloud
 
Kamailio :: A Quick Introduction
Kamailio :: A Quick IntroductionKamailio :: A Quick Introduction
Kamailio :: A Quick Introduction
 
CNPM: Private NPM for Company / 企業級私有NPM
CNPM: Private NPM for Company / 企業級私有NPMCNPM: Private NPM for Company / 企業級私有NPM
CNPM: Private NPM for Company / 企業級私有NPM
 
Kamailio - Large Unified Communication Platforms
Kamailio - Large Unified Communication PlatformsKamailio - Large Unified Communication Platforms
Kamailio - Large Unified Communication Platforms
 
Kamailio with Docker and Kubernetes
Kamailio with Docker and KubernetesKamailio with Docker and Kubernetes
Kamailio with Docker and Kubernetes
 
High Availability Asterisk and FreePBX on Microsoft Azure
High Availability Asterisk and FreePBX on Microsoft AzureHigh Availability Asterisk and FreePBX on Microsoft Azure
High Availability Asterisk and FreePBX on Microsoft Azure
 
Astricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installationsAstricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installations
 
NGINX.conf 2017 - Not all microservices are created equal ... some are server...
NGINX.conf 2017 - Not all microservices are created equal ... some are server...NGINX.conf 2017 - Not all microservices are created equal ... some are server...
NGINX.conf 2017 - Not all microservices are created equal ... some are server...
 
Network Automation (NetDevOps) with Ansible
Network Automation (NetDevOps) with AnsibleNetwork Automation (NetDevOps) with Ansible
Network Automation (NetDevOps) with Ansible
 
Build HA Asterisk on Microsoft Azure using DRBD/Heartbeat
Build HA Asterisk on Microsoft Azure using DRBD/HeartbeatBuild HA Asterisk on Microsoft Azure using DRBD/Heartbeat
Build HA Asterisk on Microsoft Azure using DRBD/Heartbeat
 
Docker and Pharo @ZWEIDENKER
Docker and Pharo @ZWEIDENKERDocker and Pharo @ZWEIDENKER
Docker and Pharo @ZWEIDENKER
 
SIP Server Optimizations for Mobile Networks
SIP Server Optimizations for Mobile NetworksSIP Server Optimizations for Mobile Networks
SIP Server Optimizations for Mobile Networks
 
Network Automation - Interconnection tools
Network Automation - Interconnection toolsNetwork Automation - Interconnection tools
Network Automation - Interconnection tools
 
NGINX.conf 2016 - Fail in order to succeed ! Designing Microservices for fail...
NGINX.conf 2016 - Fail in order to succeed ! Designing Microservices for fail...NGINX.conf 2016 - Fail in order to succeed ! Designing Microservices for fail...
NGINX.conf 2016 - Fail in order to succeed ! Designing Microservices for fail...
 
Ruby プログラマのための Perl ウェブアプリケーション開発入門 (Perl web development guide for Rubyist )
Ruby プログラマのための Perl ウェブアプリケーション開発入門 (Perl web development guide for Rubyist )  Ruby プログラマのための Perl ウェブアプリケーション開発入門 (Perl web development guide for Rubyist )
Ruby プログラマのための Perl ウェブアプリケーション開発入門 (Perl web development guide for Rubyist )
 
Nats.io meetup october 2015 - Community Update
Nats.io meetup october 2015 - Community UpdateNats.io meetup october 2015 - Community Update
Nats.io meetup october 2015 - Community Update
 
Pharo, Spec and GTK
Pharo, Spec and GTKPharo, Spec and GTK
Pharo, Spec and GTK
 
What is NetDevOps? How? Leslie Carr PuppetConf 2015
What is NetDevOps? How? Leslie Carr PuppetConf 2015What is NetDevOps? How? Leslie Carr PuppetConf 2015
What is NetDevOps? How? Leslie Carr PuppetConf 2015
 

Viewers also liked

TADSummit Dangerous demo: Oracle
TADSummit Dangerous demo: OracleTADSummit Dangerous demo: Oracle
TADSummit Dangerous demo: OracleAlan Quayle
 
VirtualPBX - Back Office, Delivering Voice in a Competitive Market - KazooCon...
VirtualPBX - Back Office, Delivering Voice in a Competitive Market - KazooCon...VirtualPBX - Back Office, Delivering Voice in a Competitive Market - KazooCon...
VirtualPBX - Back Office, Delivering Voice in a Competitive Market - KazooCon...2600Hz
 
KazooCon 2014 - WebRTC
KazooCon 2014 - WebRTCKazooCon 2014 - WebRTC
KazooCon 2014 - WebRTC2600Hz
 
KazooCon 2014 - Building Your Business: Behind the Numbers!
KazooCon 2014 - Building Your Business: Behind the Numbers!KazooCon 2014 - Building Your Business: Behind the Numbers!
KazooCon 2014 - Building Your Business: Behind the Numbers!2600Hz
 
KazooCon 2014 - Control Cellular Service via APIs
KazooCon 2014 - Control Cellular Service via APIsKazooCon 2014 - Control Cellular Service via APIs
KazooCon 2014 - Control Cellular Service via APIs2600Hz
 
Kamailio and VoIP Wild World
Kamailio and VoIP Wild WorldKamailio and VoIP Wild World
Kamailio and VoIP Wild World2600Hz
 
The end 인터렉 수정없음
The end 인터렉 수정없음The end 인터렉 수정없음
The end 인터렉 수정없음유림 이
 
인터렉2조 도담도담
인터렉2조 도담도담인터렉2조 도담도담
인터렉2조 도담도담유림 이
 
Carbono fluor
Carbono fluorCarbono fluor
Carbono fluorangelo26_
 
Life after cancer - Second International Course on Adolescents and Young Adul...
Life after cancer - Second International Course on Adolescents and Young Adul...Life after cancer - Second International Course on Adolescents and Young Adul...
Life after cancer - Second International Course on Adolescents and Young Adul...Diego Villalón García
 
Química inorgánica medicinal, vanadio, platino, oro
Química inorgánica medicinal, vanadio, platino, oroQuímica inorgánica medicinal, vanadio, platino, oro
Química inorgánica medicinal, vanadio, platino, oroangelo26_
 
La importancia del molibdermo
La importancia del molibdermoLa importancia del molibdermo
La importancia del molibdermoangelo26_
 

Viewers also liked (14)

TADSummit Dangerous demo: Oracle
TADSummit Dangerous demo: OracleTADSummit Dangerous demo: Oracle
TADSummit Dangerous demo: Oracle
 
VirtualPBX - Back Office, Delivering Voice in a Competitive Market - KazooCon...
VirtualPBX - Back Office, Delivering Voice in a Competitive Market - KazooCon...VirtualPBX - Back Office, Delivering Voice in a Competitive Market - KazooCon...
VirtualPBX - Back Office, Delivering Voice in a Competitive Market - KazooCon...
 
KazooCon 2014 - WebRTC
KazooCon 2014 - WebRTCKazooCon 2014 - WebRTC
KazooCon 2014 - WebRTC
 
KazooCon 2014 - Building Your Business: Behind the Numbers!
KazooCon 2014 - Building Your Business: Behind the Numbers!KazooCon 2014 - Building Your Business: Behind the Numbers!
KazooCon 2014 - Building Your Business: Behind the Numbers!
 
KazooCon 2014 - Control Cellular Service via APIs
KazooCon 2014 - Control Cellular Service via APIsKazooCon 2014 - Control Cellular Service via APIs
KazooCon 2014 - Control Cellular Service via APIs
 
Kamailio and VoIP Wild World
Kamailio and VoIP Wild WorldKamailio and VoIP Wild World
Kamailio and VoIP Wild World
 
NkSIP: The Erlang SIP application server
NkSIP: The Erlang SIP application serverNkSIP: The Erlang SIP application server
NkSIP: The Erlang SIP application server
 
The end 인터렉 수정없음
The end 인터렉 수정없음The end 인터렉 수정없음
The end 인터렉 수정없음
 
Ley recursos hidricos_29338
Ley recursos hidricos_29338Ley recursos hidricos_29338
Ley recursos hidricos_29338
 
인터렉2조 도담도담
인터렉2조 도담도담인터렉2조 도담도담
인터렉2조 도담도담
 
Carbono fluor
Carbono fluorCarbono fluor
Carbono fluor
 
Life after cancer - Second International Course on Adolescents and Young Adul...
Life after cancer - Second International Course on Adolescents and Young Adul...Life after cancer - Second International Course on Adolescents and Young Adul...
Life after cancer - Second International Course on Adolescents and Young Adul...
 
Química inorgánica medicinal, vanadio, platino, oro
Química inorgánica medicinal, vanadio, platino, oroQuímica inorgánica medicinal, vanadio, platino, oro
Química inorgánica medicinal, vanadio, platino, oro
 
La importancia del molibdermo
La importancia del molibdermoLa importancia del molibdermo
La importancia del molibdermo
 

Similar to Kazoo and Kamailio Presentation on Distributed Communication Platform

Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !Guido Schmutz
 
Advanced use cases and approaches with stratos paa s
Advanced use cases and approaches with stratos paa sAdvanced use cases and approaches with stratos paa s
Advanced use cases and approaches with stratos paa sWSO2
 
Automating Oracle Database deployment with Amazon Web Services, fabric, and boto
Automating Oracle Database deployment with Amazon Web Services, fabric, and botoAutomating Oracle Database deployment with Amazon Web Services, fabric, and boto
Automating Oracle Database deployment with Amazon Web Services, fabric, and botomjbommar
 
Messaging - RabbitMQ, Azure (Service Bus), Docker and Azure Functions
Messaging - RabbitMQ, Azure (Service Bus), Docker and Azure FunctionsMessaging - RabbitMQ, Azure (Service Bus), Docker and Azure Functions
Messaging - RabbitMQ, Azure (Service Bus), Docker and Azure FunctionsJohn Staveley
 
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018Amazon Web Services Korea
 
AWS Startup Webinar | Developing on AWS
AWS Startup Webinar | Developing on AWSAWS Startup Webinar | Developing on AWS
AWS Startup Webinar | Developing on AWSAmazon Web Services
 
A1 keynote oracle_infrastructure_as_a_service_move_any_workload_to_the_cloud
A1 keynote oracle_infrastructure_as_a_service_move_any_workload_to_the_cloudA1 keynote oracle_infrastructure_as_a_service_move_any_workload_to_the_cloud
A1 keynote oracle_infrastructure_as_a_service_move_any_workload_to_the_cloudDr. Wilfred Lin (Ph.D.)
 
Ccnp™ advanced cisco® router
Ccnp™ advanced cisco® routerCcnp™ advanced cisco® router
Ccnp™ advanced cisco® routerchiliconcarne
 
Applying ML on your Data in Motion with AWS and Confluent | Joseph Morais, Co...
Applying ML on your Data in Motion with AWS and Confluent | Joseph Morais, Co...Applying ML on your Data in Motion with AWS and Confluent | Joseph Morais, Co...
Applying ML on your Data in Motion with AWS and Confluent | Joseph Morais, Co...HostedbyConfluent
 
Webinar Slides: High Volume MySQL HA: SaaS Continuous Operations with Terabyt...
Webinar Slides: High Volume MySQL HA: SaaS Continuous Operations with Terabyt...Webinar Slides: High Volume MySQL HA: SaaS Continuous Operations with Terabyt...
Webinar Slides: High Volume MySQL HA: SaaS Continuous Operations with Terabyt...Continuent
 
Real time processing of trade data with kafka, spark streaming and aerospike ...
Real time processing of trade data with kafka, spark streaming and aerospike ...Real time processing of trade data with kafka, spark streaming and aerospike ...
Real time processing of trade data with kafka, spark streaming and aerospike ...Mich Talebzadeh (Ph.D.)
 
Real time processing of trade data with kafka, spark streaming and aerospike ...
Real time processing of trade data with kafka, spark streaming and aerospike ...Real time processing of trade data with kafka, spark streaming and aerospike ...
Real time processing of trade data with kafka, spark streaming and aerospike ...Mich Talebzadeh (Ph.D.)
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolithMarkus Eisele
 
Building Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache KafkaBuilding Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache KafkaGuido Schmutz
 
[Capitole du Libre] #serverless -  mettez-le en oeuvre dans votre entreprise...
[Capitole du Libre] #serverless -  mettez-le en oeuvre dans votre entreprise...[Capitole du Libre] #serverless -  mettez-le en oeuvre dans votre entreprise...
[Capitole du Libre] #serverless -  mettez-le en oeuvre dans votre entreprise...Ludovic Piot
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolithMarkus Eisele
 
LinuxCon North America 2013: Why Lease When You Can Buy Your Cloud
LinuxCon North America 2013: Why Lease When You Can Buy Your CloudLinuxCon North America 2013: Why Lease When You Can Buy Your Cloud
LinuxCon North America 2013: Why Lease When You Can Buy Your CloudMark Hinkle
 

Similar to Kazoo and Kamailio Presentation on Distributed Communication Platform (20)

Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !
 
Advanced use cases and approaches with stratos paa s
Advanced use cases and approaches with stratos paa sAdvanced use cases and approaches with stratos paa s
Advanced use cases and approaches with stratos paa s
 
Intro to Azure Service Bus
Intro to Azure Service BusIntro to Azure Service Bus
Intro to Azure Service Bus
 
Automating Oracle Database deployment with Amazon Web Services, fabric, and boto
Automating Oracle Database deployment with Amazon Web Services, fabric, and botoAutomating Oracle Database deployment with Amazon Web Services, fabric, and boto
Automating Oracle Database deployment with Amazon Web Services, fabric, and boto
 
Messaging - RabbitMQ, Azure (Service Bus), Docker and Azure Functions
Messaging - RabbitMQ, Azure (Service Bus), Docker and Azure FunctionsMessaging - RabbitMQ, Azure (Service Bus), Docker and Azure Functions
Messaging - RabbitMQ, Azure (Service Bus), Docker and Azure Functions
 
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
 
AWS Startup Webinar | Developing on AWS
AWS Startup Webinar | Developing on AWSAWS Startup Webinar | Developing on AWS
AWS Startup Webinar | Developing on AWS
 
A1 keynote oracle_infrastructure_as_a_service_move_any_workload_to_the_cloud
A1 keynote oracle_infrastructure_as_a_service_move_any_workload_to_the_cloudA1 keynote oracle_infrastructure_as_a_service_move_any_workload_to_the_cloud
A1 keynote oracle_infrastructure_as_a_service_move_any_workload_to_the_cloud
 
Ccnp™ advanced cisco® router
Ccnp™ advanced cisco® routerCcnp™ advanced cisco® router
Ccnp™ advanced cisco® router
 
Applying ML on your Data in Motion with AWS and Confluent | Joseph Morais, Co...
Applying ML on your Data in Motion with AWS and Confluent | Joseph Morais, Co...Applying ML on your Data in Motion with AWS and Confluent | Joseph Morais, Co...
Applying ML on your Data in Motion with AWS and Confluent | Joseph Morais, Co...
 
Webinar Slides: High Volume MySQL HA: SaaS Continuous Operations with Terabyt...
Webinar Slides: High Volume MySQL HA: SaaS Continuous Operations with Terabyt...Webinar Slides: High Volume MySQL HA: SaaS Continuous Operations with Terabyt...
Webinar Slides: High Volume MySQL HA: SaaS Continuous Operations with Terabyt...
 
FusionCharts Clockworks
FusionCharts ClockworksFusionCharts Clockworks
FusionCharts Clockworks
 
Real time processing of trade data with kafka, spark streaming and aerospike ...
Real time processing of trade data with kafka, spark streaming and aerospike ...Real time processing of trade data with kafka, spark streaming and aerospike ...
Real time processing of trade data with kafka, spark streaming and aerospike ...
 
Real time processing of trade data with kafka, spark streaming and aerospike ...
Real time processing of trade data with kafka, spark streaming and aerospike ...Real time processing of trade data with kafka, spark streaming and aerospike ...
Real time processing of trade data with kafka, spark streaming and aerospike ...
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolith
 
Building Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache KafkaBuilding Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache Kafka
 
[Capitole du Libre] #serverless -  mettez-le en oeuvre dans votre entreprise...
[Capitole du Libre] #serverless -  mettez-le en oeuvre dans votre entreprise...[Capitole du Libre] #serverless -  mettez-le en oeuvre dans votre entreprise...
[Capitole du Libre] #serverless -  mettez-le en oeuvre dans votre entreprise...
 
Cloud computing-ppt
Cloud computing-pptCloud computing-ppt
Cloud computing-ppt
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolith
 
LinuxCon North America 2013: Why Lease When You Can Buy Your Cloud
LinuxCon North America 2013: Why Lease When You Can Buy Your CloudLinuxCon North America 2013: Why Lease When You Can Buy Your Cloud
LinuxCon North America 2013: Why Lease When You Can Buy Your Cloud
 

More from 2600Hz

Telnexus - Quote to Cash – KazooCon 2015
Telnexus - Quote to Cash – KazooCon 2015Telnexus - Quote to Cash – KazooCon 2015
Telnexus - Quote to Cash – KazooCon 20152600Hz
 
2600Hz - Billing Data with Kazoo
2600Hz - Billing Data with Kazoo2600Hz - Billing Data with Kazoo
2600Hz - Billing Data with Kazoo2600Hz
 
2600Hz - Telecom Rating and Limits
2600Hz - Telecom Rating and Limits2600Hz - Telecom Rating and Limits
2600Hz - Telecom Rating and Limits2600Hz
 
2600Hz - Detecting and Managing VoIP Fraud
2600Hz - Detecting and Managing VoIP Fraud2600Hz - Detecting and Managing VoIP Fraud
2600Hz - Detecting and Managing VoIP Fraud2600Hz
 
KazooCon 2014 - Kazoo Scalability
KazooCon 2014 - Kazoo ScalabilityKazooCon 2014 - Kazoo Scalability
KazooCon 2014 - Kazoo Scalability2600Hz
 
Build your first Monster APP
Build your first Monster APPBuild your first Monster APP
Build your first Monster APP2600Hz
 
KazooCon 2014 - Ziron, SMS for voice people
KazooCon 2014 - Ziron, SMS for voice peopleKazooCon 2014 - Ziron, SMS for voice people
KazooCon 2014 - Ziron, SMS for voice people2600Hz
 
KazooCon 2014 - Range Networks, the Future of Mobile
KazooCon 2014 - Range Networks, the Future of Mobile KazooCon 2014 - Range Networks, the Future of Mobile
KazooCon 2014 - Range Networks, the Future of Mobile 2600Hz
 
KazooCon 2014 - A Primer on Telecom Law
KazooCon 2014 - A Primer on Telecom LawKazooCon 2014 - A Primer on Telecom Law
KazooCon 2014 - A Primer on Telecom Law2600Hz
 

More from 2600Hz (9)

Telnexus - Quote to Cash – KazooCon 2015
Telnexus - Quote to Cash – KazooCon 2015Telnexus - Quote to Cash – KazooCon 2015
Telnexus - Quote to Cash – KazooCon 2015
 
2600Hz - Billing Data with Kazoo
2600Hz - Billing Data with Kazoo2600Hz - Billing Data with Kazoo
2600Hz - Billing Data with Kazoo
 
2600Hz - Telecom Rating and Limits
2600Hz - Telecom Rating and Limits2600Hz - Telecom Rating and Limits
2600Hz - Telecom Rating and Limits
 
2600Hz - Detecting and Managing VoIP Fraud
2600Hz - Detecting and Managing VoIP Fraud2600Hz - Detecting and Managing VoIP Fraud
2600Hz - Detecting and Managing VoIP Fraud
 
KazooCon 2014 - Kazoo Scalability
KazooCon 2014 - Kazoo ScalabilityKazooCon 2014 - Kazoo Scalability
KazooCon 2014 - Kazoo Scalability
 
Build your first Monster APP
Build your first Monster APPBuild your first Monster APP
Build your first Monster APP
 
KazooCon 2014 - Ziron, SMS for voice people
KazooCon 2014 - Ziron, SMS for voice peopleKazooCon 2014 - Ziron, SMS for voice people
KazooCon 2014 - Ziron, SMS for voice people
 
KazooCon 2014 - Range Networks, the Future of Mobile
KazooCon 2014 - Range Networks, the Future of Mobile KazooCon 2014 - Range Networks, the Future of Mobile
KazooCon 2014 - Range Networks, the Future of Mobile
 
KazooCon 2014 - A Primer on Telecom Law
KazooCon 2014 - A Primer on Telecom LawKazooCon 2014 - A Primer on Telecom Law
KazooCon 2014 - A Primer on Telecom Law
 

Recently uploaded

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

Kazoo and Kamailio Presentation on Distributed Communication Platform

  • 1. Presented By: Kamailio and Kazoo Karl Anderson
  • 2. Karl Anderson Senior Bit Herder My name is Karl Anderson, I am one of the senior bit herders at 2600hz. I have no credentials that will “wow” you, but hopefully you will still find this talk informative and at the very least interesting.
  • 4. At 2600hz we are building an ambitious open-source project called Kazoo. Kazoo is a distributed communication platform
  • 5. This is Kazoo from a high level, it is a control layer focused on the telecom problem domain. It provides modern interfaces to the communication revolution and allows anybody to quickly enter the telecom industry. At the border you can see the SBC, which in our case is Kamailio. We also use Kamailio for as presence and registration servers, which is why we created the Kamailio module db_kazoo to connect to Kazoo’s internal AMQP message bus.
  • 7. • Enterprise messaging • Initially John O'Hara with JP Morgan Chase • 2005 formed a working group, which grew to include: Cisco, Bank of America, Red Hat, Microsoft, VM Ware, Goldman Sachs, Software AG and Others • Originated from the demands of financial services. Completely open, version 1.0 accepted by OASIS (Organization for the Advancement of Structured Information Standards) this year. • It is a document, standard specification. We use a implementation called RabbitMQ. • AMQP is a wire-level messaging protocol that offers organizations an efficient, reliable approach to passing real-time data and business transactions with confidence. AMQP provides a platform-agnostic method for ensuring information is safely transported between applications, among organizations, within mobile infrastructures, and across the Cloud. • Solves the a lot of really hard distributed system problems.
  • 8.
  • 9. What Does this Mean? • Messages are published to exchanges, which are often compared to post offices or mailboxes. Exchanges then distribute message copies to queues using rules called bindings. Then AMQP brokers either deliver messages to consumers subscribed to queues, or consumers fetch/pull messages from queues on demand. • A direct exchange delivers messages to queues based on the message routing key. A direct exchange is ideal for the unicast routing of messages • A fanout exchange routes messages to all of the queues that are bound to it and the routing key is ignored. • Topic exchanges route messages to one or many queues based on matching between a message routing key and the pattern that was used to bind a queue to an exchange. The topic exchange type is often used to implement various publish/subscribe pattern variations.
  • 11. db_kazoo presents the Kazoo AMQP message bus a database type to Kamailio. This allows lookups to preform response/request operations in Kazoo which in turn draw from our database. Discuss why we use the db interface in Kamailio and how in this architecture Kazoo is a middle man for the Bigcouch, providing a layer of realtime logic…
  • 14. ####### Authentication module ########## loadmodule "auth.so" loadmodule "auth_db.so" modparam("auth_db", "version_table", 0) modparam("auth_db", "password_column", "password") modparam("auth_db", "load_credentials", "$avp(password)=password") ####### User Location module ########## loadmodule "usrloc.so" modparam("usrloc", "db_mode", 1) modparam("usrloc", "db_update_as_insert", 1) route[HANDLE_REGISTER] { if (is_method("REGISTER")) { if (auth_check("$fd", "subscriber", "1")) { consume_credentials(); save("location"); } else { auth_challenge("$fd", "0"); } exit; } }
  • 15. ######## Generic Hash Table in shared memory ######## modparam("htable", "htable", "dbkp=>size=16;autoexpire=7200") ######## Presence User Agent ######## loadmodule "pua_dialoginfo.so" modparam("pua_dialoginfo", "library_mode", 1) ######## Presence Server ######## loadmodule "presence.so" loadmodule "presence_dialoginfo.so" modparam("presence", "subs_db_mode", 1) ####### Presence Logic ######## route[HANDLE_SUBSCRIBE] { if (is_method("SUBSCRIBE")) { if (!t_newtran()) { sl_reply_error(); exit; } handle_subscribe(); t_release(); exit; } }
  • 17. int db_kazoo_bind_api(db_func_t *dbb) { dbb->init = db_kazoo_init; dbb->use_table = db_kazoo_use_table; dbb->close = db_kazoo_close; dbb->query = db_kazoo_query; dbb->free_result = db_kazoo_free_result; dbb->insert = db_kazoo_insert; dbb->replace = db_kazoo_replace; dbb->insert_update = db_kazoo_insert_update; dbb->delete = db_kazoo_delete; dbb->update = db_kazoo_update; dbb->raw_query = db_kazoo_raw_query; dbb->cap = DB_CAP_ALL; return 0; }
  • 18.
  • 19. int dbk_credentials_query(const db1_con_t* _h, ..., db1_res_t** _r) { amqp_mb.len = sprintf(messagebody, "{"Method":"REGISTER"," ""Auth-Realm":"%.*s"," ""Auth-User":"%.*s"," ""From":"%.*s@%.*s"," ""To":"%.*s@%.*s"," ""Server-ID":"%s"," ""Node":"kamailio@%.*s"," ""Msg-ID":"%.*s"," ""App-Version":"%s"," ""App-Name":"%s"," ""Event-Name":"authn_req"," ""Event-Category":"directory"}", _v[1].val.str_val.len, _v[1].val.str_val.s, _v[0].val.str_val.len, _v[0].val.str_val.s, _v[0].val.str_val.len, _v[0].val.str_val.s, _v[1].val.str_val.len, _v[1].val.str_val.s, _v[0].val.str_val.len, _v[0].val.str_val.s, _v[1].val.str_val.len, _v[1].val.str_val.s, serverid, dbk_node_hostname.len, dbk_node_hostname.s, unique_string.len, unique_string.s, VERSION, NAME); amqp_mb.bytes = messagebody; if (!amqp_basic_publish(rmq->conn, rmq->channel, ..., amqp_mb)) { goto error; }
  • 20. while (body_received < body_target) { if (dbk_rmq_wait_for_data(rmq->conn) < 0 ) { goto error; } memcpy(body + body_received, frame.payload.body_fragment.bytes, frame.payload.body_fragment.len); body_received += frame.payload.body_fragment.len; if (body_received != body_target) { goto error; } } body[body_received] = '0'; db1_res_t* db_res = dbk_creds_build_result(body, _c, _nc); *_r = db_res; return 0; }
  • 24. www.2600hz.com Add Support to Multiple AMQP Brokers
  • 26. 415-886-7900 info@2600hz.com www.2600hz.com CONTACT US Thank You! FOLLOW US /2600hzOfficial @2600hertz /2600hzOfficial

Editor's Notes

  1. My name is Karl Anderson, I am one of the senior bit herders at 2600hz. I have no credentials that will “wow” you, but hopefully you will still find this talk informative and at the very least interesting.
  2. So lets rewind what is Kazoo?
  3. At 2600hz we are building an ambitious open-source project called Kazoo. Kazoo is a distributed communication platform
  4. This is Kazoo from a high level, it is a control layer focused on the telecom problem domain. It provides modern interfaces to the communication revolution and allows anybody to quickly enter the telecom industry. At the border you can see the SBC, which in our case is Kamailio. We also use Kamailio for as presence and registration servers, which is why we created the Kamailio module db_kazoo to connect to Kazoo’s internal AMQP message bus.
  5. What is AMQP?
  6. Enterprise messaging Initially John O&amp;apos;Hara with JP Morgan Chase 2005 formed a working group, which grew to include: Cisco, Bank of America, Red Hat, Microsoft, VM Ware, Goldman Sachs, Software AG and Others Originated from the demands of financial services. Completely open, version 1.0 accepted by OASIS (Organization for the Advancement of Structured Information Standards) this year. It is a document, standard specification. We use a implementation called RabbitMQ. AMQP is a wire-level messaging protocol that offers organizations an efficient, reliable approach to passing real-time data and business transactions with confidence. AMQP provides a platform-agnostic method for ensuring information is safely transported between applications, among organizations, within mobile infrastructures, and across the Cloud. Solves the a lot of really hard distributed system problems.
  7. Messages are published to exchanges, which are often compared to post offices or mailboxes. Exchanges then distribute message copies to queues using rules called bindings. Then AMQP brokers either deliver messages to consumers subscribed to queues, or consumers fetch/pull messages from queues on demand. A direct exchange delivers messages to queues based on the message routing key. A direct exchange is ideal for the unicast routing of messages A fanout exchange routes messages to all of the queues that are bound to it and the routing key is ignored.  Topic exchanges route messages to one or many queues based on matching between a message routing key and the pattern that was used to bind a queue to an exchange. The topic exchange type is often used to implement various publish/subscribe pattern variations.
  8. So what is the role of db_kazoo
  9. db_kazoo presents the Kazoo AMQP message bus a database type to Kamailio. This allows lookups to preform response/request operations in Kazoo which in turn draw from our database. Discuss why we use the db interface in Kamailio and how in this architecture Kazoo is a middle man for the Bigcouch, providing a layer of realtime logic…
  10. So, how do we use it?
  11. First configure it
  12. typedef struct db_func { unsigned int cap; /* Capability vector of the database transport */ db_use_table_f use_table; /* Specify table name */ db_init_f init; /* Initialize database connection */ db_close_f close; /* Close database connection */ db_query_f query; /* query a table */ db_fetch_result_f fetch_result; /* fetch result */ db_raw_query_f raw_query; /* Raw query - SQL */ db_free_result_f free_result; /* Free a query result */ db_insert_f insert; /* Insert into table */ db_delete_f delete; /* Delete from table */ db_update_f update; /* Update table */ db_replace_f replace; /* Replace row in a table */ db_last_inserted_id_f last_inserted_id; /* Retrieve the last inserted ID in a table */ db_insert_update_f insert_update; /* Insert into table, update on duplicate key */ db_insert_delayed_f insert_delayed; /* Insert delayed into table */ db_affected_rows_f affected_rows; /* Numer of affected rows for last query */ } db_func_t;
  13. /* * Query table for specified rows * _h: structure representing database connection * _k: key names * _op: operators * _v: values of the keys that must match * _c: column names to return * _n: number of key=values pairs to compare * _nc: number of columns to return * _o: order by the specified column */
  14. What is AMQP?
  15. Make it more generic
  16. Commit it upstream
  17. Add support for connections to multiple AMQP brokers
  18. - MOR Threads!!! - ERL_TICK - Do you need to support distributed erlang? - ..are you sure?? - Cutting edge... in 1986 - erl_interface / ei - Sophisticated errors! - APR? April? - os_sock_put / os_sock_get / ect