// Mark the contact header, to check that the remote contact is updated
((SipURI) contactHeader.getAddress().getURI()).setParameter("id", "not");
// Initial state is pending, second time we assume terminated (Expires==0)
SubscriptionStateHeader sstate = headerFactory
.createSubscriptionStateHeader(isInitial ? SubscriptionStateHeader.PENDING
: SubscriptionStateHeader.TERMINATED);
// Need a reason for terminated
if (sstate.getState().equalsIgnoreCase("terminated")) {
sstate.setReasonCode("deactivated");
}
notifyRequest.addHeader(sstate);
notifyRequest.setHeader(eventHeader);
notifyRequest.setHeader(contactHeader);