Making my Osmocom Smalltalk packages available for Pharo
In the last two years I have developed some Smalltalk packages that help me with (mobile) communication related tasks and I began making them available for Pharo as well. I'm using the gst-convert utility to do the conversion and the goal is to have this work as automatically as possible.
- OsmoLogging is another logging framework modeled after the framework we developed for C. Besides having multiple backends (Transcript, syslog) and log levels there are some unique features.
One can attach log context to the current process. E.g. the data that is parsed, or the end-user that initiated this process. This can be used in the exception logger to provide more context, dump the raw message that might have caused the exception. But it can also be used by log filters, e.g. only show log messages that are related to a specific user.
The other feature is the concept of log categories. Each log message is tagged with a category and the category and backend can be decide if that category is enabled and what the default log level should be.
- OsmoCore is a collection of utility classes. Currently there is a class to schedule a callback in a couple of seconds. This is done to avoid to have thousands of processes that do
[(Delay forSeconds: 1) wait. self cancel] fork. The other class allows me to dispatch a block from a central context. This is done to avoid dealing with deadlocks. I have opted for this solution as having lock hierarchies between different stacks (MGCP, SIP) is very difficult. I am considering building a mailbox like system for these stacks. That means each subsystem would have its own dispatcher.
- OsmoNetwork is a collection of network related utility classes. They help me working with sockets and provide some encoding/decoding classes for SCCP, ISUP, M2UA. This code is the oldest and some parts could make better use of Streams.
- OsmoSIP contains most of the SIP grammar described using PetitParser and code to create SIP Dialogs, deal with re-transmission.
- OsmoMGCP contains most of the MGCP grammar described using PetitParser and code to create MGCP Transactions, deal with the re-transmission.
- OsmoGSM contains classes related to the GSM specification 04.08 and 08.08. I can easily create and parse the wire messages for this specification.
This code is complete enough to run mobile communication applications 24/7. It is my first work in Smalltalk though, this means there are various things that can be done better and cleaning up and re-factoring is a continuous process. The OsmoCore and OsmoLogging package is now available for Pharo and I am in the process of porting the OsmoNetwork package.