<p>Neels Hofmeyr has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/12401">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">fix call-during-call: switch off re-using lchan during assignment<br><br>Disable lchan re-use on repeated Assignment Requests from the MSC, in order to<br>enable switching over to a new call that is coming in during an ongoing call.<br><br>This disables a rare and untested scenario for the benefit of a very common<br>one: call during call. It adds a feature by disabling code :)<br><br>The long-term way to support call-during-call, as well as Channel Mode Modify,<br>would be to rather re-use the old lchan and implement FSM states to re-route<br>the audio. But that is a task for another day.<br><br>A more detailed explanation is given in the '#if 0' section added by this<br>patch.<br><br>To really get call-during-call working, osmo-msc also needs a fix, see the<br>change-id in 'Related' below.<br><br>Related: OS#3735, osmo-msc I0ba216b737909e92080a722db26e3577726c63cb<br>Change-Id: I0c00ec2c120e5008281755adcd4944a3ce4d8355<br>---<br>M src/osmo-bsc/assignment_fsm.c<br>1 file changed, 37 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/01/12401/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c</span><br><span>index 93362f8..8f236d1 100644</span><br><span>--- a/src/osmo-bsc/assignment_fsm.c</span><br><span>+++ b/src/osmo-bsc/assignment_fsm.c</span><br><span>@@ -251,6 +251,9 @@</span><br><span>                            new_lchan->nr);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+#if 0</span><br><span style="color: hsl(120, 100%, 40%);">+Code using this is currently disabled, search for lchan_type_compat_with_mode below.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> static bool lchan_type_compat_with_mode(enum gsm_chan_t type,</span><br><span>                                        enum gsm48_chan_mode chan_mode, int full_rate)</span><br><span> {</span><br><span>@@ -290,6 +293,7 @@</span><br><span>            return false;</span><br><span>        }</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span> </span><br><span> void assignment_fsm_init()</span><br><span> {</span><br><span>@@ -337,6 +341,38 @@</span><br><span>                 return;</span><br><span>      }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+#if 0</span><br><span style="color: hsl(120, 100%, 40%);">+  -------</span><br><span style="color: hsl(120, 100%, 40%);">+       This bit of code would re-use an existing lchan if it already satisfies the</span><br><span style="color: hsl(120, 100%, 40%);">+   mode and rate requested by the MSC.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ That is a nice idea per se, but the only practical benefit is when we were out</span><br><span style="color: hsl(120, 100%, 40%);">+        of SDCCH channels and assigned a TCH channel for signalling, and now that TCH</span><br><span style="color: hsl(120, 100%, 40%);">+ should take on the voice stream. This scenario has not been tested.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ A much more common scenario, though, is that a call is coming in while another</span><br><span style="color: hsl(120, 100%, 40%);">+        call is ongoing. Then, the user may choose to hang up the current call, and</span><br><span style="color: hsl(120, 100%, 40%);">+   continue on the new call instead. In that scenario, the MSC will send us</span><br><span style="color: hsl(120, 100%, 40%);">+      another Assignment Command with a different remote RTP address to route RTP to.</span><br><span style="color: hsl(120, 100%, 40%);">+       The proper way now would be to bump the lchan_fsm so that it re-uses everything</span><br><span style="color: hsl(120, 100%, 40%);">+       that is in place, only MDCXes the result to a different remote RTP port. This</span><br><span style="color: hsl(120, 100%, 40%);">+ is currently not implemented and would require more states in the FSM. With</span><br><span style="color: hsl(120, 100%, 40%);">+   this code enabled, we try to re-use the existing lchan but do not re-route the</span><br><span style="color: hsl(120, 100%, 40%);">+        RTP: the old call is hung up and the new call gets no audio.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        However, if we simply drop the old lchan and create a new one, we can trivially</span><br><span style="color: hsl(120, 100%, 40%);">+       set up a new lchan the same way we always do, and switching over to the new</span><br><span style="color: hsl(120, 100%, 40%);">+   caller works, without a single line of code added here.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     Hence, disable this lchan re-use until we can re-use an lchan properly.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     Test scenario:</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       - from A, call B.</span><br><span style="color: hsl(120, 100%, 40%);">+     - from C, call B; B rings during ongoing call.</span><br><span style="color: hsl(120, 100%, 40%);">+        - in B, pick up the call, choose to drop the old call.</span><br><span style="color: hsl(120, 100%, 40%);">+       -------</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>    if (conn->lchan</span><br><span>       && lchan_type_compat_with_mode(conn->lchan->type, req->chan_mode, req->full_rate)) {</span><br><span> </span><br><span>@@ -359,6 +395,7 @@</span><br><span>                              "NOT IMPLEMENTED:"</span><br><span>                         " Current lchan would be compatible, we should send Channel Mode Modify\n");</span><br><span>        }</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span> </span><br><span>        conn->assignment.new_lchan = lchan_select_by_chan_mode(bts, req->chan_mode, req->full_rate);</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12401">change 12401</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/12401"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I0c00ec2c120e5008281755adcd4944a3ce4d8355 </div>
<div style="display:none"> Gerrit-Change-Number: 12401 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>