https://projects.osmocom.org/https://projects.osmocom.org/favicon.ico?16647414092019-12-16T22:35:56ZOpen Source Mobile Communicationsosmo-remsim - Feature #4332: call external script from remsim-client to execute specific actionshttps://projects.osmocom.org/issues/4332?journal_id=169102019-12-16T22:35:56Zlaforge
<ul><li><b>Checklist item</b> <input type='checkbox' class='checklist-checkbox' checked disabled> <i>generic mechanism to call related script (non-blocking, in separate process)</i> set to Done</li><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>30</i></li></ul><p>first part of the task implemented in <a class="external" href="https://gerrit.osmocom.org/c/libosmocore/+/16619">https://gerrit.osmocom.org/c/libosmocore/+/16619</a></p> osmo-remsim - Feature #4332: call external script from remsim-client to execute specific actionshttps://projects.osmocom.org/issues/4332?journal_id=169112019-12-17T00:05:56Zlaforge
<ul><li><b>Checklist item</b> <input type='checkbox' class='checklist-checkbox' checked disabled> <i>command: sim local vs. remote</i> set to Done</li><li><b>Checklist item</b> <input type='checkbox' class='checklist-checkbox' checked disabled> <i>command: modem reset active/inactive</i> set to Done</li><li><b>Checklist item</b> <input type='checkbox' class='checklist-checkbox' checked disabled> <i>event: modem asserts/releases SIM RST</i> set to Done</li></ul><p>I'm working with a patch that calls an external binary with a single argument and the following environment:<br /><pre>
REMSIM_SIM_RST=0
REMSIM_CLIENT_VERSION=0.2.2.30-283e
REMSIM_SERVER_STATE=CONNECTED
REMSIM_EVENT=event-modem-status
REMSIM_CLIENT_SLOT=1:0
REMSIM_USB_PATH=1-2.1
REMSIM_SIM_VCC=1
REMSIM_BANKD_ADDR=127.0.0.1:9999
REMSIM_BANKD_STATE=CONNECTED
REMSIM_SERVER_ADDR=127.0.0.1:9998
REMSIM_BANKD_SLOT=1:0
</pre></p>
The following arguments can occur:
<ul>
<li><strong>event-server-connect</strong><br /> remsim-client informs the system a logical RSPRO connection from client to server has been established</li>
<li><strong>event-bankd-connect</strong><br /> remsim-client informs the system a logical RSPRO connection from client to bankd has been established</li>
<li><strong>event-config-bankd</strong><br /> remsim-server has configured a (new) bankd/slot to connect to</li>
<li><strong>event-modem-status</strong><br /> themsim-client informs the system that the modem has swiched on/off either VCC or RST of the SIM interface</li>
<li><strong>request-card-insert</strong> / <strong>request-card-remove</strong><br /> remsim-client requests the system to simulate card-insert / card-removal to the modem</li>
<li><strong>request-sim-remote</strong> / <strong>request-sim-local</strong><br /> remsim-client requests the system to witch between remote and local SIM</li>
<li><strong>request-modem-reset</strong><br /> remsim-client requests the system to perform a modem reset</li>
</ul>
<p>In terms of the environment, the following variables have been specified so far</p>
<table>
<tr>
<th>Variable </th>
<th>Description </th>
</tr>
<tr>
<td> REMSIM_CLIENT_VERSION </td>
<td> compile-time version of the remsim-client software </td>
</tr>
<tr>
<td> REMSIM_SERVER_ADDR </td>
<td> remsim-server host:port </td>
</tr>
<tr>
<td> REMSIM_SERVER_STATE </td>
<td> state of the rspro_client_fsm connecting to remsim-server </td>
</tr>
<tr>
<td> REMSIM_BANKD_ADDR </td>
<td> remsim-bankd host:port </td>
</tr>
<tr>
<td> REMSIM_BANKD_STATE </td>
<td> state of the rspro_client_fsm connecting to remsim-bankd </td>
</tr>
<tr>
<td> REMSIM_CLIENT_SLOT </td>
<td> ClientId:SlotNr </td>
</tr>
<tr>
<td> REMSIM_BANKD_SLOT </td>
<td> BankId:SlotNr </td>
</tr>
<tr>
<td> REMSIM_USB_PATH </td>
<td> physical USB path of the SIMtrace2 USB device </td>
</tr>
<tr>
<td> REMSIM_USB_INTERFACE </td>
<td> interface number within the SIMtrace2 USB device </td>
</tr>
<tr>
<td> REMSIM_SIM_VCC </td>
<td> whether or not the SIM card VCC is turned on by modem (1=on, 0=off) </td>
</tr>
<tr>
<td> REMSIM_SIM_RST </td>
<td> whether or not the SIM card RST is active (1) or inactive (0) </td>
</tr>
<tr>
<td> REMSIM_EVENT </td>
<td> the name of the event/request (same as first argument passed to script) </td>
</tr>
</table> osmo-remsim - Feature #4332: call external script from remsim-client to execute specific actionshttps://projects.osmocom.org/issues/4332?journal_id=169122019-12-17T00:19:59Zlaforge
<ul><li><strong>% Done</strong> changed from <i>30</i> to <i>80</i></li></ul><p>actual implementation in <a class="external" href="https://gerrit.osmocom.org/c/osmo-remsim/+/16629">https://gerrit.osmocom.org/c/osmo-remsim/+/16629</a></p> osmo-remsim - Feature #4332: call external script from remsim-client to execute specific actionshttps://projects.osmocom.org/issues/4332?journal_id=175032020-02-19T19:23:22Zlaforge
<ul><li><strong>% Done</strong> changed from <i>80</i> to <i>90</i></li></ul><p>the related patch has meanwhile been merged master. However, FSM state change events are still missing.</p> osmo-remsim - Feature #4332: call external script from remsim-client to execute specific actionshttps://projects.osmocom.org/issues/4332?journal_id=176292020-03-04T21:05:31Zlaforge
<ul><li><strong>Priority</strong> changed from <i>High</i> to <i>Low</i></li><li><strong>% Done</strong> changed from <i>90</i> to <i>80</i></li></ul> osmo-remsim - Feature #4332: call external script from remsim-client to execute specific actionshttps://projects.osmocom.org/issues/4332?journal_id=211082021-02-06T08:51:48Zlaforge
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Resolved</i></li></ul><p>script execution on FSM state changes are not really needed so far, so let's skip that for now until somebody actually comes up with a use case. All other events are implemented.</p> osmo-remsim - Feature #4332: call external script from remsim-client to execute specific actionshttps://projects.osmocom.org/issues/4332?journal_id=224672021-08-24T16:43:15Zdaniel
<ul></ul><p>Looking at the sources no request-sim-local or request-card-remove can ever occur:</p>
<pre>
$ git grep call_script
src/client/main_fsm.c:static int call_script(struct bankd_client *bc, const char *cause)
src/client/main_fsm.c: call_script(bc, "event-server-connect");
src/client/main_fsm.c: call_script(bc, "event-bankd-connect");
src/client/main_fsm.c: call_script(bc, "request-card-insert");
src/client/main_fsm.c: call_script(bc, "request-sim-remote");
src/client/main_fsm.c: call_script(bc, "request-modem-reset");
src/client/main_fsm.c: call_script(bc, "event-config-bankd");
src/client/main_fsm.c: call_script(bc, "event-modem-status");
</pre>
<p>This should at least be pointed out in the docs</p>