<p>Harald Welte <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/9270">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Add Cause to DISCONNECT and RELEASE Requests<br><br>GSM 04.08 10.5.4.11 (Table 10.85) states:<br><br>Coding standards other than the standard defined for the<br>GSM PLMNS shall not be used if the cause can be represented<br>with the GSM standardized coding.<br><br>This patch adds cause coding GSM PLMS (3) and sets cause<br>location to  "public network serving the local user" (2)<br>This prevents UE that pay attention to this from treating<br>all call termination as an error and paves the way to<br>adding correct cause mapping from Table 10.86<br><br>Also replaces use of magic numbers with enum constants.<br><br>Change-Id: I5d3fe3f0c9e8de26dd0c73b10b7e4fc63dff3952<br>---<br>M src/mncc.c<br>1 file changed, 12 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/mncc.c b/src/mncc.c</span><br><span>index 3b9f0f4..b2c4abb 100644</span><br><span>--- a/src/mncc.c</span><br><span>+++ b/src/mncc.c</span><br><span>@@ -107,6 +107,11 @@</span><br><span> {</span><br><span>     mncc->msg_type = msg_type;</span><br><span>        mncc->callref = callref;</span><br><span style="color: hsl(120, 100%, 40%);">+   if (MNCC_DISC_REQ == msg_type || MNCC_REL_REQ == msg_type) {</span><br><span style="color: hsl(120, 100%, 40%);">+          mncc->fields |= MNCC_F_CAUSE;</span><br><span style="color: hsl(120, 100%, 40%);">+              mncc->cause.coding = GSM48_CAUSE_CODING_GSM;</span><br><span style="color: hsl(120, 100%, 40%);">+               mncc->cause.location = GSM48_CAUSE_LOC_PUN_S_LU;</span><br><span style="color: hsl(120, 100%, 40%);">+   }</span><br><span> }</span><br><span> </span><br><span> static void mncc_write(struct mncc_connection *conn, struct gsm_mncc *mncc, uint32_t callref)</span><br><span>@@ -208,9 +213,9 @@</span><br><span>    mncc_fill_header(&out_mncc, MNCC_ALERT_REQ, leg->callref);</span><br><span>    /* GSM 04.08 10.5.4.21 */</span><br><span>    out_mncc.fields |= MNCC_F_PROGRESS;</span><br><span style="color: hsl(0, 100%, 40%);">-     out_mncc.progress.coding = 3; /* Standard defined for the GSMßPLMNS */</span><br><span style="color: hsl(0, 100%, 40%);">- out_mncc.progress.location = 1; /* Private network serving the local user */</span><br><span style="color: hsl(0, 100%, 40%);">-    out_mncc.progress.descr = 8; /* In-band information or appropriate pattern now available */</span><br><span style="color: hsl(120, 100%, 40%);">+   out_mncc.progress.coding = GSM48_CAUSE_CODING_GSM; /* Standard defined for the GSMßPLMNS */</span><br><span style="color: hsl(120, 100%, 40%);">+  out_mncc.progress.location = GSM48_CAUSE_LOC_PRN_S_LU; /* Private network serving the local user */</span><br><span style="color: hsl(120, 100%, 40%);">+   out_mncc.progress.descr = GSM48_PROGR_IN_BAND_AVAIL; /* In-band information or appropriate pattern now available */</span><br><span> </span><br><span>      mncc_write(leg->conn, &out_mncc, leg->callref);</span><br><span> </span><br><span>@@ -749,16 +754,16 @@</span><br><span>        mncc.callref = leg->callref;</span><br><span> </span><br><span>  mncc.fields |= MNCC_F_CALLING;</span><br><span style="color: hsl(0, 100%, 40%);">-  mncc.calling.plan = 1;</span><br><span style="color: hsl(0, 100%, 40%);">-  mncc.calling.type = 0x0;</span><br><span style="color: hsl(120, 100%, 40%);">+      mncc.calling.plan = GSM48_NPI_ISDN_E164;</span><br><span style="color: hsl(120, 100%, 40%);">+      mncc.calling.type = GSM48_TON_UNKNOWN;</span><br><span>       osmo_strlcpy(mncc.calling.number, call->source, sizeof(mncc.calling.number));</span><br><span> </span><br><span>         if (conn->app->use_imsi_as_id) {</span><br><span>               snprintf(mncc.imsi, 15, "%s", call->dest);</span><br><span>      } else {</span><br><span>             mncc.fields |= MNCC_F_CALLED;</span><br><span style="color: hsl(0, 100%, 40%);">-           mncc.called.plan = 1;</span><br><span style="color: hsl(0, 100%, 40%);">-           mncc.called.type = 0x0;</span><br><span style="color: hsl(120, 100%, 40%);">+               mncc.called.plan = GSM48_NPI_ISDN_E164;</span><br><span style="color: hsl(120, 100%, 40%);">+               mncc.called.type = GSM48_TON_UNKNOWN;</span><br><span>                osmo_strlcpy(mncc.called.number, call->dest, sizeof(mncc.called.number));</span><br><span>         }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/9270">change 9270</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.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.osmocom.org/9270"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-sip-connector </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I5d3fe3f0c9e8de26dd0c73b10b7e4fc63dff3952 </div>
<div style="display:none"> Gerrit-Change-Number: 9270 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Keith Whyte <keith@rhizomatica.org> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: Keith Whyte <keith@rhizomatica.org> </div>