diff --git a/kamailio/default.cfg b/kamailio/default.cfg index dc22a5f..9228f4c 100644 --- a/kamailio/default.cfg +++ b/kamailio/default.cfg @@ -623,6 +623,12 @@ route[INTERNAL_TO_EXTERNAL_RELAY] $du = $(ulc(callee=>received)); $fs = $(ulc(callee=>socket)); xlog("L_INFO", "$ci|log|routing $hdr(X-KAZOO-AOR) to $du via $fs\n"); + } else if ($hdr(X-KAZOO-PUSHER-Token-ID) != $null) { + xlog("L_INFO", "$ci|log|ignoring missing registration while waiting for push notification response\n"); + t_on_reply("EXTERNAL_REPLY"); + t_set_fr(0, 10000); + t_release(); + exit; } else { xlog("L_INFO", "$ci|end|user is not registered\n"); sl_send_reply("404", "Not registered"); diff --git a/kamailio/pusher-role.cfg b/kamailio/pusher-role.cfg index 6640352..71d374f 100644 --- a/kamailio/pusher-role.cfg +++ b/kamailio/pusher-role.cfg @@ -3,6 +3,7 @@ ####### SQL OPS module ########## #!ifndef TSILO_LOADED loadmodule "tsilo.so" +modparam("tsilo", "use_domain", 1) #!trydef TSILO_LOADED #!endif @@ -11,24 +12,16 @@ route[PUSHER_ROUTE] if ( (!is_method("INVITE")) || (!isflagset(FLAG_INTERNALLY_SOURCED)) || $hdr(X-KAZOO-PUSHER-Token-ID) == $null) return; - if(registered("location")) { - return; - } - xlog("L_INFO", "$ci| pusher received request to wakeup $tu\n"); sl_send_reply(180, "waking the dead guy"); if (t_newtran()) { route(SEND_PUSH_NOTIFICATION); - t_on_reply("EXTERNAL_REPLY"); - t_set_fr(0, 10000); remove_hf_re("^X-.*"); t_save_lumps(); - ts_store(); - t_release(); + ts_store("$(tu{s.tolower})"); } else { sl_send_reply(500, "error creating transaction for waking the dead guy"); } - exit; } route[SEND_PUSH_NOTIFICATION]