DLR and IronRuby updated

I’ve just updated the IronRuby and DLR (Microsoft Dynamic Language Runtime) on the sipsorcery.com Application Servers. I’m interested to see if there is any change in the memory leak behaviour. As far as other changes go I hope there aren’t any changes that break anybody’s dialplans and I’m not expecting there to be. One benefit I noticed was that the conversion between .Net and Ruby types is now seamless so no more need for to_s and to_i when moving between them.

As an example the snippet that didn’t previously work now does.

if req.URI.User =~ /300/
  sys.Log("The monkeys are on the way.")
end
  1. Mike Telis’s avatar

    I wouldn’t recommend to get rid of to_s, because there still are situations where it fails. Here is an example:

    @num = req.URI.User
    @num.gsub!(/s*/,”)
    sys.Log(“After gsub!”)

    It results in the following error:

    DialPlan 21:48:47:496: There was an exception executing your dial plan script: Mutating method `gsub!’ called for an immutable string (System::String)
    DialPlan 21:48:47:840: Dial plan execution completed without answering and had an execution error message of Dial plan exception.

    I wouldn’t call this behavior “seemless” and prefer to keep my to_s for now.

    Reply

    1. sipsorcery’s avatar

      Nice spot. I guess there are still some battles going on with how to handle the conversion between .Net’s immutable string and the Ruby mutable one. Still it’s nice that at least in some straightforward situations it does now work.

      Reply

Reply

Your email address will not be published. Required fields are marked *