Please login or register to access secure site features.

Note: By continuing to use DevConnect Program Services you agree to our latest Registered Member Terms.

Sign in using DevConnect ID

Forgot password?

Trouble logging in?

Submit a ticket for Registration Support.

I have an SSO ID

?
sign in

Don't have a DevConnect or SSO ID ?

Create a DevConnect account or join the program.

register now
^
New DevConnect members must have forum permissions in order to post messages.
If the Reply and New Post buttons are not available to you, please request access using a General Support request ticket.
Forum Index » Web Services » MTCTI3 and Python   XML
 
Author Message
graindepoivre



Joined: 28/05/2021 10:19:40
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

This message was edited 3 times. Last update was at 31/05/2021 02:12:35

JohnBiggs



Joined: 20/06/2005 14:06:52
Messages: 883
Location: Thornton, CO
Offline

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.
[WWW]
 
 
Go to: