<p>Frederic LE FOLL has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/10588">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_sip: fix Reason-Phrase for 603 Response<br><br>While RFC3261 specifies defaut Reason-Pḧrase "Decline" for Response 603<br>(see https://tools.ietf.org/html/rfc3261#section-21.6.2 "603 Decline"),<br>chan_sip generates "603 Declined".<br><br>Since RFC3261 says "603 Decline", I suggest than chan_sip uses<br>"603 Decline" instead of "603 Declined".<br><br>ASTERISK-28153<br><br>Change-Id: I4f94ae98f1cf4302fbad9895cad96eeab8c53269<br>---<br>M channels/chan_sip.c<br>1 file changed, 7 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/88/10588/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/channels/chan_sip.c b/channels/chan_sip.c</span><br><span>index 97ce93c..5be6953 100644</span><br><span>--- a/channels/chan_sip.c</span><br><span>+++ b/channels/chan_sip.c</span><br><span>@@ -7185,7 +7185,7 @@</span><br><span> get an answer to the BYE or INVITE/CANCEL</span><br><span> If we get no answer during retransmit period, drop the call anyway.</span><br><span> (Sorry, mother-in-law, you can't deny a hangup by sending</span><br><span style="color: hsl(0, 100%, 40%);">- 603 declined to BYE...)</span><br><span style="color: hsl(120, 100%, 40%);">+ 603 decline to BYE...)</span><br><span> */</span><br><span> if (p->alreadygone)</span><br><span> needdestroy = 1; /* Set destroy flag at end of this function */</span><br><span>@@ -7224,7 +7224,7 @@</span><br><span> if (p->hangupcause && (res = hangup_cause2sip(p->hangupcause)))</span><br><span> transmit_response_reliable(p, res, &p->initreq);</span><br><span> else</span><br><span style="color: hsl(0, 100%, 40%);">- transmit_response_reliable(p, "603 Declined", &p->initreq);</span><br><span style="color: hsl(120, 100%, 40%);">+ transmit_response_reliable(p, "603 Decline", &p->initreq);</span><br><span> p->invitestate = INV_TERMINATED;</span><br><span> }</span><br><span> } else { /* Call is in UP state, send BYE */</span><br><span>@@ -25439,7 +25439,7 @@</span><br><span> if the reference was successful, the body:</span><br><span> SIP/2.0 503 Service Unavailable</span><br><span> if the reference failed, or the body:</span><br><span style="color: hsl(0, 100%, 40%);">- SIP/2.0 603 Declined</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 603 Decline</span><br><span> </span><br><span> if the REFER request was accepted before approval to follow the</span><br><span> reference could be obtained and that approval was subsequently denied</span><br><span>@@ -26252,7 +26252,7 @@</span><br><span> ast_channel_state(replaces_chan) != AST_STATE_RING &&</span><br><span> ast_channel_state(replaces_chan) != AST_STATE_UP) {</span><br><span> ast_log(LOG_NOTICE, "Supervised transfer attempted to replace non-ringing or active call id (%s)!\n", replace_id);</span><br><span style="color: hsl(0, 100%, 40%);">- transmit_response_reliable(p, "603 Declined (Replaces)", req);</span><br><span style="color: hsl(120, 100%, 40%);">+ transmit_response_reliable(p, "603 Decline (Replaces)", req);</span><br><span> error = 1;</span><br><span> }</span><br><span> </span><br><span>@@ -26996,7 +26996,7 @@</span><br><span> /* This is a REFER outside of an existing SIP dialog */</span><br><span> /* We can't handle that, so decline it */</span><br><span> ast_debug(3, "Call %s: Declined REFER, outside of dialog...\n", p->callid);</span><br><span style="color: hsl(0, 100%, 40%);">- transmit_response(p, "603 Declined (No dialog)", req);</span><br><span style="color: hsl(120, 100%, 40%);">+ transmit_response(p, "603 Decline (No dialog)", req);</span><br><span> if (!req->ignore) {</span><br><span> append_history(p, "Xfer", "Refer failed. Outside of dialog.");</span><br><span> sip_alreadygone(p);</span><br><span>@@ -27008,7 +27008,7 @@</span><br><span> /* Check if transfer is allowed from this device */</span><br><span> if (p->allowtransfer == TRANSFER_CLOSED ) {</span><br><span> /* Transfer not allowed, decline */</span><br><span style="color: hsl(0, 100%, 40%);">- transmit_response(p, "603 Declined (policy)", req);</span><br><span style="color: hsl(120, 100%, 40%);">+ transmit_response(p, "603 Decline (policy)", req);</span><br><span> append_history(p, "Xfer", "Refer failed. Allowtransfer == closed.");</span><br><span> /* Do not destroy SIP session */</span><br><span> return 0;</span><br><span>@@ -27042,7 +27042,7 @@</span><br><span> }</span><br><span> break;</span><br><span> case -3:</span><br><span style="color: hsl(0, 100%, 40%);">- transmit_response(p, "603 Declined (Non sip: uri)", req);</span><br><span style="color: hsl(120, 100%, 40%);">+ transmit_response(p, "603 Decline (Non sip: uri)", req);</span><br><span> append_history(p, "Xfer", "Refer failed. Non SIP uri");</span><br><span> if (req->debug) {</span><br><span> ast_debug(1, "SIP transfer to non-SIP uri denied\n");</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10588">change 10588</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/10588"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I4f94ae98f1cf4302fbad9895cad96eeab8c53269 </div>
<div style="display:none"> Gerrit-Change-Number: 10588 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Frederic LE FOLL <frederic.lefoll@c-s.fr> </div>