If the remote unregisters, remove remote_peer
Subsequent calls will be rejected with "out of order", as they should be.
This commit is contained in:
parent
ee9ea365d8
commit
18af4626db
|
@ -963,6 +963,10 @@ static void ep_i_register(sip_endpoint_t *sip_ep, int status, nua_t *nua, nua_ha
|
|||
auth_text = "Authentication not required";
|
||||
}
|
||||
PDEBUG(DSIP, DEBUG_DEBUG, " -> Authentication: %d %s\n", status, auth_text);
|
||||
if (sip->sip_expires)
|
||||
PDEBUG(DSIP, DEBUG_DEBUG, " -> Expires: %d\n", (int)sip->sip_expires->ex_delta);
|
||||
|
||||
// FIXME: set expire timer and remove remote_peer, if expires
|
||||
|
||||
if (status == 200) {
|
||||
strcpy(sip_ep->remote_contact_user, contact_user);
|
||||
|
@ -970,6 +974,10 @@ static void ep_i_register(sip_endpoint_t *sip_ep, int status, nua_t *nua, nua_ha
|
|||
sip_ep->registered_user = sip_ep->remote_contact_user;
|
||||
sip_ep->remote_peer = sip_ep->remote_contact_peer;
|
||||
sip_ep->register_nonce[0] = '\0';
|
||||
if (sip->sip_expires && sip->sip_expires->ex_delta == 0) {
|
||||
PDEBUG(DSIP, DEBUG_INFO, "This in an unregister session.\n");
|
||||
sip_ep->remote_peer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
PDEBUG(DSIP, DEBUG_INFO, "Sending REGISTER response: %d %s (registration)\n", status, auth_text);
|
||||
|
|
Loading…
Reference in New Issue