Skip to content

Sending Status action with multiple variables only shows one Variable value. #42

@ssether-usinternet

Description

@ssether-usinternet

The Asterisk Status command allows you to send multiple requests for channel variables, separated by commas. So something like this sent to the AMI console:

Action: Status
ActionID: 2
Variables: CDR(ds_type),from_user,companyID

Returning something like this:

Event: Status
 (irrelevant details removed)
Variable: CDR(ds_type)=Test-INT
Variable: from_user=ssether
Variable: companyID=Test
ActionID: 2

When I use RubyAMI to do this, I only get only one of the Variables in the repsonse

      def status(variables="")
        headers = { 'Variables' => variables }
        return @ami.send_action('status', headers)
      end

response = status('CDR(ds_type),from_user,companyID')
puts response.events[0].headers

returns a map, but with only one value in the map for Variable:

{ (irrelevant details removed)
"CallerIDNum"=>"123", "CallerIDName"=>"Steve Sether", "ConnectedLineNum"=>"124", "Variable"=>"companyID=Test", "ActionID"=>"898b7636-3d99-40d3-aaa2-bd955fa920c1"}

I'd expect the Variable key to itself contain a map with key/values. Instead it returns just a single String value "companyID=Test". I expect when this was designed, multiple headers with the same key weren't taken into account.

I did try briefly to fix this myself, but quickly realized the lexer took more effort in understanding that I wanted to try to understand in an hour or two.

Is there some way to get this to work properly (i.e. I'm using the send_action command or the resultant response incorrectly), or is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions