#!/usr/bin/env python3 import sems_tester import socket class TestBasic(sems_tester.TestCase): _config_base = "basic" _sip_port = 5080 _xmlrpc_port = 8090 def testOptions(self): self.sendRecvSIP( b"""OPTIONS sip:monitoring@voip.sipwise.local SIP/2.0 Via: SIP/2.0/UDP 127.0.0.1:57715;branch=z9hG4bKhedcec8e2a445fd80;rport Max-Forwards: 6 To: From: monit ;tag=8667fc7c8b14e846 Call-ID: 1eb48ca58e6dbdbb CSeq: 63104 OPTIONS Contact: Accept: application/sdp Content-Length: 0 User-Agent: tester/5.33.0 """, b"""^SIP/2.0 200 OK Via: SIP/2\\.0/UDP 127\\.0\\.0\\.1:57715;branch=z9hG4bKhedcec8e2a445fd80;rport=1;received=[\\d.]+ To: ;tag=[A-Z0-9-]+ From: monit ;tag=8667fc7c8b14e846 Call-ID: 1eb48ca58e6dbdbb CSeq: 63104 OPTIONS Content-Length: 0 $""", ) def testXmlRpc(self): self.sendRecvXMLRPC( b""" postDSMEvent sw_audio cmd clearSets sound_sets 1 """, b"""^<\\?xml version="1.0"\\?> faultCode-1faultStringpostDSMEvent: unknown method name $""", ) if __name__ == "__main__": sems_tester.main()