#128 ✓invalid
padwasabi

AMI Parser Syntax Error

Reported by padwasabi | February 24th, 2011 @ 05:10 PM

I was playing around with the AMI connection in a script. I set the events callback to a proc that just puts the events on STDOUT. Then shortly after connecting I started seeing this:

ERROR ami: ADHEARSION'S AMI PARSER ENCOUNTERED A SYNTAX ERROR! PLEASE REPORT THIS ON http://bugs.adhearsion.com!

So I am reporting it hear as requested. Below is a copy of the output. If you have any questions please just email me directly.

irb(main):003:0> @ami.conn.send :establish_events_connection
 INFO ami: Successful AMI events-only connection into mthorley@127.0.0.1
=> [#<Log4r::StdoutOutputter:0xb7c160bc @out=#<IO:0xb7f39564>, @mon_waiting_queue=[], @level=0, @name="stdout", @mon_entering_queue=[], @mon_count=0, @mon_owner=nil, @formatter=#<Log4r::DefaultFormatter:0xb7c154dc @depth=7>>]
irb(main):004:0> logr = _
=> [#<Log4r::StdoutOutputter:0xb7c160bc @out=#<IO:0xb7f39564>, @mon_waiting_queue=[], @level=0, @name="stdout", @mon_entering_queue=[], @mon_count=0, @mon_owner=nil, @formatter=#<Log4r::DefaultFormatter:0xb7c154dc @depth=7>>]
irb(main):005:0> log
NameError: undefined local variable or method `log' for #<Object:0xb7f4394c>
        from (irb):5
irb(main):006:0> logr 
=> [#<Log4r::StdoutOutputter:0xb7c160bc @out=#<IO:0xb7f39564>, @mon_waiting_queue=[], @level=0, @name="stdout", @mon_entering_queue=[], @mon_count=0, @mon_owner=nil, @formatter=#<Log4r::DefaultFormatter:0xb7c154dc @depth=7>>]
irb(main):007:0> #<Adhearsion::VoIP::Asterisk::Manager::ManagerInterfaceEvent:0xb7c93238>
#<Adhearsion::VoIP::Asterisk::Manager::ManagerInterfaceEvent:0xb7c92b58>
#<Adhearsion::VoIP::Asterisk::Manager::ManagerInterfaceEvent:0xb7c92734>
#<Adhearsion::VoIP::Asterisk::Manager::ManagerInterfaceEvent:0xb7c92388>
#<Adhearsion::VoIP::Asterisk::Manager::ManagerInterfaceEvent:0xb7c91fdc>
#<Adhearsion::VoIP::Asterisk::Manager::ManagerInterfaceEvent:0xb7c91c30>
#<Adhearsion::VoIP::Asterisk::Manager::ManagerInterfaceEvent:0xb7c917a8>
#<Adhearsion::VoIP::Asterisk::Manager::ManagerInterfaceEvent:0xb7c913d4>
^C
irb(main):007:0> ERROR ami: ADHEARSION'S AMI PARSER ENCOUNTERED A SYNTAX ERROR! PLEASE REPORT THIS ON http://bugs.adhearsion.com! OFFENDING TEXT:
"\nEvent: Hangup"
ERROR ami: ADHEARSION'S AMI PARSER ENCOUNTERED A SYNTAX ERROR! PLEASE REPORT THIS ON http://bugs.adhearsion.com! OFFENDING TEXT:
"Privilege: call,all"
ERROR ami: ADHEARSION'S AMI PARSER ENCOUNTERED A SYNTAX ERROR! PLEASE REPORT THIS ON http://bugs.adhearsion.com! OFFENDING TEXT:
"Channel: IAX2/0671-3236"
ERROR ami: ADHEARSION'S AMI PARSER ENCOUNTERED A SYNTAX ERROR! PLEASE REPORT THIS ON http://bugs.adhearsion.com! OFFENDING TEXT:
"Uniqueid: 1298584203.51"
ERROR ami: ADHEARSION'S AMI PARSER ENCOUNTERED A SYNTAX ERROR! PLEASE REPORT THIS ON http://bugs.adhearsion.com! OFFENDING TEXT:
"Cause: 19"
ERROR ami: ADHEARSION'S AMI PARSER ENCOUNTERED A SYNTAX ERROR! PLEASE REPORT THIS ON http://bugs.adhearsion.com! OFFENDING TEXT:
"Cause-txt: User alerting, no answer"
#<Adhearsion::VoIP::Asterisk::Manager::ManagerInterfaceEvent:0xb7c8cfb4>
ERROR ami: ADHEARSION'S AMI PARSER ENCOUNTERED A SYNTAX ERROR! PLEASE REPORT THIS ON http://bugs.adhearsion.com! OFFENDING TEXT:
"vent: PeerStatus"
ERROR ami: ADHEARSION'S AMI PARSER ENCOUNTERED A SYNTAX ERROR! PLEASE REPORT THIS ON http://bugs.adhearsion.com! OFFENDING TEXT:
"Privilege: system,all"
ERROR ami: ADHEARSION'S AMI PARSER ENCOUNTERED A SYNTAX ERROR! PLEASE REPORT THIS ON http://bugs.adhearsion.com! OFFENDING TEXT:
"Peer: SIP/0572"
ERROR ami: ADHEARSION'S AMI PARSER ENCOUNTERED A SYNTAX ERROR! PLEASE REPORT THIS ON http://bugs.adhearsion.com! OFFENDING TEXT:
"PeerStatus: Registered"
#<Adhearsion::VoIP::Asterisk::Manager::ManagerInterfaceEvent:0xb7c8bde4>

Comments and changes to this ticket

  • Ben Klang

    Ben Klang March 4th, 2011 @ 11:15 AM

    • Tag set to “ami”
    • Assigned user set to “Ben Klang”

    A few more details please:

    • What version of Asterisk are you running?
    • How did you initialize @ami.conn?

    It's a bit hard to follow the original problem report because the pasted text gets interpreted as formatting. Would you mind editing the original post and wrapping it in "@@@" code blocks? See [Formatting help] for more information.

  • padwasabi

    padwasabi March 4th, 2011 @ 02:20 PM

    My Asterisk server is a Vicidial build

    [root@dialer ~]# asterisk -V Asterisk 1.4.27.1-1 RPM by demian@goautodial.com

    I am initializing my manager connection like so:

    ManagerInterface.class_eval do
      attr_accessor :event_callback
    end
    
    mi = ManagerInterface.connect ({
      :host => "127.0.0.1",
      :username => "user",
      :password => "pass",
      :event_callback => proc {|e| puts e}
    })
    
    @ami = Ami.new(mi)
    IRB.start
    

    FYI: I am not seeing this problem any more. I think that parse just got in a weird state. You can see from the output that in some cases it is missing the first char of the message. For example:

    ERROR ami: ... OFFENDING TEXT:
    "vent: PeerStatus"

  • Ben Klang

    Ben Klang April 9th, 2011 @ 12:35 PM

    • State changed from “new” to “invalid”

    Thanks for the update. If it happens again, please feel free to re-open this ticket. But since it does sound like the parser just got in a weird state for unknown reasons, I'm closing this for now.

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

Tags

Pages