Author Message
graindepoivre
Joined: May 28, 2021
Messages: 1
Offline
Hi,

I'm trying to use MTCTI3 to link my server application with an IPOffice.
With Python and websocket-client library I'm connected and authenticated.
But when I try to send data SysMon returns "Unknown Type : " followed by an Integer.

It seems that I send Data in wrong format.
Should I send data in binary or text mode?
What's wrong with my code



import websocket
#Definition File generated from proto file
import ipo_mtcti3_pb2

# Connecting to websocket
wsocket = websocket.WebSocketApp(
"wss//my.ipo.addr/tpkt/openapi",
on_message=on_message,
on_open=on_open,
on_error=on_error,
on_close=on_close,
header={
"Authorization: Basic base64_encoded_credentials",
"Sec-WebSocket-Protocol: openapi"
}
)

wst = threading.Thread(target=wsocket.run_forever, kwargs={'sslopt': {"cert_reqs": ssl.CERT_NONE}})
wst.daemon = True
wst.start()

# Trying to subscribe
subscribe_lines = ipo_mtcti3_pb2.SubscribeLines()
subscribe_lines.flags = 7

subscribe_msg = ipo_mtcti3_pb2.Subscribe()
subscribe_msg.requestid = 1
subscribe_msg.subscribe_id = 1
subscribe_msg.timeout = 3600
subscribe_msg.lines.CopyFrom(subscribe_lines)

message = ipo_mtcti3_pb2.Message()
message.subscribe.CopyFrom(subscribe_msg)

self.send_message(message.SerializeToString())


Thanks
JohnBiggs
Joined: Jun 20, 2005
Messages: 1136
Location: Rural, Virginia
Online
This forum is for questions related to Applications Enablement Services related web services, not IP Offices. IP Office support is provided through technical tickets to higher level DevConnect members.
Go to:   
Mobile view