|
|
@ -5677,6 +5677,9 @@ static int auto_congest(const void *arg)
|
|
|
|
ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
|
|
|
|
ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
|
|
|
|
ast_channel_unlock(p->owner);
|
|
|
|
ast_channel_unlock(p->owner);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Give the channel a chance to act before we proceed with destruction */
|
|
|
|
|
|
|
|
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sip_pvt_unlock(p);
|
|
|
|
sip_pvt_unlock(p);
|
|
|
|
dialog_unref(p, "unreffing arg passed into auto_congest callback (p->initid)");
|
|
|
|
dialog_unref(p, "unreffing arg passed into auto_congest callback (p->initid)");
|
|
|
@ -6371,19 +6374,20 @@ static int sip_hangup(struct ast_channel *ast)
|
|
|
|
if (needcancel) { /* Outgoing call, not up */
|
|
|
|
if (needcancel) { /* Outgoing call, not up */
|
|
|
|
if (ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
|
|
|
|
if (ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
|
|
|
|
/* stop retransmitting an INVITE that has not received a response */
|
|
|
|
/* 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, cur->is_resp, cur->method ? cur->method : find_sip_method(cur->data->str));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* if we can't send right now, mark it pending */
|
|
|
|
/* if we can't send right now, mark it pending */
|
|
|
|
if (p->invitestate == INV_CALLING) {
|
|
|
|
if (p->invitestate == INV_CALLING) {
|
|
|
|
/* We can't send anything in CALLING state */
|
|
|
|
/* We can't send anything in CALLING state */
|
|
|
|
ast_set_flag(&p->flags[0], SIP_PENDINGBYE);
|
|
|
|
ast_set_flag(&p->flags[0], SIP_PENDINGBYE);
|
|
|
|
/* Do we need a timer here if we don't hear from them at all? */
|
|
|
|
__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);
|
|
|
|
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
|
|
|
|
append_history(p, "DELAY", "Not sending cancel, waiting for timeout");
|
|
|
|
append_history(p, "DELAY", "Not sending cancel, waiting for timeout");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
struct sip_pkt *cur;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (cur = p->packets; cur; cur = cur->next) {
|
|
|
|
|
|
|
|
__sip_semi_ack(p, cur->seqno, cur->is_resp, cur->method ? cur->method : find_sip_method(cur->data->str));
|
|
|
|
|
|
|
|
}
|
|
|
|
p->invitestate = INV_CANCELLED;
|
|
|
|
p->invitestate = INV_CANCELLED;
|
|
|
|
/* Send a new request: CANCEL */
|
|
|
|
/* Send a new request: CANCEL */
|
|
|
|
transmit_request(p, SIP_CANCEL, p->lastinvite, XMIT_RELIABLE, FALSE);
|
|
|
|
transmit_request(p, SIP_CANCEL, p->lastinvite, XMIT_RELIABLE, FALSE);
|
|
|
|