本文整理汇总了C++中Endpoint::libDestroy方法的典型用法代码示例。如果您正苦于以下问题:C++ Endpoint::libDestroy方法的具体用法?C++ Endpoint::libDestroy怎么用?C++ Endpoint::libDestroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Endpoint
的用法示例。
在下文中一共展示了Endpoint::libDestroy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mainProg3
void mainProg3() throw(Error)
{
Endpoint ep;
// Create library
ep.libCreate();
// Init library
EpConfig ep_cfg;
ep.libInit( ep_cfg );
// Start library
ep.libStart();
std::cout << "*** PJSUA2 STARTED ***" << std::endl;
// Create player and recorder
{
AudioMediaPlayer amp;
amp.createPlayer("../../tests/pjsua/wavs/input.16.wav");
AudioMediaRecorder amr;
amr.createRecorder("recorder_test_output.wav");
amp.startTransmit(ep.audDevManager().getPlaybackDevMedia());
amp.startTransmit(amr);
pj_thread_sleep(5000);
}
ep.libDestroy();
}
示例2: main
int main()
{
int ret = 0;
Endpoint ep;
try {
ep.libCreate();
mainProg3(ep);
ret = PJ_SUCCESS;
} catch (Error & err) {
std::cout << "Exception: " << err.info() << std::endl;
ret = 1;
}
try {
ep.libDestroy();
} catch(Error &err) {
std::cout << "Exception: " << err.info() << std::endl;
ret = 1;
}
if (ret == PJ_SUCCESS) {
std::cout << "Success" << std::endl;
} else {
std::cout << "Error Found" << std::endl;
}
return ret;
}
示例3: mainProg
void mainProg() throw(Error)
{
Endpoint ep;
// Create library
ep.libCreate();
string json_str;
{
JsonDocument jdoc;
AccountConfig accCfg;
accCfg.idUri = "\"Just Test\" <sip:[email protected]>";
accCfg.regConfig.registrarUri = "sip:pjsip.org";
SipHeader h;
h.hName = "X-Header";
h.hValue = "User header";
accCfg.regConfig.headers.push_back(h);
accCfg.sipConfig.proxies.push_back("<sip:sip.pjsip.org;transport=tcp>");
accCfg.sipConfig.proxies.push_back("<sip:sip.pjsip.org;transport=tls>");
accCfg.mediaConfig.transportConfig.tlsConfig.ciphers.push_back(1);
accCfg.mediaConfig.transportConfig.tlsConfig.ciphers.push_back(2);
accCfg.mediaConfig.transportConfig.tlsConfig.ciphers.push_back(3);
AuthCredInfo aci;
aci.scheme = "digest";
aci.username = "test";
aci.data = "passwd";
aci.realm = "*";
accCfg.sipConfig.authCreds.push_back(aci);
jdoc.writeObject(accCfg);
json_str = jdoc.saveString();
std::cout << "Original:" << std::endl;
std::cout << json_str << std::endl << std::endl;
}
{
JsonDocument rdoc;
rdoc.loadString(json_str);
AccountConfig accCfg;
rdoc.readObject(accCfg);
JsonDocument wdoc;
wdoc.writeObject(accCfg);
json_str = wdoc.saveString();
std::cout << "Parsed:" << std::endl;
std::cout << json_str << std::endl << std::endl;
}
ep.libDestroy();
}
示例4: mainProg2
void mainProg2() throw(Error)
{
Endpoint ep;
// Create library
ep.libCreate();
string json_str;
{
EpConfig epCfg;
JsonDocument jDoc;
epCfg.uaConfig.maxCalls = 61;
epCfg.uaConfig.userAgent = "Just JSON Test";
epCfg.uaConfig.stunServer.push_back("stun1.pjsip.org");
epCfg.uaConfig.stunServer.push_back("stun2.pjsip.org");
epCfg.logConfig.filename = "THE.LOG";
jDoc.writeObject(epCfg);
json_str = jDoc.saveString();
std::cout << json_str << std::endl << std::endl;
}
{
EpConfig epCfg;
JsonDocument rDoc;
string output;
rDoc.loadString(json_str);
rDoc.readObject(epCfg);
JsonDocument wDoc;
wDoc.writeObject(epCfg);
json_str = wDoc.saveString();
std::cout << json_str << std::endl << std::endl;
wDoc.saveFile("jsontest.js");
}
{
EpConfig epCfg;
JsonDocument rDoc;
rDoc.loadFile("jsontest.js");
rDoc.readObject(epCfg);
pj_file_delete("jsontest.js");
}
ep.libDestroy();
}