<div dir="ltr">Hi,<div><br></div><div>I have a randomly occurring de-registration of SIP devices since 11.20.0, and I believe that the new scheduler is indirectly the cause. The following assumes that the new scheduler can (and will reasonably regularly) re-use the sched-id of 0, which never used to be possible.</div><div><br></div><div>Scenario:</div><div><br></div><div>- chan_sip is up and running, and several registrations are current.</div><div>- one of these registrations has a peer->expire sched_id value of 0</div><div>- SIP RELOAD is called, resulting in a call to set_peer_defaults(peer)</div><div><br></div><div>set_peer_defaults(peer) contains the following code:</div><div><br></div><div><div>        if (peer->expire == 0) {</div><div>                /* Don't reset expire or port time during reload</div><div>                   if we have an active registration</div><div>                */</div><div>                peer->expire = -1;</div></div><div><div>                peer->pokeexpire = -1;</div><div>                peer->keepalivesend = -1;</div><div>                set_socket_transport(&peer->socket, SIP_TRANSPORT_UDP);</div></div><div>        }</div><div><br></div><div>At which point we leak a scheduled expire_register call. The knock on effect of this is an hourly line de-registration that is only resolved by stopping the phone for an hour to let the leaked event trickle out.</div><div><br></div><div>Help? Should we:</div><div><br></div><div>1) Change the above test to 'peer->expire < 0'</div><div>2) always initialise sched_id values to -1 as soon as the peer is created.</div><div><br></div><div>Thanks,</div><div>Steve</div><div><br></div><div><br></div></div>