Hi, I need to do a choice between the various Ruby versions (1.8, 1.9,
Rubinius…) and programming models (Reactor Model, Actor Model…) to
a SIP (VoIP) server.
I’ve already started it and for now I’ve done a complete SIP grammar
using TreeTpo parser, but probably I must migrate to Ragel in order to
But what I really don’t see clear is which paradigm and framework to
First of all let me explain something about SIP protocol (which I know
SIP is really complex. Its syntax looks like HTTP, but the protocol
includes various layers and becomes really more difficult than HTTP or
Ufortunatelly I’ll just implement TCP transport (SIP also allows UDP)
anyway it’s remain complex. There are various layers in SIP:
- Transport Layer: receives data (requests or responses) via any socket,
performs a basic parsing and sends the extracted data to the:
- Transaction Layer: Deals with retransmissions of the requests (if no
response was sent in a predefined interval), matches responses against
requests, deal with CANCEL and ACK requests…
- Core Layer: Receives the request/response and handles it (a phone
ring, a SIP proxy would route it, a SIP server would do “something”
There are a lot of timers in all the layers, so if a timer triggers then
full call/dialog/transaction could be discarded (for example).
I’ve already read about various Ruby frameworks to achieve it:
EventMachine: It’s a Reactor Pattern implementation. It’s based on
It could be a solution but it seems that the resulting code would be
pain to debug and not very “visible”. I’ve got a recomendation from an
experimented Ruby coder for non using EventMachine in my project due to
project complexity. It’s actively mantained.
Revactor: It’s an Actor Model implementation. It offers a “like Ruby”
structured programming style. It allows “non-blocking” functions to
as “blocking” so the code is cleaner than using an event based style. It
seems to need Ruby 1.9 (I can wait) and AFAIK it not actively mantained.
Omnibus and Dramatis: More Actor Model implementations in Ruby. Not
they are mantained.
Threads: I could built my application using Threads (“Green” threads
or native threads if I choose JRuby). But I think the above solutions
more ellegant and secure.
I must choose also the Ruby version:
Ruby 1.8 and 1.9: It seems that the garbage collector is not good
I’d would experiment memory issues.
Rubinius: Better garbage collector, but it seems to be not enough
now. It implements a built-in Actor Model. For now it cannot use native
JRuby: Good garbage collector and mature, but not sure if it allows an
Model using “something”.
Well, as you see there are so many posibilities that is really difficult
the choice. Also note that, for now, I’m not an expertised programmer
just know the above concepts because I’ve read about them in my search.
Could I receive a suggestion about it please? Thanks a lot.