From de612fe9b6ab1a3023af3689a9b90367039cb94f Mon Sep 17 00:00:00 2001 From: lazedo Date: Mon, 6 Aug 2018 19:11:21 +0100 Subject: [PATCH] early handle of subscription timeout --- kamailio/presence_notify_sync-role.cfg | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kamailio/presence_notify_sync-role.cfg b/kamailio/presence_notify_sync-role.cfg index da44700..d8b4b8e 100644 --- a/kamailio/presence_notify_sync-role.cfg +++ b/kamailio/presence_notify_sync-role.cfg @@ -51,12 +51,13 @@ event_route[presence:notify-reply] $xavp(pres=>delete_subscription) = 0; - if($notify_reply($rs) == 200) { + if($subs(reason) == "timeout") { + $xavp(pres=>delete_subscription) = 1; + xlog("L_INFO", "$ci|end|deleting subscribtion $subs(pres_uri) for $subs(watcher_username)@$subs(watcher_domain) due to timeout\n"); + } else if($notify_reply($rs) == 200) { $sht(notify=>$ci) = $null; $sht(notify=>$ci::count) = 0; xlog("L_INFO", "$ci|end|notified $subs(watcher_username)@$subs(watcher_domain) on behalf of $subs(pres_uri)\n"); - } else if($notify_reply($rs) == 481 && $subs(reason) == "timeout") { - xlog("L_INFO","$ci|end|sent subscription $hdr(Subscription-State)\n"); } else { xlog("L_ERROR", "$ci|error|received $notify_reply($rs) when notifying $subs(watcher_username)@$subs(watcher_domain) on behalf of $subs(pres_uri)\n"); if($rP != "UDP") {