summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2015-02-26 03:03:39 +0000
committerMatthew Jordan <mjordan@digium.com>2015-02-26 03:03:39 +0000
commit3725173b9e18374e84af2fed59c245d5d15eb4bb (patch)
treea947c290eee1f709dae80c06b50683fcb5b0f0f5 /channels
parente484140aedda47d5f63f28a12ce776c34eedd066 (diff)
channels/chan_sip: Don't send a BYE after final response when PBX thread fails
When Asterisk fails to start a PBX thread for a new channel - for example, when the maxcalls setting in asterisk.conf is exceeded - we currently send a final response, and then attempt to send a BYE request to the UA. Since that's all sorts of wrong, this patch fixes that by setting sipalreadygone on the sip_pvt such that we don't get stuck sending BYE requests to something that does not want it. Note that this patch is a slight modification of the one on ASTERISK-15434. For clarity, it explicitly calls sipalreadygone with the calls to transmit a final response. ASTERISK-21845 ASTERISK-15434 #close Reported by: Makoto Dei Tested by: Matt Jordan patches: sip-pbxstart-failed.patch uploaded by Makoto Dei (License 5027) ........ Merged revisions 432320 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 432321 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432322 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index c743e0f42..cf2cd097c 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -25819,11 +25819,13 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, str
switch(result) {
case AST_PBX_FAILED:
+ sip_alreadygone(p);
ast_log(LOG_WARNING, "Failed to start PBX :(\n");
p->invitestate = INV_COMPLETED;
transmit_response_reliable(p, "503 Unavailable", req);
break;
case AST_PBX_CALL_LIMIT:
+ sip_alreadygone(p);
ast_log(LOG_WARNING, "Failed to start PBX (call limit reached) \n");
p->invitestate = INV_COMPLETED;
transmit_response_reliable(p, "480 Temporarily Unavailable", req);