From 10b861a44fea94913802107dbddeda0323da976e Mon Sep 17 00:00:00 2001 From: James Aimonetti Date: Mon, 24 Jun 2013 10:35:18 -0700 Subject: [PATCH 1/5] KAZOO-929: add generic vm.args --- vm.args | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 vm.args diff --git a/vm.args b/vm.args new file mode 100644 index 0000000..6988de8 --- /dev/null +++ b/vm.args @@ -0,0 +1,13 @@ +# Tell SASL not to log progress reports, and log SASL errors to a file +-sasl errlog_type error +-sasl sasl_error_logger '{file, "log/error_log.sasl"}' +-boot start_sasl + +# Use kernel poll functionality if supported by emulator ++K true + +# Start a pool of asynchronous IO threads ++A 2 + +# Comment this line out if you want the Erlang shell ++Bd From e6e837ba5d0ea35fef661c365e9491925fb0cb42 Mon Sep 17 00:00:00 2001 From: James Aimonetti Date: Mon, 24 Jun 2013 10:40:48 -0700 Subject: [PATCH 2/5] KAZOO-929: add app.config for lager config --- app.config | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 app.config diff --git a/app.config b/app.config new file mode 100644 index 0000000..293050d --- /dev/null +++ b/app.config @@ -0,0 +1,15 @@ +[ + {lager, [ + {handlers, [ + {lager_console_backend, info} + ,{lager_file_backend, [ + {file, "log/error.log"}, {level, error}, {size, 10485760}, {date, "$D0"}, {count, 5} + ]} + ,{lager_file_backend, [ + {file, "log/console.log"}, {level, info}, {size, 10485760}, {date, "$D0"}, {count, 5} + ]} + ,{lager_syslog_backend, ["2600hz", local0, debug, {lager_kazoo_formatter,["|", {callid, <<"0000000000">>}, "|", module, ":", line, " (",pid, ") ", message, "\n"]}]} + ]}, + {colored, false} + ]} +]. From df9ec490bd1540e226e17c3353b8bf3d434fd983 Mon Sep 17 00:00:00 2001 From: James Aimonetti Date: Mon, 24 Jun 2013 12:48:22 -0700 Subject: [PATCH 3/5] KAZOO-929: add app.config to vm.args --- vm.args | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vm.args b/vm.args index 6988de8..22e79d7 100644 --- a/vm.args +++ b/vm.args @@ -3,6 +3,8 @@ -sasl sasl_error_logger '{file, "log/error_log.sasl"}' -boot start_sasl +-config /etc/kazoo/app.config + # Use kernel poll functionality if supported by emulator +K true From 8645765cef161eb71928f76877347e5f87915bfd Mon Sep 17 00:00:00 2001 From: bitbashing Date: Thu, 27 Jun 2013 18:40:19 -0700 Subject: [PATCH 4/5] config tweaks --- kamailio/kamailio.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kamailio/kamailio.cfg b/kamailio/kamailio.cfg index cc770ec..547ada0 100644 --- a/kamailio/kamailio.cfg +++ b/kamailio/kamailio.cfg @@ -18,7 +18,7 @@ ####### Global Parameters ######### fork = yes children = 25 -group = kamailio +group = daemon user = kamailio server_signature = no server_header = "Server: Kazoo" @@ -197,7 +197,7 @@ loadmodule "uac_redirect.so" ####### Kazoo Integration module ########## loadmodule "db_kazoo.so" # FIXME: uncomment the next line and set the correct hostname that should be advertised to Kazoo -#modparam("db_kazoo", "node_hostname", "kamailio.kazoo.com") +modparam("db_kazoo", "node_hostname", "kamailio.2600hz.com") # If you want a certain fs_path to be sent Kazoo, uncomment the next line and set the right value #modparam("db_kazoo", "register_fs_path", "127.0.0.1:5060") From fa567d8054649c5989a07c9eefbc40c81a80abb5 Mon Sep 17 00:00:00 2001 From: karl anderson Date: Thu, 27 Jun 2013 19:25:30 -0700 Subject: [PATCH 5/5] include presence modules --- kamailio/kamailio.cfg | 44 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/kamailio/kamailio.cfg b/kamailio/kamailio.cfg index 547ada0..38ebc52 100644 --- a/kamailio/kamailio.cfg +++ b/kamailio/kamailio.cfg @@ -113,6 +113,16 @@ flags #!define FLB_NATB 6 #!define FLB_NATSIPPING 7 +# ----- presence +loadmodule "pua_dialoginfo.so" +modparam("pua_dialoginfo", "library_mode", 1) + +# TODO: ARE THESE NECESSARY +loadmodule "corex.so" +loadmodule "ctl.so" +loadmodule "cfg_rpc.so" +loadmodule "mi_rpc.so" + ######## Kamailio core extensions module ######## loadmodule "kex.so" @@ -161,6 +171,9 @@ loadmodule "htable.so" modparam("htable", "htable", "associations=>size=10;") modparam("htable", "htable", "auth_cache=>size=10;") +# TODO: IS THIS NECESSARY +modparam("htable", "htable", "dbkp=>size=4;autoexpire=7200") + ######## Pseudo-Variables module ######## loadmodule "pv.so" @@ -230,6 +243,12 @@ modparam("nathelper", "sipping_bflag", FLB_NATSIPPING) modparam("nathelper", "sipping_from", "sip:sipcheck@127.0.0.1") #modparam("nathelper", "natping_socket", "127.0.0.1:5060") +# ----- presence params ----- +loadmodule "presence.so" +loadmodule "presence_dialoginfo.so" +modparam("presence", "subs_db_mode", 1) +modparam("presence", "db_url", "kazoo://guest:guest@127.0.0.1:5672/dialoginfo") + ####### Common Module Parameters ########## modparam("auth_db|usrloc", "db_url", "kazoo://guest:guest@127.0.0.1:5672/callmgr") @@ -251,6 +270,8 @@ route route(HANDLE_IN_DIALOG_REQUESTS); + route(HANDLE_PRESENCE); + route(PREPARE_INITIAL_REQUESTS); if (isflagset(FLAG_INTERNALLY_SOURCED)) { @@ -303,6 +324,29 @@ route[HANDLE_OPTIONS] } } +route[HANDLE_PRESENCE] +{ + if (is_method("SUBSCRIBE")) { + if (!t_newtran()) { + sl_reply_error(); + exit; + } + handle_subscribe(); + t_release(); + exit; + } + + if (is_method("PUBLISH")) { + if (!t_newtran()) { + sl_reply_error(); + exit; + } + handle_publish(); + t_release(); + exit; + } +} + route[HANDLE_IN_DIALOG_REQUESTS] { if (has_totag()) {