[asterisk-dev] Should internal timer implementing session timers be stopped and restarted on response to re-invite?

Dave WOOLLEY dave.woolley at bts.co.uk
Wed Nov 12 06:20:18 CST 2014


Mark Michelson <mmichelson at digium.com> wrote:

Looking in my Asterisk 11 version of chan_sip.c, in start_session_timer(), the first if block looks like this:

    if (p->stimer->st_schedid > -1) {                                                                   
        /* in the event a timer is already going, stop it */                                            
        ast_debug(2, "Session timer stopped: %d - %s\n", p->stimer->st_schedid, p->callid);             
        AST_SCHED_DEL_UNREF(sched, p->stimer->st_schedid,                                               
            dialog_unref(p, "unref stimer->st_schedid from dialog"));                                   
    }

So it appears that calling start_session_timer() should be stopping any existing timers if they are active. Basically, restart_session_timer() is redundant and could be removed.

--------

Thanks.  Now I know what I'm looking for it was fixed in https://issues.asterisk.org/jira/browse/ASTERISK-16023 although it makes no mention of mis-operation of session timers, and doesn't even mention that if fixes leaking internal timers.  The title was "[patch] UDP ports not freed/ports leaking".

BTS Holdings PLC - Registered office: BTS House, Manor Road, Wallington, SM6 0DD - Registered in England: 1517630



More information about the asterisk-dev mailing list