[svn-commits] mmichelson: branch 1.8 r400970 - /branches/1.8/channels/chan_sip.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Tue Oct 15 09:52:57 CDT 2013
Author: mmichelson
Date: Tue Oct 15 09:52:54 2013
New Revision: 400970
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=400970
Log:
Prevent chan_sip from sending duplicate BYEs.
When a 200 OK for an initial INVITE is received, we were doing
the right thing by ACKing and sending an immediate BYE. However,
we also were doing the wrong thing and queuing an answer frame,
thus causing the call to be answered. This would cause the call
to be hung up by the channel thread, thus resulting in a second
BYE being sent out.
In this fix, I also have set the hangupcause to be correct since
the initial BYE being sent by Asterisk had an unknown hangup
cause. I have changed to using "Bearer capabilty not available"
since the call was hung up due to an SDP offer/answer error.
(closes issue ASTERISK-22621)
reported by Kinsey Moore
Modified:
branches/1.8/channels/chan_sip.c
Modified: branches/1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_sip.c?view=diff&rev=400970&r1=400969&r2=400970
==============================================================================
--- branches/1.8/channels/chan_sip.c (original)
+++ branches/1.8/channels/chan_sip.c Tue Oct 15 09:52:54 2013
@@ -20907,12 +20907,16 @@
ast_log(LOG_WARNING, "Unable to cancel SIP destruction. Expect bad things.\n");
p->authtries = 0;
if (find_sdp(req)) {
- if ((res = process_sdp(p, req, SDP_T38_ACCEPT)) && !req->ignore)
+ if ((res = process_sdp(p, req, SDP_T38_ACCEPT)) && !req->ignore) {
if (!reinvite) {
/* This 200 OK's SDP is not acceptable, so we need to ack, then hangup */
/* For re-invites, we try to recover */
ast_set_flag(&p->flags[0], SIP_PENDINGBYE);
+ p->owner->hangupcause = AST_CAUSE_BEARERCAPABILITY_NOTAVAIL;
+ p->hangupcause = AST_CAUSE_BEARERCAPABILITY_NOTAVAIL;
+ sip_queue_hangup_cause(p, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
}
+ }
ast_rtp_instance_activate(p->rtp);
} else if (!reinvite) {
struct ast_sockaddr remote_address = {{0,}};
@@ -20978,7 +20982,7 @@
}
if (!req->ignore && p->owner) {
- if (!reinvite) {
+ if (!reinvite && !res) {
ast_queue_control(p->owner, AST_CONTROL_ANSWER);
if (sip_cfg.callevents)
manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
More information about the svn-commits
mailing list