[asterisk-dev] Possible chan_sip problem with new scheduler

Steve Davies davies147 at gmail.com
Tue Nov 10 12:42:27 CST 2015


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.


- chan_sip is up and running, and several registrations are current.
- one of these registrations has a peer->expire sched_id value of 0
- SIP RELOAD is called, resulting in a call to set_peer_defaults(peer)

set_peer_defaults(peer) contains the following code:

        if (peer->expire == 0) {
                /* Don't reset expire or port time during reload
                   if we have an active registration
                peer->expire = -1;
                peer->pokeexpire = -1;
                peer->keepalivesend = -1;
                set_socket_transport(&peer->socket, SIP_TRANSPORT_UDP);

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.

Help? Should we:

1) Change the above test to 'peer->expire < 0'
2) always initialise sched_id values to -1 as soon as the peer is created.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20151110/8b58f45b/attachment.html>

More information about the asterisk-dev mailing list