From: Anthony Minessale Date: Fri, 24 Aug 2012 22:53:47 +0000 (-0500) Subject: FS-4561 send notify with terminate state when we get a SUBSCRIBE with expires 0 X-Git-Tag: v1.2.3^2~178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60cd56d1fcc73edeafa65e4a41b5c44867519972;p=thirdparty%2Ffreeswitch.git FS-4561 send notify with terminate state when we get a SUBSCRIBE with expires 0 --- diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index 6f734782eb..105f58c582 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -3597,7 +3597,7 @@ void sofia_presence_handle_sip_i_subscribe(int status, if ((subbed = atoi(buf)) > 0) { sub_state = nua_substate_active; - } + } } if (sub_state == nua_substate_active) { @@ -3632,6 +3632,7 @@ void sofia_presence_handle_sip_i_subscribe(int status, switch_safe_free(sql); sstr = switch_mprintf("terminated;reason=noresource"); + } else { sip_accept_t *ap = sip->sip_accept; char accept[256] = ""; @@ -3733,6 +3734,13 @@ void sofia_presence_handle_sip_i_subscribe(int status, switch_safe_free(new_contactstr); switch_safe_free(sticky); + + if (sub_state == nua_substate_terminated) { + nua_notify(nh, + SIPTAG_EXPIRES_STR("0"), + SIPTAG_SUBSCRIPTION_STATE_STR(sstr), + TAG_END()); + } } if (sub_state == nua_substate_terminated) {