Wed Aug 6 15:17:30 EDT 2008 Pekka Pessi <first.last@nokia.com>

* nua_subnotref.c: nua_unsubscribe() should not terminate usage w/ final response
  
  Do not terminate until final NOTIFY or timeout.



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9275 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2008-08-12 17:06:35 +00:00
parent 81e1edffa9
commit b489249f60
3 changed files with 7 additions and 4 deletions

View File

@ -1 +1 @@
Tue Aug 12 13:06:05 EDT 2008
Tue Aug 12 13:06:30 EDT 2008

View File

@ -249,7 +249,7 @@ static int nua_subscribe_client_request(nua_client_request_t *cr,
nua_dialog_usage_t *du = cr->cr_usage;
sip_time_t expires = 0;
if (cr->cr_event != nua_r_subscribe || !du || du->du_shutdown)
if (cr->cr_event == nua_r_destroy || !du || du->du_shutdown)
cr->cr_terminating = 1;
if (du) {
@ -281,7 +281,7 @@ static int nua_subscribe_client_request(nua_client_request_t *cr,
nua_dialog_usage_reset_refresh(du); /* during SUBSCRIBE transaction */
if (cr->cr_terminating)
if (cr->cr_terminating || cr->cr_event != nua_r_subscribe)
expires = eu->eu_delta = 0;
else if (sip->sip_expires)
/* Use value specified by application or negotiated with Min-Expires */

View File

@ -954,7 +954,10 @@ int test_subscribe_notify(struct context *ctx)
TEST(e->data->e_status, 200);
r_tags = e->data->e_tags;
TEST_1(tl_find(r_tags, nutag_substate));
TEST(tl_find(r_tags, nutag_substate)->t_value, nua_substate_terminated);
if (en1 == a->events->head)
TEST(tl_find(r_tags, nutag_substate)->t_value, nua_substate_terminated);
else
TEST(tl_find(r_tags, nutag_substate)->t_value, nua_substate_active);
TEST_1(sip = sip_object(e->data->e_msg));
TEST_1(sip->sip_expires);
TEST_1(sip->sip_expires->ex_delta == 0);