aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-10 16:08:20 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-10 16:08:20 +0000
commitbfd9af9b0e9d965ba9f5f6c7479f9a3fab0449fd (patch)
tree0ace1f3f1bc2c58faa1fc45103e2bc5e7b4eca44 /channels
parent1dbddce33ea0ddd7689bd79d03cacb8f41187f06 (diff)
When we receive no response at all to our INVITE, allow the channel to be destroyed.
(closes issue #15627) Reported by: falves11 Patches: 20091209__issue15627__1.6.0.diff.txt uploaded by tilghman (license 14) 20091209__issue15627__1.4.diff.txt uploaded by tilghman (license 14) Tested by: falves11 Review: https://reviewboard.asterisk.org/r/446/ (closes issue #15716) Reported by: dant (closes issue #16270) Reported by: corruptor (closes issue #15356) Reported by: falves11 (issue #16382) Reported by: lftsy git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@234095 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index a40e5aa00..654bebbd5 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -3116,6 +3116,9 @@ static int auto_congest(const void *nothing)
ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
ast_channel_unlock(p->owner);
}
+
+ /* Give the channel a chance to act before we proceed with destruction */
+ sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
}
ast_mutex_unlock(&p->lock);
return 0;
@@ -3759,18 +3762,19 @@ static int sip_hangup(struct ast_channel *ast)
if (ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
/* stop retransmitting an INVITE that has not received a response */
struct sip_pkt *cur;
- for (cur = p->packets; cur; cur = cur->next) {
- __sip_semi_ack(p, cur->seqno, ast_test_flag(cur, FLAG_RESPONSE), cur->method ? cur->method : find_sip_method(cur->data));
- }
/* if we can't send right now, mark it pending */
if (p->invitestate == INV_CALLING) {
/* We can't send anything in CALLING state */
ast_set_flag(&p->flags[0], SIP_PENDINGBYE);
+ __sip_pretend_ack(p);
/* Do we need a timer here if we don't hear from them at all? Yes we do or else we will get hung dialogs and those are no fun. */
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
append_history(p, "DELAY", "Not sending cancel, waiting for timeout");
} else {
+ for (cur = p->packets; cur; cur = cur->next) {
+ __sip_semi_ack(p, cur->seqno, ast_test_flag(cur, FLAG_RESPONSE), cur->method ? cur->method : find_sip_method(cur->data));
+ }
p->invitestate = INV_CANCELLED;
/* Send a new request: CANCEL */
transmit_request(p, SIP_CANCEL, p->lastinvite, XMIT_RELIABLE, FALSE);