#15 ✓resolved
ronin-9952 (at lighthouseapp)

ami strips line separators from raw command output

Reported by ronin-9952 (at lighthouseapp) | November 20th, 2007 @ 12:23 PM

ami strips line separators from mulit-line command responses. Without line separations, the ugly data returned by most asterisk commands is nearly unparsable.

wwalker@elephant:~/ami$ cat t3.rb

require 'rubygems'

require 'adhearsion'

require 'adhearsion/voip/asterisk/ami'

@ami = Adhearsion::VoIP::Asterisk::AMI.new "wwalker", "purple", "dlsacs01", :port => 5038, :events => true

@ami.connect!

resp = @ami.command :Command => "core show channels verbose"

p resp[0][:raw]

wwalker@elephant:~/ami$ ruby t3.rb

"Channel Context Extension Prio State Application Data CallerID Duration Accountcode BridgedTo 0 active channels0 active calls"

wwalker@elephant:~/ami$

The results should have had 3 \n's

"Channel Context Extension Prio State Application Data CallerID Duration Accountcode BridgedTo \n0 active channels\n0 active calls\n"

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

People watching this ticket

Pages