Fix ClassCastException in parseInteger when value is a List#794
Fix ClassCastException in parseInteger when value is a List#794phoneben wants to merge 1 commit into
Conversation
…ue is a List When Asterisk sends a duplicate field (e.g. channelstate) in a StatusEvent, the parser collects the values into an ArrayList. parseInteger(), parseDouble() and parseLong() blindly cast the value to String causing a ClassCastException that kills the AMI connection. Fixed by adding List handling consistent with the existing parseString() method. Resolves asterisk-java#793
|
What is a |
|
|
You didn’t answer the question. What module emits it? |
|
I'm not a Java developer. From the stack trace I can see it's org.asteriskjava.manager.event.StatusEvent and the field is channelstate. I assume it maps to the AMI Status event by convention but I'm not 100% certain which Asterisk module emits it. |
|
parseDouble/parseLong was not delt as i want first to make sure i was correct |
|
Can you provide the contents of the problematic |
|
Not from the current log, unfortunately. The log only captured the asterisk-java parser failure:
So I can confirm that asterisk-java received duplicate |
|
@seanbright can it be a private parser sending in wrong formatted request ? |
|
@seanbright you where correct the issue look like underlying parser closing this for now |
When Asterisk sends a duplicate field (e.g. channelstate) in a StatusEvent,
the parser collects the values into an ArrayList. parseInteger()
blindly cast the value to String causing a ClassCastException
that kills the AMI connection.
Fixed by adding List handling consistent with the existing parseString() method.
Resolves #793