aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--channels/chan_sip.c1
-rw-r--r--include/asterisk/sched.h6
2 files changed, 5 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index a239e3d14..4343583b2 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -2824,6 +2824,7 @@ static enum sip_result __sip_reliable_xmit(struct sip_pvt *p, int seqno, int res
pkt->next = p->packets;
p->packets = pkt; /* Add it to the queue */
pkt->timer_t1 = p->timer_t1; /* Set SIP timer T1 */
+ pkt->retransid = -1;
if (pkt->timer_t1)
siptimer_a = pkt->timer_t1 * 2;
diff --git a/include/asterisk/sched.h b/include/asterisk/sched.h
index caba02084..cd65a6887 100644
--- a/include/asterisk/sched.h
+++ b/include/asterisk/sched.h
@@ -38,8 +38,9 @@ extern "C" {
#define AST_SCHED_DEL(sched, id) \
do { \
int _count = 0; \
- while (id > -1 && ast_sched_del(sched, id) && _count++ < 10) \
+ while (id > -1 && ast_sched_del(sched, id) && ++_count < 10) { \
usleep(1); \
+ } \
if (_count == 10) \
ast_log(LOG_WARNING, "Unable to cancel schedule ID %d. This is probably a bug (%s: %s, line %d).\n", id, __FILE__, __PRETTY_FUNCTION__, __LINE__); \
id = -1; \
@@ -48,8 +49,9 @@ extern "C" {
#define AST_SCHED_REPLACE_VARIABLE(id, sched, when, callback, data, variable) \
do { \
int _count = 0; \
- while (id > -1 && ast_sched_del(sched, id) && _count++ < 10) \
+ while (id > -1 && ast_sched_del(sched, id) && ++_count < 10) { \
usleep(1); \
+ } \
if (_count == 10) \
ast_log(LOG_WARNING, "Unable to cancel schedule ID %d. This is probably a bug (%s: %s, line %d).\n", id, __FILE__, __PRETTY_FUNCTION__, __LINE__); \
id = ast_sched_add_variable(sched, when, callback, data, variable); \