diff --git a/kamailio/pusher-role.cfg b/kamailio/pusher-role.cfg index 1b57d8f..cb49a73 100644 --- a/kamailio/pusher-role.cfg +++ b/kamailio/pusher-role.cfg @@ -12,20 +12,28 @@ route[PUSHER_ROUTE] if ( (!is_method("INVITE")) || (!isflagset(FLAG_INTERNALLY_SOURCED)) || $hdr(X-KAZOO-PUSHER-Token-ID) == $null) return; - if(registered("location") && $hdr(X-KAZOO-PUSHER-Invite-Format) != "push_and_invite") { + if(registered("location") && $hdr(X-KAZOO-PUSHER-Invite-Format) == "invite_only") { return; } - xlog("L_INFO", "$ci| pusher received request to wakeup $tu\n"); + xlog("L_INFO", "$ci|pusher received request to wakeup $(tu{s.tolower})\n"); sl_send_reply(180, "waking the dead guy"); + t_set_fr(0, 20000); if (t_newtran()) { route(SEND_PUSH_NOTIFICATION); remove_hf_re("^X-.*"); t_save_lumps(); ts_store("$(tu{s.tolower})"); + t_suspend(); } else { sl_send_reply(500, "error creating transaction for waking the dead guy"); } + + if($hdr(X-KAZOO-PUSHER-Invite-Format) == "push_and_invite") { + return; + } + + exit(); } route[SEND_PUSH_NOTIFICATION]