Browse Source

Merge pull request #21 from 2600hz/KAZOO-2780-PUA

KAZOO-2780-PUA avoid PUA
3.19
bitbashing 11 years ago
parent
commit
fe4b24d087
2 changed files with 55 additions and 12 deletions
  1. +35
    -3
      kamailio/default.cfg
  2. +20
    -9
      kamailio/presence-role.cfg

+ 35
- 3
kamailio/default.cfg View File

@ -23,8 +23,9 @@ max_while_loops = 500
####### Logging Parameters ######### ####### Logging Parameters #########
debug = L_INFO debug = L_INFO
memdbg = 10 memdbg = 10
memlog = 10
memlog = L_INFO
corelog = L_ERR corelog = L_ERR
mem_summary = 12
log_stderror = no log_stderror = no
log_facility = LOG_LOCAL0 log_facility = LOG_LOCAL0
log_name="kamailio" log_name="kamailio"
@ -164,7 +165,7 @@ modparam("db_kazoo", "amqp_max_channels", MY_AMQP_MAX_CHANNELS)
modparam("db_kazoo", "amqp_max_channels", 100) modparam("db_kazoo", "amqp_max_channels", 100)
#!endif #!endif
modparam("db_kazoo", "amqp_internal_loop_count", 1); modparam("db_kazoo", "amqp_internal_loop_count", 1);
modparam("db_kazoo", "amqp_consumer_loop_count", 3);
modparam("db_kazoo", "amqp_consumer_loop_count", 4);
####### Role Configurations ########## ####### Role Configurations ##########
#!ifdef DISPATCHER-ROLE #!ifdef DISPATCHER-ROLE
@ -625,8 +626,29 @@ onsend_route {
event_route[kazoo:mod-init] event_route[kazoo:mod-init]
{ {
#!ifdef PRESENCE-ROLE #!ifdef PRESENCE-ROLE
kazoo_subscribe("dialoginfo", "direct", "BLF-QUEUE-MY_HOSTNAME", "BLF-MY_HOSTNAME");
### use this simple form of binding a listener
### kazoo_subscribe("dialoginfo", "direct", "BLF-QUEUE-MY_HOSTNAME", "BLF-MY_HOSTNAME");
###
### or unleash the power of rabbit to kazoo-blf
###
### 'no_ack' : 1 => needs ack,
### 'wait_for_consumer_ack'
### : 1 => when it receives, it processses on the AMQP Worker ad after that it confirms
### : 0 => when it receives, it acks then processes in the AMQP Worker
### only works if no_ack : 0
###
### Rabbit Policy for ha-mode
### pattern : ^BLF
### definition : ha-mode: all
###
###
$var(payload) = "{ 'exchange' : 'dialoginfo' , 'type' : 'direct', 'queue' : 'BLF-QUEUE-MY_HOSTNAME', 'routing' : 'BLF-MY_HOSTNAME', 'auto_delete' : 0, 'durable' : 1, 'no_ack' : 0, 'wait_for_consumer_ack' : 1 }";
xlog("L_INFO","SUBSCRIBE $var(payload)");
kazoo_subscribe("$var(payload)");
#!endif #!endif
} }
event_route[kazoo:consumer-event] event_route[kazoo:consumer-event]
@ -634,5 +656,15 @@ event_route[kazoo:consumer-event]
xlog("L_INFO","unhandled AMQP event, payload: $kzE"); xlog("L_INFO","unhandled AMQP event, payload: $kzE");
} }
event_route[kazoo:consumer-event-connection-open]
{
xlog("L_INFO","connection to $(kzE{kz.json,host}) opened");
}
event_route[kazoo:consumer-event-connection-closed]
{
xlog("L_INFO","connection to $(kzE{kz.json,host}) closed");
}
# vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab # vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab

+ 20
- 9
kamailio/presence-role.cfg View File

@ -6,23 +6,31 @@ loadmodule "presence_xml.so"
modparam("presence", "subs_db_mode", 0) modparam("presence", "subs_db_mode", 0)
modparam("presence", "expires_offset", 60) modparam("presence", "expires_offset", 60)
modparam("presence", "send_fast_notify", 0)
modparam("presence", "clean_period", 30)
modparam("presence", "publ_cache", 0) modparam("presence", "publ_cache", 0)
modparam("presence", "min_expires", 0) modparam("presence", "min_expires", 0)
modparam("presence", "max_expires", 3600) modparam("presence", "max_expires", 3600)
modparam("presence", "db_url", "MY_AMQP_URL/dialoginfo")
modparam("presence", "send_fast_notify", 0)
modparam("presence", "clean_period", 30)
## use this
#modparam("presence", "db_url", "MY_AMQP_URL/dialoginfo")
## or this
modparam("presence", "db_url", "text:///etc/kazoo/kamailio/dbtext")
modparam("db_kazoo", "db_url", "text:///etc/kazoo/kamailio/dbtext")
modparam("db_kazoo", "pua_mode", 1)
modparam("presence_xml", "force_active", 1) modparam("presence_xml", "force_active", 1)
######## Presence User Agent module ######## ######## Presence User Agent module ########
loadmodule "pua.so"
modparam("pua", "db_mode", 0)
modparam("pua", "db_url", "text:///etc/kazoo/kamailio/dbtext")
modparam("pua", "update_period", 6)
modparam("pua", "min_expires", 300)
modparam("pua", "outbound_proxy", "sip:MY_IP_ADDRESS")
#loadmodule "pua.so"
#modparam("pua", "db_mode", 0)
#modparam("pua", "db_url", "text:///etc/kazoo/kamailio/dbtext")
#modparam("pua", "update_period", 6)
#modparam("pua", "min_expires", 300)
#modparam("pua", "outbound_proxy", "sip:MY_IP_ADDRESS")
####### Presence Logic ######## ####### Presence Logic ########
@ -74,7 +82,10 @@ route[HANDLE_PUBLISH]
event_route[kazoo:consumer-event-presence-update] event_route[kazoo:consumer-event-presence-update]
{ {
xlog("L_INFO", "received $(kzE{kz.json,Event-Package}) update for $(kzE{kz.json,From})");
kazoo_pua_publish($kzE); kazoo_pua_publish($kzE);
pres_refresh_watchers("$(kzE{kz.json,From})", "$(kzE{kz.json,Event-Package})", 1);
} }
# vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab # vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab

Loading…
Cancel
Save