@@ -29,18 +29,22 @@ int sip_uac_subscribe_onreply(struct sip_uac_transaction_t* t, const struct sip_
29
29
}
30
30
else
31
31
{
32
- r = t -> onsubscribe (t -> param , reply , t , NULL , reply -> u .s .code , NULL );
32
+ // for subscribe expires 0, to sip_subscribe_remove
33
+ subscribe = sip_subscribe_fetch (t -> agent , & t -> req -> callid , & t -> req -> from .tag , & t -> req -> to .tag , & t -> req -> event );
34
+
35
+ r = t -> onsubscribe (t -> param , reply , t , subscribe , reply -> u .s .code , subscribe ? & subscribe -> evtsession : NULL );
33
36
}
34
37
35
38
if (subscribe )
36
39
{
37
- // delete subscribe if expires is 0
38
- h = sip_message_get_header_by_name (t -> req , "Expires" );
39
- if (h && 0 == cstrtol (h , NULL , 10 ))
40
- {
41
- sip_subscribe_remove (t -> agent , subscribe );
42
- assert (1 == subscribe -> ref );
43
- }
40
+ // It's user due to remove subscribe on expires 0
41
+ //// delete subscribe if expires is 0
42
+ //h = sip_message_get_header_by_name(t->req, "Expires");
43
+ //if (h && 0 == cstrtol(h, NULL, 10))
44
+ //{
45
+ // sip_subscribe_remove(t->agent, subscribe);
46
+ // assert(1 == subscribe->ref);
47
+ //}
44
48
45
49
sip_subscribe_release (subscribe );
46
50
}
@@ -66,8 +70,8 @@ int sip_uac_notify_onreply(struct sip_uac_transaction_t* t, const struct sip_mes
66
70
// NOTICE: ignore notify before subscribe created
67
71
r = t -> onreply (t -> param , reply , t , reply -> u .s .code );
68
72
69
- if (0 == cstrcmp (& reply -> substate .state , SIP_SUBSCRIPTION_STATE_TERMINATED ))
70
- sip_subscribe_remove (t -> agent , subscribe );
73
+ // if (0 == cstrcmp(&reply->substate.state, SIP_SUBSCRIPTION_STATE_TERMINATED))
74
+ // sip_subscribe_remove(t->agent, subscribe);
71
75
72
76
sip_subscribe_release (subscribe );
73
77
return r ;
0 commit comments