Browse Source

Merge pull request #1 from kazoo-classic/bugfix/presence-routes

Bugfix Presence Routes
ruhnet
Mooseable 9 months ago
parent
commit
13265a1a66
4 changed files with 26 additions and 8 deletions
  1. +1
    -1
      kamailio/db_queries_postgres.cfg
  2. +10
    -3
      kamailio/default.cfg
  3. +14
    -0
      kamailio/presence-notify.cfg
  4. +1
    -4
      kamailio/presence-role.cfg

+ 1
- 1
kamailio/db_queries_postgres.cfg View File

@ -13,7 +13,7 @@
#!substdef "!KZQ_PRESENCE_SEARCH_SUMMARY!select * from active_watchers where watcher_domain = '\$var(Domain)'!g"
#!substdef "!KZQ_PRESENCE_RESET!delete from presentity where sender = '\$var(MediaUrl)'!g"
#!substdef "!KZQ_REPLACE_WATCHERS_LOG!INSERT INTO active_watchers_log (presentity_uri, watcher_username, watcher_domain, event, callid, to_user, to_domain, user_agent, time, result, sent_msg, received_msg) VALUES ('\$subs(uri)', '\$subs(watcher_username)', '\$subs(watcher_domain)', '\$subs(event)','\$subs(callid)','\$subs(to_user)','\$subs(to_domain)', '\$(subs(user_agent){s.escape.common}{s.replace,\\\',''}{s.replace,\$\$,})', \$TS, \$notify_reply(\$rs), '\$(mb{s.replace,\\\',''}{s.replace,\$\$,''})', '\$(notify_reply(\$mb){s.replace,\\\',''}{s.replace,\$\$,''})') ON CONFLICT (presentity_uri, watcher_username, watcher_domain, event) DO UPDATE SET presentity_uri = excluded.presentity_uri, watcher_username = excluded.watcher_username, watcher_domain = excluded.watcher_domain, event = excluded.event!g"
#!substdef "!KZQ_REPLACE_WATCHERS_LOG!INSERT INTO active_watchers_log (presentity_uri, watcher_username, watcher_domain, event, callid, to_user, to_domain, user_agent, time, result, sent_msg, received_msg) VALUES ('$var(subs_uri)', '$var(subs_watcher_username)', '$var(subs_watcher_domain)', '$var(subs_event)','$var(subs_callid)','$var(subs_to_user)','$var(subs_to_domain)', '$var(subs_user_agent)', \$TS, '$var(notify_reply_code)', '$var(sent_msg)', '$var(received_msg)') ON CONFLICT (presentity_uri, watcher_username, watcher_domain, event) DO UPDATE SET presentity_uri = excluded.presentity_uri, watcher_username = excluded.watcher_username, watcher_domain = excluded.watcher_domain, event = excluded.event!g"
#!substdef "!KZQ_DELETE_FROM_ACTIVE_WATCHERS_WHERE_EXPIRES!DELETE FROM active_watchers WHERE expires > 0 AND to_timestamp(expires) < now() - interval '90 seconds'!g"
#!substdef "!KZQ_DELETE_FROM_ACTIVE_WATCHERS_WHERE_PRESENTITY!DELETE FROM ACTIVE_WATCHERS WHERE PRESENTITY_URI='\$subs(uri)' AND EVENT='\$subs(event)' AND FROM_USER = '\$subs(from_user)' AND FROM_DOMAIN='\$subs(from_domain)' AND CALLID <> '\$subs(callid)'!g"


+ 10
- 3
kamailio/default.cfg View File

@ -208,12 +208,19 @@ modparam("debugger", "mod_level", "core=1")
####### STATISTICS ######
loadmodule "statistics.so"
####### DATABASE module ##########
include_file "db_KAMAILIO_DBMS.cfg"
###### kazoo bindings ######
include_file "kazoo-bindings.cfg"
#!ifdef PRESENCE_ROLE
loadmodule "presence.so"
loadmodule "presence_dialoginfo.so"
loadmodule "presence_mwi.so"
loadmodule "presence_xml.so"
#!endif
####### DATABASE module ##########
include_file "db_KAMAILIO_DBMS.cfg"
####### Role Configurations ##########
#!ifdef AUTHORIZATION_ROLE
include_file "authorization-role.cfg"


+ 14
- 0
kamailio/presence-notify.cfg View File

@ -64,6 +64,20 @@ event_route[presence:notify-reply]
$xavp(pres=>delete_subscription) = 0;
###Fix issues with nested variables in specific load orders
$var(subs_uri) = $subs(uri);
$var(subs_watcher_username) = $subs(watcher_username);
$var(subs_watcher_domain) = $subs(watcher_domain);
$var(subs_event) = $subs(event);
$var(subs_callid) = $subs(callid);
$var(subs_to_user) = $subs(to_user);
$var(subs_to_domain) = $subs(to_domain);
$var(subs_user_agent) = $(subs(user_agent){s.escape.common}{s.replace,\','}{s.replace,$$,});
$var(notify_reply_code) = $notify_reply($rs);
$var(sent_msg) = $(mb{s.replace,\','}{s.replace,$$,});
$var(received_msg) = $(notify_reply($mb){s.replace,\','}{s.replace,$$,});
if($notify_reply($rs) == 200) {
$sht(notify=>$ci) = $null;
$sht(notify=>$ci::count) = 0;


+ 1
- 4
kamailio/presence-role.cfg View File

@ -34,10 +34,7 @@ modparam("nat_traversal", "keepalive_interval", 45)
modparam("htable", "htable", "first=>size=32;autoexpire=3600;initval=0;")
loadmodule "presence.so"
loadmodule "presence_dialoginfo.so"
loadmodule "presence_mwi.so"
loadmodule "presence_xml.so"
### loadmodule for the presence modules have been moved to default.cfg to load them earlier
modparam("presence_dialoginfo", "force_dummy_dialog", 1)
modparam("presence_dialoginfo", "force_single_dialog", BLF_USE_SINGLE_DIALOG)


Loading…
Cancel
Save