pjsua2 ドキュメントでは、デモ コードは次のようになります。
// Configure an AccountConfig
AccountConfig acfg;
acfg.idUri = "sip:test@pjsip.org";
acfg.regConfig.registrarUri = "sip:pjsip.org";
AuthCredInfo cred("digest", "*", "test", 0, "secret");
acfg.sipConfig.authCreds.push_back( cred );
// Create the account
MyAccount *acc = new MyAccount;
acc->create(acfg);
// Here we don't have anything else to do..
pj_thread_sleep(10000);
// Delete the account. This will unregister from server
delete acc;
// This will implicitly shutdown the library
return 0;
pj_thread_sleep(10000)
アプリの終了を回避するために使用します。
そして、常にサーバー側として実行されているpjsua2アプリが必要です。終了しないでください。
pj_thread_sleep
そのため、「loop_forever」などの代わりにその関数を使用する必要があります。ありがとうございます。