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

UnexpectedValueExceptionParse error, no colon in line "ReportBlock:" found #28

Closed
wants to merge 3 commits into from

Conversation

bonan
Copy link
Contributor

@bonan bonan commented Mar 9, 2016

Fixes:

UnexpectedValueExceptionParse error, no colon in line "ReportBlock:" found
In vendor/clue/ami-react/src/Protocol/Parser.php at line 55
Connection closed

When receiving (| is newline):

# ngrep -tqW byline -P '|' -d lo '' port 5038
interface: lo (127.0.0.0/255.0.0.0)
filter: (ip or ip6) and ( port 5038 )

T 2016/03/09 12:23:26.957583 127.0.0.1:5038 -> 127.0.0.1:38165 [AP]
Event: RTCPSent|
Privilege: reporting,all|
To: x.x.x.x:yyyy|
OurSSRC: 2070743128|
SentNTP: 1457522606.3921813504|
SentRTP: 7119840|
SentPackets: 44499|
SentOctets: 7119840|
ReportBlock:|
FractionLost: 0|
CumulativeLoss: 0|
IAJitter: 0.0003|
TheirLastSR: 2251224312|
DLSR: 0.0000 (sec)|
|

Asterisk version: 1.8.32.3

tests/Protocol/ParserText.php: Add test for empty values
@clue
Copy link
Owner

clue commented May 20, 2016

Thanks for spotting and filing this PR @bonan! 👍

This is an interesting find! Does Asterisk always send this format for empty values or is this some kind of special handling?

Either way, we should consider if this is a valid value at all, an empty string or null. Also, how should we serialize a message in return, i.e. when sending a similar message towards AMI?

@bonan
Copy link
Contributor Author

bonan commented May 27, 2016

It seems like the formatting is set where the event is emitted. See:
asterisk/asterisk@d0a55fa#diff-a618fa70209ab9240777e52ccf1d62b4L2418

Since the commit above (which is merged to at least *12 and later) the RTCPReceived/Sent events will no longer have the empty ReportBlock line.

When setting it to an empty string I looked at what the library would return if the string was "ReportBlock: " and replicated that.

@enniel
Copy link

enniel commented Jun 29, 2016

I have this error with empty line. Example:
\r\nEvent: DongleNewSMSBase64\r\nPrivilege: call,all\r\nDevice: modem1\r\nFrom: +79159150663\r\nMessage: KipTVEFUVVMqKiBEZWxpdmVyZWQgTWVzc2FnZSB0byA3OTE1OTE1MDY2MyBkZWxpdmVyZWQgYXQgMjkuMDYuMTYgMTA6Mg==
First line is empty.
["","Event: DongleNewSMSBase64","Privilege: call,all","Device: modem1","From: +79159150663","Message: KipTVEFUVVMqKiBEZWxpdmVyZWQgTWVzc2FnZSB0byA3OTE1OTE1MDY2MyBkZWxpdmVyZWQgYXQgMjkuMDYuMTYgMTA6Mg=="]

@clue
Copy link
Owner

clue commented Jun 29, 2016

It seems like the formatting is set where the event is emitted. See:
asterisk/asterisk@d0a55fa#diff-a618fa70209ab9240777e52ccf1d62b4L2418

Wow, much appreciated, thanks @bonan 👍 I've just filed #29 which builds on top of this PR. Do you care to review this so we can get this in? Thanks!

I have this error with empty line.

Thanks for spotting @enniel! I'm not sure I follow and this looks unrelated to this PR, can you file a new issue? Thanks!

Support parsing messages with missing space after colon
@clue
Copy link
Owner

clue commented Jun 29, 2016

Merged via #29 👍

@clue clue closed this Jun 29, 2016
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

Successfully merging this pull request may close these issues.

3 participants