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

'utf-8' codec can't decode byte #3

Closed
firkeuf opened this issue Nov 14, 2016 · 2 comments
Closed

'utf-8' codec can't decode byte #3

firkeuf opened this issue Nov 14, 2016 · 2 comments

Comments

@firkeuf
Copy link

firkeuf commented Nov 14, 2016

Hello

If set up event listener, some time, on console received error

'utf-8' codec can't decode byte 0xd0 in position 1023: unexpected end of data

and listener stop working

I try find why and find that it came from here -> here

Example of byte received from asterisk:
b'Local/+38097XXXXXXX@corp-00000014;2\r\nContext: macro-out_roundrobin_gateway\r\nExtension: s\r\nPriority: 2\r\nApplication: Set\r\nAppData: GO_COUNT=0\r\nUniqueid: 1479133224.1443\r\n\r\nEvent: VarSet\r\nPrivilege: dialplan,all\r\nTimestamp: 1479133224.599046\r\nChannel: Local/+38097XXXXXXX@corp-00000014;2\r\nVariable: GO_COUNT\r\nValue: 0\r\nUniqueid: 1479133224.1443\r\n\r\nEvent: VarSet\r\nPrivilege: dialplan,all\r\nTimestamp: 1479133224.599134\r\nChannel: Local/+38097XXXXXXX@corp-00000014;2\r\nVariable: MACRO_DEPTH\r\nValue: 1\r\nUniqueid: 1479133224.1443\r\n\r\nEvent: VarSet\r\nPrivilege: dialplan,all\r\nTimestamp: 1479133224.599360\r\nChannel: Local/+38097XXXXXXX@corp-00000014;2\r\nVariable: DB_RESULT\r\nValue: 2\r\nUniqueid: 1479133224.1443\r\n\r\nEvent: Newexten\r\nPrivilege: dialplan,all\r\nTimestamp: 1479133224.599928\r\nChannel: Local/+38097XXXXXXX@corp-00000014;2\r\nContext: macro-out_roundrobin_gateway\r\nExtension: s\r\nPriority: 3\r\nApplication: NoOp\r\nAppData: -- \xd0\x93\xd0\xa0\xd0\xa3\xd0\x9f\xd0\x9f\xd0\x90 Kharkiv \xd0\xb1\xd1\x83\xd0\xb4\xd0\xb5\xd1\x82\xd1\x8c \xd0\xbf\xd1\x8b\xd1\x82\xd0\xb0\xd1\x82\xd1\x8c\xd1\x81\xd1\x8f \xd0\x97\xd0\x92\xd0\x9e\xd0\x9d\xd0\x98\xd0\xa2\xd0\xac \xd0\xbd\xd0\xb0 +38097XXXXXXX\xd1\x87\xd0\xb5\xd1\x80\xd0\xb5\xd0\xb7 LINEOUTKS \xd0\xbb\xd0'

@ettoreleandrotognoli
Copy link
Owner

I will think about your suggestion
I believe this error was caused because decode was called on a segment of packet not on a full packet, the solution was committed in dev branch fd54936

@firkeuf
Copy link
Author

firkeuf commented Nov 15, 2016

Yes it works
Thank You

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