diff --git a/kamailio/presence-role.cfg b/kamailio/presence-role.cfg index c80d5f1..0bea9f0 100644 --- a/kamailio/presence-role.cfg +++ b/kamailio/presence-role.cfg @@ -69,13 +69,12 @@ modparam("nat_traversal", "keepalive_interval", 45) #!ifdef NAT_TRAVERSAL_ROLE route[PRESENCE_NAT] { + force_rport(); if (client_nat_test("3")) { - fix_contact(); + if(is_first_hop()) + set_contact_alias(); } - nat_keepalive(); - force_rport(); - } #!endif @@ -89,18 +88,26 @@ route[HANDLE_SUBSCRIBE] route(PRESENCE_NAT); #!endif + if (!t_newtran()) { + sl_reply_error(); + exit; + } + if(has_totag()) { route(HANDLE_RESUBSCRIBE); } else { route(HANDLE_NEW_SUBSCRIBE); } + t_release(); + exit; } route[HANDLE_RESUBSCRIBE] { loose_route(); + if(handle_subscribe()) { if($subs(remote_cseq) < 5) { $sht(first=>$subs(callid)) = $null; @@ -144,6 +151,8 @@ route[HANDLE_NEW_SUBSCRIBE] } } + record_route(); + if (handle_subscribe()) { route(SUBSCRIBE_AMQP); xlog("L_INFO","$ci|end|new $hdr(Event) subscription from $fU to $tU in realm $fd : $sht(first=>$ci) : $sht(first=>$fU::$tU::$fd::$hdr(Event))\n");