After receiving an IP via STUN, do not trigger registration, if not used

This commit is contained in:
Andreas Eversberg 2023-03-25 16:51:32 +01:00
parent bab1b391c2
commit ee9ea365d8
1 changed files with 3 additions and 1 deletions

View File

@ -1658,9 +1658,11 @@ static void stun_bind_cb(stun_discovery_magic_t *magic, stun_handle_t __attribut
timer_start(&sip_ep->stun_retry_timer, sip_ep->stun_interval);
PDEBUG(DSIP, DEBUG_INFO, "STUN resolved!\n");
PDEBUG(DSIP, DEBUG_DEBUG, " -> Public IP = %s\n", public_ip);
/* only if IP changed and only if we do register */
if (!!strcmp(sip_ep->public_ip, public_ip)) {
strcpy(sip_ep->public_ip, public_ip);
sip_ep->register_state = REGISTER_STATE_UNREGISTERED;
if (sip_ep->register_state)
sip_ep->register_state = REGISTER_STATE_UNREGISTERED;
}
break;
default: