From 948b674225d39ed9f845fce1addd1d49c49d8152 Mon Sep 17 00:00:00 2001 From: lazedo Date: Tue, 31 Dec 2019 14:37:33 +0000 Subject: [PATCH] pusher nat handling * needs setting MANAGE_BRANCH for nat --- kamailio/pusher-role.cfg | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/kamailio/pusher-role.cfg b/kamailio/pusher-role.cfg index 8925ac3..e1df1db 100644 --- a/kamailio/pusher-role.cfg +++ b/kamailio/pusher-role.cfg @@ -15,6 +15,7 @@ route[PUSHER_ROUTE] $fs = $(ulc(callee=>socket)); xlog("L_INFO", "$ci|pusher|routing $hdr(X-KAZOO-AOR) to contact $du\n"); send_reply(100, "calling a push device"); + t_set_fr(0, 2000); route(PUSHER_TO_EXTERNAL_RELAY); } else { send_reply(100, "waking the push device"); @@ -27,13 +28,16 @@ route[PUSHER_ROUTE] route[PUSHER_TO_EXTERNAL_RELAY] { remove_hf_re("^X-.*"); - t_set_fr(0, 2000); + set_forward_no_connect(); + t_on_branch("MANAGE_BRANCH"); + t_on_reply("EXTERNAL_REPLY"); + t_on_failure("PUSHER_EXTERNAL_FAULT"); t_relay(); } failure_route[PUSHER_EXTERNAL_FAULT] { - if (!t_check_status("486|487|603") && $avp(push_sent) != 1) { + if (!t_check_status("408|486|487|603") && $avp(push_sent) != 1) { send_reply(182, "waking the dead guy"); route(PUSHER_SEND_PUSH_NOTIFICATION); } else if (t_check_status("487")) { @@ -48,11 +52,8 @@ failure_route[PUSHER_EXTERNAL_FAULT] route[PUSHER_PREPARE_PUSH] { if (t_newtran()) { - t_set_fr(20000, 20000); route(PUSHER_PREPARE_PUSH_PAYLOAD); remove_hf_re("^X-.*"); - t_on_reply("EXTERNAL_REPLY"); - t_on_failure("PUSHER_EXTERNAL_FAULT"); t_save_lumps(); t_set_auto_inv_100(0); return 1; @@ -180,6 +181,7 @@ route[PUSHER_DELIVER_CALL] if(reg_fetch_contacts("location", "$hdr(X-KAZOO-AOR)", "callee")) { $du = $(ulc(callee=>received)); $fs = $(ulc(callee=>socket)); + t_set_fr(30000, 30000); route(PUSHER_TO_EXTERNAL_RELAY); } else { t_reply(486, "Failed to lookup after resume");