📄 callmanagertest.cpp
字号:
new CallManager(FALSE, NULL, //LineMgr TRUE, // early media in 180 ringing NULL, // CodecFactory rtpPortStart, // rtp start rtpPortEnd, // rtp end "sip:153@pingtel.com", "sip:153@pingtel.com", sipUA, //SipUserAgent 0, // sipSessionReinviteTimer NULL, // mgcpStackTask NULL, // defaultCallExtension Connection::RING, // availableBehavior NULL, // unconditionalForwardUrl -1, // forwardOnNoAnswerSeconds NULL, // forwardOnNoAnswerUrl Connection::BUSY, // busyBehavior NULL, // sipForwardOnBusyUrl NULL, // speedNums CallManager::SIP_CALL, // phonesetOutgoingCallProtocol 4, // numDialPlanDigits CallManager::NEAR_END_HOLD, // holdType 5000, // offeringDelay "", // pLocal CP_MAXIMUM_RINGING_EXPIRE_SECONDS, //inviteExpireSeconds QOS_LAYER3_LOW_DELAY_IP_TOS, // expeditedIpTos 10, //maxCalls sipXmediaFactoryFactory(NULL)); //pMediaFactory#if 0 printf("Starting CallManager\n");#endif pCallManager->start(); sipUA->shutdown(TRUE); pCallManager->requestShutdown();#if 0 printf("Deleting CallManager\n");#endif delete pCallManager; } for (i=0; i<NUM_OF_RUNS; ++i) { sipxDestroyMediaFactoryFactory() ; } } void testLineMgrUATeardown() { int i; for (i=0; i<NUM_OF_RUNS; ++i) { SipLineMgr* lineMgr = new SipLineMgr(); lineMgr->StartLineMgr(); SipUserAgent* sipUA = new SipUserAgent( 5090 ,5090 ,5091 ,NULL // default publicAddress ,NULL // default defaultUser ,"127.0.0.1" // default defaultSipAddress ,NULL // default sipProxyServers ,NULL // default sipDirectoryServers ,NULL // default sipRegistryServers ,NULL // default authenticationScheme ,NULL // default authenicateRealm ,NULL // default authenticateDb ,NULL // default authorizeUserIds ,NULL // default authorizePasswords ,NULL // default natPingUrl ,0 // default natPingFrequency ,"PING" // natPingMethod ,lineMgr ); sipUA->start(); int rtpPortStart = 9000; int rtpPortEnd = 9002; CallManager *pCallManager = new CallManager(FALSE, NULL, //LineMgr TRUE, // early media in 180 ringing NULL, // CodecFactory rtpPortStart, // rtp start rtpPortEnd, // rtp end "sip:153@pingtel.com", "sip:153@pingtel.com", sipUA, //SipUserAgent 0, // sipSessionReinviteTimer NULL, // mgcpStackTask NULL, // defaultCallExtension Connection::RING, // availableBehavior NULL, // unconditionalForwardUrl -1, // forwardOnNoAnswerSeconds NULL, // forwardOnNoAnswerUrl Connection::BUSY, // busyBehavior NULL, // sipForwardOnBusyUrl NULL, // speedNums CallManager::SIP_CALL, // phonesetOutgoingCallProtocol 4, // numDialPlanDigits CallManager::NEAR_END_HOLD, // holdType 5000, // offeringDelay "", // pLocal CP_MAXIMUM_RINGING_EXPIRE_SECONDS, //inviteExpireSeconds QOS_LAYER3_LOW_DELAY_IP_TOS, // expeditedIpTos 10, //maxCalls sipXmediaFactoryFactory(NULL)); //pMediaFactory#if 0 printf("Starting CallManager\n");#endif pCallManager->start(); lineMgr->requestShutdown(); sipUA->shutdown(TRUE); pCallManager->requestShutdown();#if 0 printf("Deleting CallManager\n");#endif // Delete lineMgr *after* CallManager - this seems to fix the problem // that SipClient->run() encounters a NULL socket. delete pCallManager; delete lineMgr; } for (i=0; i<NUM_OF_RUNS; ++i) { sipxDestroyMediaFactoryFactory() ; } } void testRefreshMgrUATeardown() { int i; for (i=0; i<NUM_OF_RUNS; ++i) { SipLineMgr* lineMgr = new SipLineMgr(); SipRefreshMgr* refreshMgr = new SipRefreshMgr(); lineMgr->StartLineMgr(); lineMgr->initializeRefreshMgr( refreshMgr ); SipUserAgent* sipUA = new SipUserAgent( 5090 ,5090 ,5091 ,NULL // default publicAddress ,NULL // default defaultUser ,"127.0.0.1" // default defaultSipAddress ,NULL // default sipProxyServers ,NULL // default sipDirectoryServers ,NULL // default sipRegistryServers ,NULL // default authenticationScheme ,NULL // default authenicateRealm ,NULL // default authenticateDb ,NULL // default authorizeUserIds ,NULL // default authorizePasswords ,NULL // default natPingUrl ,0 // default natPingFrequency ,"PING" // natPingMethod ,lineMgr ); sipUA->start(); refreshMgr->init(sipUA); int rtpPortStart = 9000; int rtpPortEnd = 9002; CallManager *pCallManager = new CallManager(FALSE, NULL, //LineMgr TRUE, // early media in 180 ringing NULL, // CodecFactory rtpPortStart, // rtp start rtpPortEnd, // rtp end "sip:153@pingtel.com", "sip:153@pingtel.com", sipUA, //SipUserAgent 0, // sipSessionReinviteTimer NULL, // mgcpStackTask NULL, // defaultCallExtension Connection::RING, // availableBehavior NULL, // unconditionalForwardUrl -1, // forwardOnNoAnswerSeconds NULL, // forwardOnNoAnswerUrl Connection::BUSY, // busyBehavior NULL, // sipForwardOnBusyUrl NULL, // speedNums CallManager::SIP_CALL, // phonesetOutgoingCallProtocol 4, // numDialPlanDigits CallManager::NEAR_END_HOLD, // holdType 5000, // offeringDelay "", // pLocal CP_MAXIMUM_RINGING_EXPIRE_SECONDS, //inviteExpireSeconds QOS_LAYER3_LOW_DELAY_IP_TOS, // expeditedIpTos 10, //maxCalls sipXmediaFactoryFactory(NULL)); //pMediaFactory#if 0 printf("Starting CallManager\n");#endif pCallManager->start(); lineMgr->requestShutdown(); refreshMgr->requestShutdown(); sipUA->shutdown(TRUE); pCallManager->requestShutdown();#if 0 printf("Deleting CallManager\n");#endif delete pCallManager; delete refreshMgr; delete lineMgr; } for (i=0; i<NUM_OF_RUNS; ++i) { sipxDestroyMediaFactoryFactory() ; } }};CPPUNIT_TEST_SUITE_REGISTRATION(CallManangerTest);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -