--- channels/chan_sip.c (revision 416318) +++ channels/chan_sip.c (working copy) @@ -4363,19 +4363,6 @@ p->pendinginvite = seqno; } - /* If the transport is something reliable (TCP or TLS) then don't really send this reliably */ - /* I removed the code from retrans_pkt that does the same thing so it doesn't get loaded into the scheduler */ - /*! \todo According to the RFC some packets need to be retransmitted even if its TCP, so this needs to get revisited */ - if (!(p->socket.type & AST_TRANSPORT_UDP)) { - xmitres = __sip_xmit(p, data); /* Send packet */ - if (xmitres == XMIT_ERROR) { /* Serious network trouble, no need to try again */ - append_history(p, "XmitErr", "%s", fatal ? "(Critical)" : "(Non-critical)"); - return AST_FAILURE; - } else { - return AST_SUCCESS; - } - } - if (!(pkt = ast_calloc(1, sizeof(*pkt)))) { return AST_FAILURE; } @@ -4408,6 +4395,10 @@ pkt->time_sent = ast_tvnow(); /* time packet was sent */ pkt->retrans_stop_time = 64 * (pkt->timer_t1 ? pkt->timer_t1 : DEFAULT_TIMER_T1); /* time in ms after pkt->time_sent to stop retransmission */ + if (!(p->socket.type & AST_TRANSPORT_UDP)) { + pkt->retrans_stop = 1; + } + /* Schedule retransmission */ AST_SCHED_REPLACE_VARIABLE(pkt->retransid, sched, siptimer_a, retrans_pkt, pkt, 1); if (sipdebug) { @@ -24333,7 +24324,6 @@ ast_channel_hangupcause_set(owner, hangup_sip2cause(resp)); } - if (p->socket.type == AST_TRANSPORT_UDP) { int ack_res = FALSE; /* Acknowledge whatever it is destined for */ @@ -24355,7 +24345,6 @@ append_history(p, "Ignore", "Ignoring this retransmit\n"); return; } - } /* If this is a NOTIFY for a subscription clear the flag that indicates that we have a NOTIFY pending */ if (!p->owner && sipmethod == SIP_NOTIFY && p->pendinginvite) {