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…
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.
So lets rewind 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.
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.
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.
So what is the role of 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…
So, how do we use it?
First configure it
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;
/*
* 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
*/
What is AMQP?
Make it more generic
Commit it upstream
Add support for connections to multiple AMQP brokers
- 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