https://osmocom.org/https://osmocom.org/favicon.ico?16647414092019-11-08T00:24:00ZOpen Source Mobile CommunicationsDistributed GSM - Feature #4254: integrate mslookup mDNS client in an SMPP handlerhttps://osmocom.org/issues/4254?journal_id=163782019-11-08T00:24:00Zneelsnhofmeyr@sysmocom.de
<ul><li><strong>Priority</strong> changed from <i>Normal</i> to <i>High</i></li></ul> Distributed GSM - Feature #4254: integrate mslookup mDNS client in an SMPP handlerhttps://osmocom.org/issues/4254?journal_id=163872019-11-08T00:40:26Zneelsnhofmeyr@sysmocom.de
<ul></ul> Distributed GSM - Feature #4254: integrate mslookup mDNS client in an SMPP handlerhttps://osmocom.org/issues/4254?journal_id=164542019-11-14T12:16:09Zosmith
<ul></ul><p>There was some confusion about where this should actually be integrated (e.g. besides smpp.py, esme.py was also mentioned). So I've looked RCCN: <a class="external" href="https://github.com/Rhizomatica/rccn">https://github.com/Rhizomatica/rccn</a></p>
This is my understanding:
<ul>
<li>smpp.py and esme.py:
<ul>
<li>connect to OsmoMSC (OpenBSC) on the SMPP port 2775</li>
<li>create a handler for incoming messages</li>
<li>forward these messages in various ways (e.g. smpp.py forwards it to a remote instance of the HTTP server of rapi.py)</li>
</ul>
</li>
<li>rccn.py:
<ul>
<li>chat() is called by freeswitch on incoming SMS</li>
<li>it sends it via HTTP to a local instance of rapi.py to /chat and lets it process in the background</li>
<li>rapi.py: /chat handler starts a new thread, calling receive from sms.py</li>
<li>sms.py receive: filters messages, eventually calls send()</li>
<li>sms.py send: HTTP posts to kannel/remote RAPI server OR sends it to local SMSC listener (-> OsmoMSC!)</li>
</ul></li>
</ul>
<p>For our DGSM/mslookup proof of concept, I will adjust the simple dialplan example we have already created (which resolves calls properly already) to do a simplified version of the rccn code patch towards OsmoMSC:</p>
<pre>
Freeswitch -> dialplan -> mslookup by msisdn, returns SMSC IP/port -> send the message via smpp to the received SMSC IP
</pre>
<p>Sending to SMSC can be done with <a href="https://github.com/podshumok/python-smpplib" class="external">python-smpplib</a>, which RCCN is also using.</p>
<p>The bigger picture then looks like this:<br /><pre>
MS A -> BTS A -> BSC A -> MSC A -> osmo-sip-connector A -> SIP server A -> dialplan A -> mslookup A (HLR B responds with MSC B IP/port) -> MSC B -> ... -> MS B
</pre></p>
<p><a class="user active" href="https://osmocom.org/users/4282">keith</a>: please correct me if I have gotten something wrong.</p> Distributed GSM - Feature #4254: integrate mslookup mDNS client in an SMPP handlerhttps://osmocom.org/issues/4254?journal_id=164572019-11-14T14:24:31Zosmith
<ul></ul><p>Turns out, that osmo-sip-connector does not support forwarding SMS to the SIP server. After talking to Neels, we decided to implement a simple SMPP handler like RCCN's smpp.py.</p> Distributed GSM - Feature #4254: integrate mslookup mDNS client in an SMPP handlerhttps://osmocom.org/issues/4254?journal_id=164592019-11-15T11:46:51Zosmith
<ul><li><strong>% Done</strong> changed from <i>0</i> to <i>80</i></li></ul><p>Implemented a basic smpp handler, based on RCCN's esme.py: osmo-msc.git/contrib/esme_mslookup.py (branch osmith/dgsm).</p>
<p>This forwards (simple, non-multipart etc.) SMS from MSC A to MSC B, and uses osmo-mslookup-client to determine the IP and port of MSC B by the receiver's MSISDN.<br />I'm starting a thread for each incoming message, so the SMPP handler doesn't block until mslookup has answered.</p>
<p>Here is example output, with an extra 10 second sleep after doing the mslookup request:<br /><pre>
$ contrib/esme_mslookup.py --sleep=10
[11:49:58] (MainThread) Connecting to 127.0.0.1:2775...
[11:49:58] (MainThread) Connected to source SMSC (OSMPP@127.0.0.1:2775)
[11:49:58] (MainThread) Waiting for SMS...
[11:50:10] (ForwardSMSThread#0) Thread started
[11:50:10] (ForwardSMSThread#0) mslookup: smpp.sms.100.msisdn
20191115115010729 DLMSLOOKUP ERROR received something that is not a valid mDNS answer, ignoring
[11:50:11] (ForwardSMSThread#0) mslookup result: {"query": "smpp.sms.100.msisdn", "result": "ok", "v4": ["127.0.0.1", "2775"]}
[11:50:11] (ForwardSMSThread#0) Sleeping for 10 seconds
[11:50:16] (ForwardSMSThread#1) Thread started
[11:50:16] (ForwardSMSThread#1) mslookup: smpp.sms.100.msisdn
20191115115016392 DLMSLOOKUP ERROR received something that is not a valid mDNS answer, ignoring
[11:50:17] (ForwardSMSThread#1) mslookup result: {"query": "smpp.sms.100.msisdn", "result": "ok", "v4": ["127.0.0.1", "2775"]}
[11:50:17] (ForwardSMSThread#1) Sleeping for 10 seconds
[11:50:21] (ForwardSMSThread#0) Sleep done
[11:50:21] (ForwardSMSThread#0) Connecting to 127.0.0.1:2775...
[11:50:21] (ForwardSMSThread#0) Connected to destination SMSC (ISMPP@127.0.0.1:2775)
[11:50:21] (ForwardSMSThread#0) Disconnecting...
[11:50:21] (ForwardSMSThread#0) <smpplib.client.Client object at 0x7ff79022bfd0> is disconnecting in the bound state
[11:50:21] (ForwardSMSThread#0) Thread is done
[11:50:23] (ForwardSMSThread#2) Thread started
[11:50:23] (ForwardSMSThread#2) mslookup: smpp.sms.100.msisdn
20191115115023684 DLMSLOOKUP ERROR received something that is not a valid mDNS answer, ignoring
[11:50:24] (ForwardSMSThread#2) mslookup result: {"query": "smpp.sms.100.msisdn", "result": "ok", "v4": ["127.0.0.1", "2775"]}
[11:50:24] (ForwardSMSThread#2) Sleeping for 10 seconds
[11:50:27] (ForwardSMSThread#1) Sleep done
[11:50:27] (ForwardSMSThread#1) Connecting to 127.0.0.1:2775...
[11:50:27] (ForwardSMSThread#1) Connected to destination SMSC (ISMPP@127.0.0.1:2775)
[11:50:27] (ForwardSMSThread#1) Disconnecting...
[11:50:27] (ForwardSMSThread#1) <smpplib.client.Client object at 0x7ff79022bfd0> is disconnecting in the bound state
[11:50:27] (ForwardSMSThread#1) Thread is done
[11:50:34] (ForwardSMSThread#2) Sleep done
[11:50:34] (ForwardSMSThread#2) Connecting to 127.0.0.1:2775...
[11:50:34] (ForwardSMSThread#2) Connected to destination SMSC (ISMPP@127.0.0.1:2775)
[11:50:34] (ForwardSMSThread#2) Disconnecting...
[11:50:34] (ForwardSMSThread#2) <smpplib.client.Client object at 0x7ff79022bda0> is disconnecting in the bound state
[11:50:34] (ForwardSMSThread#2) Thread is done
</pre></p>
<p>In my test setup, the message is arriving twice now at the receiving phone, I'll discuss with Neels what we do about that (might be fine, if used with "no smpp-first" option in osmo-msc.cfg?).</p> Distributed GSM - Feature #4254: integrate mslookup mDNS client in an SMPP handlerhttps://osmocom.org/issues/4254?journal_id=164612019-11-15T11:50:35Zosmith
<ul><li><strong>Assignee</strong> changed from <i>neels</i> to <i>osmith</i></li></ul> Distributed GSM - Feature #4254: integrate mslookup mDNS client in an SMPP handlerhttps://osmocom.org/issues/4254?journal_id=164622019-11-15T11:50:51Zosmith
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li></ul> Distributed GSM - Feature #4254: integrate mslookup mDNS client in an SMPP handlerhttps://osmocom.org/issues/4254?journal_id=164632019-11-15T15:12:45Zosmith
<ul></ul><p>osmith wrote:</p>
<blockquote>
<p>In my test setup, the message is arriving twice now at the receiving phone, I'll discuss with Neels what we do about that (might be fine, if used with "no smpp-first" option in osmo-msc.cfg?).</p>
</blockquote>
<p>This needs to be resolved, I'll look into it.</p> Distributed GSM - Feature #4254: integrate mslookup mDNS client in an SMPP handlerhttps://osmocom.org/issues/4254?journal_id=165042019-11-22T15:23:05Zneelsnhofmeyr@sysmocom.de
<ul></ul><p>osmith wrote:</p>
<blockquote>
<p>osmith wrote:</p>
<blockquote>
<p>In my test setup, the message is arriving twice now at the receiving phone, I'll discuss with Neels what we do about that (might be fine, if used with "no smpp-first" option in osmo-msc.cfg?).</p>
</blockquote>
<p>This needs to be resolved, I'll look into it.</p>
</blockquote>
<p>The duplication is fixed by an osmo-msc patch I8c9b61dc05bda6f2b09cbc1890de1f2702f7abc8<br />IIUC SMS sent out to SMPP will now never be stored in the DB, which means any spooling becomes the task of the SMPP handler...</p> Distributed GSM - Feature #4254: integrate mslookup mDNS client in an SMPP handlerhttps://osmocom.org/issues/4254?journal_id=165612019-11-29T10:01:13Zosmith
<ul><li><strong>% Done</strong> changed from <i>80</i> to <i>90</i></li></ul><p><a class="external" href="https://gerrit.osmocom.org/c/osmo-hlr/+/16204">https://gerrit.osmocom.org/c/osmo-hlr/+/16204</a></p> Distributed GSM - Feature #4254: integrate mslookup mDNS client in an SMPP handlerhttps://osmocom.org/issues/4254?journal_id=174632020-02-17T06:57:52Zosmith
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Resolved</i></li><li><strong>% Done</strong> changed from <i>90</i> to <i>100</i></li></ul>