Holger Hans Peter Freyther's blog
The last couple of days, to some degree weeks I was implementing a SIP stack for GNU Smalltalk to be used in my Smalltalk GSM project. The first time I encountered SIP was around 2001 when we were excited to run a SIP Phone on our Linux powered iPAQs (Linphone on Opie).
For Smalltalk I started with looking at SipStack by Frank Shearar (who was very responsive to questions regarding his code and SIP in general). The main problem was that his stack was incomplete and as usual it is difficult to pick things up without knowing SIP and not knowing where the code was heading.
For the SS7/GSM work I am doing I have to implement dialogues with other systems and by default the IO in a lightweight process in Smalltalk is blocking (built on top of SIGIO). My problem is that a remote system could make me wait for a response forever. I am not an experienced Smalltalker yet but the existing options didn't look good enough (which might be me being unexperienced). I looked into what is required to add a #timeout:do: to the BlockClosure. The idea is to run the dialogue in a very straight forward way and guard the whole operation with a Timeout.
self waitForResponseOfKind: ABC.
] timeout: 10 do: ['The operation timed out... cleanup']
I am working on GSM/SS7 protocol implementation on and off for a bit. The current modules can be found in these git repositories.
Right now I am working on parsing and creating ISDN User Part (ISUP) messages and the general question of how to express on-wire messages composed from mandantory, variable and optional fields (class based vs. instance based). For now I am using a class based approach as this allows me to have field decoding/encoding inside these classes but I am not sure if this is the best way and will keep on exploring it.
I started to play with smalltalk somewhere in February, more specific with the GNU Smalltalk implementation. Like it is with any new language and class library it takes a while to get productive and it took me until somewhere the last month where I finally started to do GSM handling in Smalltalk and thanks to laf0rge the code is now in a public repository and hosted along the other Osmocom projects. You can see all the subprojects over here.
On and off the last couple of weeks I have ported PetitParser to GNU Smalltalk. I am still a Smalltalk newbie and it was a nice learning experience and it helped me to improve the way I code on GNU Smalltalk and to learn more about GNU Smalltalk and ANSI Smalltalk.
To load the PetitParser.star one can type:
To load the PetitParser.star into the image do:
PackageLoader fileInPackage: 'PetitParser'
There are some differences between the real PetitParser and this port. GNU Smalltalk does not support binary selectors that have more than two charachters. This means that
>=> had to be mapped to something else. I have picked
>< for now.