Skip to content

Commit

Permalink
change: notify callback status code
Browse files Browse the repository at this point in the history
  • Loading branch information
ireader committed Sep 16, 2023
1 parent ca26a3e commit 8ee4b38
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions libsip/src/uac/sip-uac-subscribe.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,16 @@ int sip_uac_notify_onreply(struct sip_uac_transaction_t* t, const struct sip_mes

subscribe = sip_subscribe_fetch(t->agent, &reply->callid, &reply->from.tag, &reply->to.tag, &t->req->event);
if (!subscribe)
return 0; // receive notify message before subscribe reply, discard it
{
//return 0; // receive notify message before subscribe reply, discard it

// custom notify message ???
assert(t->req && !cstrvalid(&t->req->to.tag));
return t->onreply(t->param, reply, t, reply->u.s.code);
}

// NOTICE: ignore notify before subscribe created
r = t->onreply(t->param, reply, t, 200 <= reply->u.s.code);
r = t->onreply(t->param, reply, t, reply->u.s.code);

if (0 == cstrcmp(&reply->substate.state, SIP_SUBSCRIPTION_STATE_TERMINATED))
sip_subscribe_remove(t->agent, subscribe);
Expand Down

0 comments on commit 8ee4b38

Please sign in to comment.