Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Privilege: dialplan,all
Channel: SIP/test
ChannelState: 4
ChannelStateDesc: Ring
CallerIDNum: 0055551234
CallerIDName: 0055551234
ConnectedLineNum:
ConnectedLineName:
Language: en
Context: income-call
Exten: test
Priority: 4
Uniqueid: 1444884710.0
Variable: CALL_ID
Value: 5aeb879d-753e-48f2-92da-22ae0653cee8
""".replace("\n", utils.EOL)
def test_message_from_message():
message = Message({"Uniqueid": "1444884710.0"})
wrapper = MessageWrapper(message)
assert wrapper.uniqueid == "1444884710.0"
assert wrapper.keyid == "1444884710"
def test_message_from_text():
wrapper = MessageWrapper(MESSAGE)
assert wrapper.uniqueid == "1444884710.0"
assert "language" in wrapper
assert wrapper.language == "en"
assert wrapper["language"] == "en"