c++ ptlib PNotifier 在 OPAL 中的使用

标签 c++ api voip opalvoip

我正在使用 OpalVoip 制作软电话应用程序,但我遇到了以下问题:

void MyManager::main()
{
    //variables
    PNotifier notify; // this is the problem
    //it is the template PNotifierFunctionTemplate<INT>

    //more stuff 

    listener->Open(notify); 

    //listener is of type OpalListenerUDP
    //it should start the listener and wait for incoming connection
    //but however i need to pass this NOTIFY which should be the INT parameter to the
    //new OpalTransport instance created by the listener...
    //however OpalListenerUDP only creates OpalTransport after the connection is
    //accepted as so in following: OpalListenerUDP::Accept(/*time interval*/)
    //
    //So far I think that this notifier should be a pointer to an object of type
    //OpalListenerUDP but i have no idea how to get it done 
}

Red,我们将不胜感激。

最佳答案

在深入研究蛋白石源代码后,我找到了解决方案。 事实证明

OpalConnection::StartListener(OpalListener&);

将完成打开监听器的工作,因此无需调用 OpalListener::Open(),之后只需调用 OpalListener::Accept 即可接受连接。

关于c++ ptlib PNotifier 在 OPAL 中的使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12433090/

相关文章:

c++ - tesseract-ocr 如何包含 baseapi.h

facebook - 我可以获取不在我域中的页面的 Facebook 点赞数吗?

call - 如何在使用 CallKit 接听电话后保持 iOS 原生通话 UI

c++ - G++ 将 .hpp 和 .cpp 文件编译为共享库

c++ - C++ 中的类前向声明

c++ - Keil uVision4 armcc : Using C++ standard includes <cstdint>

c++ - Visual Studio 2017 cMake 图 TableView

python - 让尝试更快地捕捉 Python

ios - 网络电话 XCode 8、Swift 3 和 iOS 9.x

Asterisk 可变最大长度