我正在尝试开发一个提供Audio
和Video
调用的应用程序,现在我正在关注baresip
相同的库。
我在按钮 Click 上写了以下代码:
@IBAction func btnCallClick(_ sender: Any) {
guard libre_init() == 0 else { return }
// Initialize dynamic modules.
mod_init()
// Make configure file.
if let path = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first {
conf_path_set(path)
}
guard conf_configure() == 0 else { return }
// Initialize the SIP stack.
guard baresip_init(conf_config(), 0) == 0 else { return }
guard ua_init("SIP", 1, 1, 1, 0) == 0 else { return }
// Load modules.
guard conf_modules() == 0 else { return }
let addr = "sip:101@xxx.xxx.com:port;auth_pass=aaaa;transport=udp;answermode=auto"
// Start user agent.
guard ua_alloc(&agent, addr) == 0 else { return }
// Make an outgoing call.
guard ua_connect(agent, nil, nil, "sip:100@xxx.xxx.com", VIDMODE_OFF) == 0 else { return }
// Start the main loop.
re_main(nil)
}
现在,我从一台设备接到另一台设备的电话,但它挂起我的视图,为什么它是挂起的视图?我花了很多时间,有人可以帮助我吗?