From 61fe806c0a4c6f42510b01af71a1fe76d0ec62e4 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 2 Apr 2012 14:51:23 -0500 Subject: [PATCH] delete subs on 481 --- src/mod/endpoints/mod_sofia/sofia.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index bedafc2e5e..ebd083cae1 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -87,8 +87,8 @@ void sofia_handle_sip_r_notify(switch_core_session_t *session, int status, nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, sofia_dispatch_event_t *de, tagi_t tags[]) { -#if 0 - if (status >= 300 && sip && !sip->sip_retry_after && sip->sip_call_id && (!sofia_private || !sofia_private->is_call)) { + + if (status == 481 && sip && !sip->sip_retry_after && sip->sip_call_id && (!sofia_private || !sofia_private->is_call)) { char *sql; sql = switch_mprintf("delete from sip_subscriptions where call_id='%q'", sip->sip_call_id->i_id); @@ -96,7 +96,7 @@ void sofia_handle_sip_r_notify(switch_core_session_t *session, int status, sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE); nua_handle_destroy(nh); } -#endif + } #define url_set_chanvars(session, url, varprefix) _url_set_chanvars(session, url, #varprefix "_user", #varprefix "_host", #varprefix "_port", #varprefix "_uri", #varprefix "_params")