本文整理汇总了C++中Endpoint::libInit方法的典型用法代码示例。如果您正苦于以下问题:C++ Endpoint::libInit方法的具体用法?C++ Endpoint::libInit怎么用?C++ Endpoint::libInit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Endpoint
的用法示例。
在下文中一共展示了Endpoint::libInit方法的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: prm
static void mainProg1() throw(Error)
{
Endpoint ep;
// Create library
ep.libCreate();
// Init library
EpConfig ep_cfg;
ep_cfg.logConfig.level = 4;
ep.libInit( ep_cfg );
// Transport
TransportConfig tcfg;
tcfg.port = 5060;
ep.transportCreate(PJSIP_TRANSPORT_UDP, tcfg);
// Start library
ep.libStart();
std::cout << "*** PJSUA2 STARTED ***" << std::endl;
// Add account
AccountConfig acc_cfg;
acc_cfg.idUri = "sip:[email protected]";
acc_cfg.regConfig.registrarUri = "sip:pjsip.org";
acc_cfg.sipConfig.authCreds.push_back( AuthCredInfo("digest", "*",
"test1", 0, "test1") );
std::auto_ptr<MyAccount> acc(new MyAccount);
acc->create(acc_cfg);
pj_thread_sleep(2000);
// Make outgoing call
Call *call = new MyCall(*acc);
acc->calls.push_back(call);
CallOpParam prm(true);
prm.opt.audioCount = 1;
prm.opt.videoCount = 0;
call->makeCall("sip:[email protected]", prm);
// Hangup all calls
pj_thread_sleep(8000);
ep.hangupAllCalls();
pj_thread_sleep(4000);
// Destroy library
std::cout << "*** PJSUA2 SHUTTING DOWN ***" << std::endl;
}
示例3: handleEndpoint
void MyCppinterface::handleEndpoint()
{
int ret = 0;
Endpoint ep;
// create
try {
ep.libCreate();
} catch (Error & err) {
cout << "Exception: " << err.info() << endl;
ret = 1;
}
// init
EpConfig ep_cfg;
ep_cfg.logConfig.level = 5;
ep_cfg.uaConfig.maxCalls = 4;
// ep_cfg.mediaConfig.sndClockRate = 16000;
try {
ep.libInit(ep_cfg);
} catch (Error &err) {
cout << "Initialization error: " << err.info() << endl;
}
// config
try {
TransportConfig tcfg;
tcfg.port = 5060;
TransportId tid = ep.transportCreate(PJSIP_TRANSPORT_UDP, tcfg);
cout << "tid is----" << tid << endl;
} catch(Error& err) {
cout << "Transport creation error: " << err.info() << endl;
}
// start
try {
ep.libStart();
} catch(Error& err) {
cout << "Startup error: " << err.info() << endl;
}
}
示例4: throw
static void mainProg3(Endpoint &ep) throw(Error)
{
const char *paths[] = { "../../../../tests/pjsua/wavs/input.16.wav",
"../../tests/pjsua/wavs/input.16.wav",
"input.16.wav"};
unsigned i;
const char *filename = NULL;
// Init library
EpConfig ep_cfg;
ep.libInit( ep_cfg );
for (i=0; i<PJ_ARRAY_SIZE(paths); ++i) {
if (pj_file_exists(paths[i])) {
filename = paths[i];
break;
}
}
if (!filename) {
PJSUA2_RAISE_ERROR3(PJ_ENOTFOUND, "mainProg3()",
"Could not locate input.16.wav");
}
// Start library
ep.libStart();
std::cout << "*** PJSUA2 STARTED ***" << std::endl;
// Create player and recorder
{
AudioMediaPlayer amp;
amp.createPlayer(filename);
AudioMediaRecorder amr;
amr.createRecorder("recorder_test_output.wav");
amp.startTransmit(ep.audDevManager().getPlaybackDevMedia());
amp.startTransmit(amr);
pj_thread_sleep(5000);
}
}