Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ssether-usinternet opened this issue Jul 5, 2018 · 1 comment

Comments

@ssether-usinternet
Copy link

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?

@benlangfeld
Copy link
Member

You are correct that multiple headers with the same name are not currently supported. Someone will need to contribute that support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants