I’m using ruby and the switchvox gem to pull data from an Asterisk box.
I’m having a little trouble with the response I get back for the
switchvox.callQueues.getCurrentStatus method call. I’m trying to pull
the waiting_callers info from the response (seen below in the response
as an object in the response object). No problem pulling the other info.
The gem requests and returns a json response. I’m not having much luck
accessing/parsing it. Am I missing something obvious?
I’m using ruby and the switchvox gem to pull data from an Asterisk box.
I’m having a little trouble with the response I get back for the
switchvox.callQueues.getCurrentStatus method call. I’m trying to pull
the waiting_callers info from the response (seen below in the response
as an object in the response object). No problem pulling the other info.
The gem requests and returns a json response. I’m not having much luck
accessing/parsing it. Am I missing something obvious?
This is parsed already. Why are you asking how to parse this?
Ok, I got a response from the Vendor on the API. The object that I
couldn’t parse needed to be accessed as follows. The @waiting_callers
object is sometimes returned as an Array or Hashes, a Hash, or an empty
Object. That’s messed up, but anyway…
Thanks again for your response…
count = cq.waiting_callers.waiting_caller.length
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.