linphone打电话

bool call(CString sip)
{
if (sip.IsEmpty()) return false;

char* normalizedUserName = NULL;

LinphoneProxyConfig* proxyCfg = NULL;
//get default proxy
linphone_core_get_default_proxy(the_core, &proxyCfg);

if (proxyCfg != NULL) {
normalizedUserName = linphone_proxy_config_normalize_phone_number(proxyCfg, sip.GetString());
const char * uri = linphone_core_get_identity(the_core);
LinphoneAddress* tmpAddress = linphone_address_new(uri);
linphone_address_set_username(tmpAddress, normalizedUserName);
linphone_address_set_display_name(tmpAddress, "libsipua3");
const char *url = linphone_address_as_string(tmpAddress);
m_linphoneCall = linphone_core_invite(the_core, url);
linphone_address_destroy(tmpAddress);
}
return true;
}

posted @ 2017-12-28 16:58  出来打酱油  阅读(374)  评论(0编辑  收藏  举报