我正在使用linphone 3.9
我尝试通过更改SipTransprts中的端口来更改默认端口 但仍然是5060仍然是默认值 我的问题如何在Linphone lib python中更改udp和tcp的默认端口?
core = linphone.Core.new(callbacks, None, None)
address = linphone.Address.new("sip:"+username+"@"+domain)
address.username = username
address.port =random.randint(5063,6060)
print address.port
proxy_cfg = core.create_proxy_config()
proxy_cfg.identity_address = address
proxy_cfg.server_addr = "<sip:"+domain+">"
authInfo = core.create_auth_info(username, None, password, None, None, domain);
core.add_auth_info(authInfo)
proxy_cfg.register_enabled = True
core.add_proxy_config(proxy_cfg)
tp = core.sip_transports
tp.tcp_port=1011
tp.tls_port=1012
tp.udp_port=1013
print '0000000000000000000000000000000000000000'
print core.sip_transports.udp_port
print '0000000000000000000000000000000000000000'
#print 5060
答案 0 :(得分:0)
tp = core.sip_transports
tp.tcp_port=1011
tp.tls_port=1012
tp.udp_port=1013
core.sip_transports = tp
基本上,这是一个“指针问题”。例如,在tp = core.sip_transports中,您要为core.sip_transport分配默认值(即5060)。然后进行复制,然后重新分配值。您无法直接更改sip_transport值。