Hello,
Recently I’ve been working on setting up my own MMS server for use on my local GSM network. I’m using Mbuni, an old open-source MMS Gateway, that talks to Kannel which connects to osmo-msc through SMPP.
When I set the MMS address to my local server, the phone will connect and successfully send the message. However, since neither the MS nor Mbuni/Kannel know the MSISDN that the message is coming from, it can’t send it to the recipient, since there is no known sender.
In a normal network, the GGSN would send a RADIUS message to a WAP gateway when the PDP Context is created, and the gateway would tack on the MSISDN as a header before forwarding it to the MMS server, so it knew who was sending the message. (see this old thread) This raises my two questions:
For phones who don’t access the internet through WAP(direct HTTP), what part of the network is responsible for attaching on this header with the MSISDN?
Is there any support at all in Osmocom for something like this?
If not, my plan was to make my own intermediate between osmo-ggsn and Mbuni. The only thing known about the sender is the IP Address, which I can find an IMSI for through the list of pdp-contexts in osmo-ggsn, and IMSI can be turned into MSISDN through osmo-hlr. Then I could append the header and complete the request to the MMSC. (Another thing, this might be a step easier if the MSISDNs were known when creating the PDP Context, but when I run ‘show pdp-context ggsn ggsn0’ in osmo-ggsn, the MSISDN is always blank. Is there a way to create PDP Contexts with MSISDN included?)
I can make this own implementation myself, but I just wanted to know if anyone had any input or advice.
Thanks alot!
Oh, interesting topic. Please tell us a bit more about your journey, that’s a topic I’ve wanted to play with as well.
With both WAP gateway and also just plain TCP/IP HTTP, I’d imagine you’d have to touch the HTTP traffic itself with some form of DPI.
Maybe a proxy like Squid could be made to do this job with some custom code?
Hello, here’s where I’ve gotten so far:
In Mbuni, I’ve added an external interface to some local HTTP server, that in theory should take an IP address as input, then contact osmo-sgsn to turn IP address into IMSI(subscriber-list-active-v1 in osmo-sgsn’s control interface should contain this information), then gets MSISDN from the IMSI and sends it back in the HTTP body. It’s very crude, and I haven’t written the actual interface to osmocom yet, for now it is hardcoded to send back the MSISDN of one of my phone’s I’m using for testing.
And surprisingly, it’s working! Obviously only outbound messages from that one hard-coded phone will send, but after a bit of restoration work to Mbuni’s code, I’ve gotten images and SMIL to send.
My next step is to actually write that IP->IMSI->MSISDN program Mbuni talks to. But it’s a good start so far. Also, some older phones use a WAP gateway to send MMS which works a little bit differently from what I’ve read(see WAP Push), which is something I want to test if I get my hands on one of those old phones.
I’ll keep this thread updated with progress. Here’s some pictures:
As you will have noted, Osmo-GGSN doens’t support Radius - and AFAICT, that kind of radious message generation was always just an optional add-on feature for a GGSN.
You might get further if you’d use open5gs-pgw, which also contains (osmocom-contributed) GGSN support. With some luck it has the related interface (for accounting or whatever) generating messages at PDP context activation/deactivation via diameter. You’d then have to translate diameter to radius if you’d want the old rasius messages for the MMS gateway. Or you could hack up diameter support directly in the MMS gateway?
Another approach might be ergw (erlang gateway). I think it natively supports radius -but I’m not sure which specific interface and procedures/messages are implemented.
Last, but not least: Radius is a super easy protocol over UDP. It might actually be not too comprehensive to add generating a fire-and-forget UDP packet with the right information bits at the time of PDP context activation…
Thanks for your input! The open5gs diameter interface might help me out a bit. I did figure out that adding auth-policy remote in osmo-sgsn will get the subscriber MSISDN from osmo-hlr and create the PDP context with it. I also was able to install a couple of components from the open5gs stack to try to start a GGSN, and it looks like osmocom is interfacing with it, and I can see (open5gs-upfd? this was a couple of days ago) making Diameter formatted requests with the subscriber IP address and MSISDN, but one of the other components is crashing(I think because the rest of the open5gs stack is completely missing).
I think it would probably be easiest to hack in a Diameter interface into Mbuni at this point, also because most more modern phones don’t go through a WAP gateway like Kannel(that uses RADIUS to append the MSISDN) to access MMS services, and rather access it directly through HTTP. Mbuni doesn’t have support for RADIUS or Diameter at all, so it would need to have some interface programmed in to get MSISDNs without a WAP Gateway in either case.
Thanks for pointing me in the right direction, I’ll try to work on a Dockerized MMS server based on the open5gs stack and Mbuni to save people the pain of compiling it.
Got the open5gs GGSN implementation working with osmocom. Now the hard part… programming a diameter interface to open5gs into the MMS Gateway. Hopefully I can use freeDiameter so I don’t have to start from scratch